I want to create a support button in a Java application which should send an e-mail to the support e-mail address with some attachments.
The problem is that the mail server is variable for different users, therefore I cannot use the JavaMail API because I cannot set the server. I am left with the basic mailTo feature, with the following parameters:
mailTo:email#domain.com?subject=TEST%20SUBJECT&body=TEST%20BODY
This command will open the default e-mail service(Lotus Notes) on the user's PC with the content of the e-mail already formatted.
I also want to add an attachment to the e-mail, but since mailTo does not allow it, the only option left is to add it from the body of the e-mail.
I manually added an attachement to the e-mail body and looking at it's properties I do not have much options to work with:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="timer://simpleTimer?period=1000" />
<setBody>
<simple>
<Hello from timer at $ header.firedTime } />
</simple>
</setBody>
<to uri="stream:out" />
</route>
</camelContext>
</beans
I am not familiar with web-development, so I thought, are there any tags or is it possible to add some web-scripts to the e-mail body to automatically load the attachement from an absolute path?
I am expecting to be something like:
mailTo:email#domain.com?subject=TEST%20SUBJECT&body=<some tag which adds an attachement>
or
mailTo:email#domain.com?subject=TEST%20SUBJECT&body=some_web_script
Related
How to recall Items using EWS?
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP2"/>
</soap:Header>
<soap:Body>
<RecallItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:ItemIds>
<t:ItemId Id="[ItemId]"/>
</t:ItemIds>
<t:DeleteType>SendOnly</t:DeleteType>
<t:SuppressReadReceipts>false</t:SuppressReadReceipts>
</RecallItem>
</soap:Body>
</soap:Envelope>
The code above not work.
It returns ErrorInvalidRequest.
How to recall items?
Message recall is available after you click Send and is available only if both you and the recipient have a Microsoft 365 or Microsoft Exchange email account in the same organization. So, for example, a message sent to or from a Hotmail, Gmail, or live.com account can't be recalled.
Make sure that the recipient uses Office365 or Exchange account in the same organization.
Also you may check how the Delete an item by using the EWS Managed API works.
I have this kind of "guidelines" to call a SOAP service:
URL: http://80.211.113.172:8080/soap
No WSDL at all!
The XSD for request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="/soap_serv" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPENC="http://schemas.xmlsoap.org/soap/encoding/" SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:TRACKING>
<ldv xsi:type="xsd:string">2020.00.0070423</ldv>
<codcli xsi:nil="true"/>
<rifcli xsi:nil="true"/>
<anno_bl xsi:nil="true"/>
</ns1:TRACKING>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Does anyone know how to create a request object to send with SoapUI?
The XML you are showing isn't an XML Schema (or XSD file). As pointed out in the comment by #kimbert, that is actually an SOAP XML message. The payload inside it is what an XML instance of an XSD schema would be.
You have two options:
ask for a WSDL for the web service so that you can generate some client code to help you with the calls.
if a WSDL is not available, ask for better documentation for how to call the service. Not sure where you got that example but is the operation name TRACKING? Is the ns1 prefix pointing to the correct namespace? Should the elements inside the TRACKING element also be in this namespace? Note also that you are using codcli and rifcli in your call, when that guideline shows cod_cli and rif_cli. You most likely also need to send values for your elements, not have them null like that.
Not having a WSDL or valid up to date documentation for how the exchanged messages should look like will make things very difficult for you in interacting with the web service.
I'm creating a chat app using the Electron Framework and node-xmpp module for XMPP communication.
I have managed to do almost everything except making Personal Eventing Protocol to work. Specifically sending a new nickname to the roster.
When I send the PEP stanza
<iq from='test#localhost' type='set' id='pub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/nick'>
<item>
<nick xmlns='http://jabber.org/protocol/nick'>I am a test user</nick>
</item>
</publish>
</pubsub>
</iq>
I get a response IQ stanza:
<iq from="test#localhost" type="result" to="test#localhost/testapp" id="pub1">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<publish node="http://jabber.org/protocol/nick">
<item id="5D4E0BB8EB3C6"/>
</publish>
</pubsub>
</iq>
Now, according to XEP-172 example 6 I should get a Message with the nickname that is also sent to all my contacts. It should look like this:
<message from='test#localhost' to='otheruser#localhost' type='headline' id='foo'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/nick'>
<item>
<nick xmlns='http://jabber.org/protocol/nick'>I am a test user</nick>
</item>
</items>
</event>
<addresses xmlns='http://jabber.org/protocol/address'>
<address type='replyto' jid='test#localhost/chatapp'/>
</addresses>
</message>
The thing is I'm not getting any message to other contacts in the user's roster. Not even to myself.
Is there any step I'm missing to enable PEP on a ejabberd server? Any extra stanza or information I should include?
Thanks!
If you want to receive other users' nickname events you should include http://jabber.org/protocol/nick+notify string into your Entity Capabilities list.
See Filtered notifications for detailed description.
hi i am sending connect invitation by email using linkedin iphone api
Request xml:
<?xml version='1.0' encoding='UTF-8'?>
<mailbox-item>
<recipients>
<recipient>
<person path="/people/email=%#">
<first-name>%#</first-name>
<last-name>%#</last-name>
</person>
</recipient>
</recipients>
<subject>Invitation to Connect</subject>
<body>Please join my professional network on LinkedIn.</body>
<item-content>
<invitation-request>
<connect-type>friend</connect-type>
</invitation-request>
</item-content>
</mailbox-item>
where %# indicates dynamic value.
Content Type: text/xml
Request Method: POST
Response xml :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<status>401</status>
<timestamp>1342092385484</timestamp>
<request-id>FX9SK3ZVG9</request-id>
<error-code>0</error-code>
<message>[unauthorized]. OAU:076lb67kcfe2|dc01dc46-4d78-44d2-9f9b-49053b8094db|*01|*01:1342092534:iZ/mDlOL7eo4fGv2O/rQZKe8oCA=</message>
</error>
Also verified that authorization header is proper.
I have also debugged with oAuth debug console, i have enter same values in debug console, but signature key are different.
So is it a problem with signature key ??
I have also gone through forums.
But still i am not able to find an exact problem.
Any help will be appreciated.
Thanks
There's a sample LinkedIn iPhone client on github here:
https://github.com/synedra/LinkedIn-OAuth-Sample-Client
You should be able to use that to see what the proper headers look like. As you're on a macintosh (or wouldn't be developing for the iPhone), I strongly encourage you to use HTTPScoop to watch the traffic when using the simulator and see what the differences are between what your application is doing and what the sample client does.
I've been tasked with designing a very simple SSO (single sign-on) process. My employer has specified that it should be implemented in SAML. I'd like to create messages that are absolutely as simple as possible while confirming to the SAML spec.
I'd be really grateful if some of you would look at my request and response messages and tell me if they make sense for my purpose, if they include anything that doesn't need to be there, and if they are missing anything that does need to be there.
Additionally, I'd like to know where in the response I should put additional information about the subject; in particular, the subject's email address.
The interaction needs to work as follows:
User requests service from service provider at this point, the service provider knows nothing about the user.
Service provider requests authentication for user from identity provider
User is authenticated/registered by identity provider
Identity provider responds to Service provider with authentication success message, PLUS user's email address.
Here's what I think the request should be:
<?xml version="1.0" encoding="UTF-8"?>
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="abc"
IssueInstant="1970-01-01T00:00:00.000Z"
Version="2.0"
AssertionConsumerServiceURL="http://www.IdentityProvider.com/loginPage">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
http://www.serviceprovider.com
</saml:Issuer>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">3f7b3dcf-1674-4ecd-92c8-1544f346baf8</saml:NameID>
</saml:Subject>
Here's what I think the response should be:
<?xml version="1.0" encoding="UTF-8"?>
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Destination="http://www.serviceprovider.com/desitnationURL" ID="123" IssueInstant="2008-11-21T17:13:42.872Z" Version="2.0">
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Version="2.0">
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">3f7b3dcf-1674-4ecd-92c8-1544f346baf8</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser">
<saml:SubjectConfirmationData InResponseTo="abc"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:AuthnStatement AuthnInstant="2008-11-21T17:13:42.899Z">
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
</saml:Assertion>
</samlp:Response>
So, again, my questions are:
Is this a valid SAML interaction?
Can either the request or response XML be simplified?
Where in the response should I put the subject's email address?
I really appreciate your help. Thanks so much!
-Morgan
You don't need a Subject in the request - looking at the specs, I think it can be this simple:
<?xml version="1.0" encoding="UTF-8"?>
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="abc" Version="2.0" IssueInstant="1970-01-01T00:00:00.000Z"
</samlp:AuthnRequest>
Omitting all the optional elements and attributes (Issuer, NameIDPolicy, AssertionConsumerServiceURL etc) means that your identity provider and service provider have agreed these up front, so they don't need to be specified in the AuthnRequest. If you're in control of both ends and you absolutely know that you'll never add another provider to the mix then this is a perfectly legal SAML request. It means "Authenticate the user who presents this via the mechanism we agreed".
Looking at the response, I think this is the minimal case:
<?xml version="1.0" encoding="UTF-8"?>
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="123" InResponseTo="abc" IssueInstant="2008-11-21T17:13:42.872Z"
Version="2.0">
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Version="2.0">
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
user#example.com
</saml:NameID>
</saml:Subject>
<saml:AuthnStatement AuthnInstant="2008-11-21T17:13:42.899Z">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
</saml:Assertion>
</samlp:Response>
You can send the user's email address as the NameID, and the AuthnStatement just carries the fact that the identity provider authenticated the user at the given time by the given mechanism. Again, this is stripped to the bone - we omit attributes and elements such as Destination and SubjectConfirmationMethod as they are superfluous to the use case.
So, this response says "This is user#example.com; he logged in with a password over a protected transport (SSL/TLS) at 17:13:42 on 11/21/2008".
You should take a look at the SAML 2.0 profiles spec for the exact mechanism for passing these back and forth. The AuthnRequest is usually compressed, encoded and passed as a URL parameter in a GET, while the simplest way to return the Response is via the POST binding - return an HTML page with a form whose target is the service provider, and which is submitted at page load time via some JavaScript.
Yes, it seems to be a SAML interaction
Your authentication response is rather simple now. Usually you would want to add more attributes in your assertions. And for the security sake, at least the response should be signed.
It uses to be set after the .In your case you do not have it, so after the status should be ok...
I would recommend you to create an account in http://www.ssocircle.com, and with one HTTP headers profiler (i.e. the classic and great LiveHttpHeaders) and a SAML2 debugger (Feide Rn SAML2 debugger thanks guys!) take a look at the request/response flow...
Hope it helps,
Luis
ps: if you want to take a look at a complete implementation SP/IdP: http://sourceforge.net/projects/spring-saml/files%2F0.1/