on 05-14-2015 5:34 PM
Hello,
I want to send username and password information to an aspx page. Then this page will return me an xml response.
So if I make a HTTP POST request with
Content-Type: application/x-www-form-urlencoded
and parameters
pwd: ******
uid: ******
The scenario will work.
The HTTP Request body is like that
uid=****&pwd=****
and it works, but I couldn't get it right on SAP PI.
I've filled out the parameters name on the advanced tab but despite my all efforts I could not make a form submission with HTTP POST
After numerous attempts I've achieved to send this data via the PI HTTP_AAE using an XSLT mapping but there must be an easier way.
Here is my configuration:
With this XSL i can get rid of the XML declaration and tags but when i leave the method as text then the communication channel receives an error. And if I choose xml or HTML the ampersand sign & is killing me. I sent to the target pwd=*****&uid=****** which returns me "the password you've entered is wrong" !
This "set form" option definitely mean something but. I have absolutely no idea what to type within the "MainPayloadParameterName"
I've tried MainPayload , UrlParamOne , the field in the message type, but all resulted with no success
Gokhan,
"After numerous attempts I've achieved to send this data via the PI HTTP_AAE using an XSLT mapping but there must be an easier way."
XSLT and Java Mapping can produce text output (non-XML). You can try Java mapping.
Use chrome extension to test target http post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gokhan,
With this XSL i can get rid of the XML declaration and tags but when i leave the method as text then the communication channel receives an error. And if I choose xml or HTML the ampersand sign & is killing me. I sent to the target pwd=*****&uid=******
There is no need to escape the & to & when the output is not XML. Retain the ampersand as is.
This "set form" option definitely mean something but. I have absolutely no idea what to type within the "MainPayloadParameterName"
If you remember the old HTTP Adapter, there is an option there for a prolog and an epilog. This would make the request become a form:
In the Java HTTP adapter, check the setForm and then in the previous example (open the link and scroll to the bottom), the value would be &cmd=T&loaderXML= . I'm not sure how to place the epilog as they may have removed support from it.
PS: Have you checked with an HTTP sniffer to see what else you have missed? You can also use the SOAP adapter for your requirement see my How-To page 22.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In XSL, kindly maintain method as "text" and encoding as "windows-1254" instead of "UTF-8".
When you were using method as "XML", at that time the character * was acting as a special character, and hence while getting converted to XML it was getting converted to "&".
Regards,
Souvik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.