cancel
Showing results for 
Search instead for 
Did you mean: 

Making a form submission with HTTP_AAE

Former Member
0 Kudos
573

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

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

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.

Postman - REST Client (Packaged App) - Chrome Web Store

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

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:

Configuring Receiver Plain HTTP Adapter in Integration Directory - Configuring the Plain HTTP Adapte...

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

Former Member
0 Kudos

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