Skip to Content
Author's profile photo Former Member

Use curl to test interface with HTTP_AAE adapter

In our community there are already blogs about test tools for Java based HTTP_AAE adapter, like PI 7.30 HTTP Java Adapter Test Tools by William Li. His script works fine, however it has some restrictions, for example, it can run only under Internet Explorer, because in script ActiveXObject is used, and you can’t save test cases, if you want repeat your tests later.

Actually there is a well known command line tool cURL, “client for URL”, which we can use to test HTTP_AAE adapter. This is a swiss knife running both under windows or Linux/Unix system and has many powerful features. To post a file to HTTP_AAE adapter, we can use this tool like:

curl  -i –header “Content-Type:text/xml” \

–user username:password –data@filename.xml \

http://server:port/HttpAdapter/HttpMessageServlet?interfaceNamespace=http://namespacOfSenderInterface&interface=nameOfSenderInterface&senderParty=nameOfSenderParty&senderService=nameOfSenderCoponent&qos=EO

Update: If you are working on Windows operation system, you have to replace single quote with double quote around the URL. It seems that Windows doesn’t like single quote.

If you get HTTP status 200 back, it means that the file is successfully posted.

If you have some files to test or repeat tests, you can write a small windows command script or shell script in Linux to post all the file by running the script only once.

If you want get more details, you can add the option:

–trace-ascii debug.txt

If you need proxy to reach server, just put:

–porxy poxyserver:port

If you need ignore SSL warning, use this option:

-k  or –insecure

I have only mentioned most commonly used options here, and there are a lot of other options, which can be found in curl manual page.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Dingjun,

      Should we install something that can run cURL tools? Where can we get it?

      BTW, SOAP UI also is a good tools to test HTTP_AAE adatper.

      It can save test case and can do volume and workload test also.

      Thanks

      Leon

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Leon,

      you can download this tool here:

      http://curl.haxx.se/download.html

      It's available for Windows, Linux/Unix, Mac and all other popular operations systems.

      Author's profile photo Former Member
      Former Member

      Nice one , Dingjun. 🙂

      --Divyesh

      Author's profile photo Former Member
      Former Member

      Hi Dingjun,

      Though my question is not related to this blog, I read somewhere you had commented that while intergrating SAP to SFDC, we can store the session id so that no need to call the login for every transaction. I am facing the same problem. Can you please let me know how to do this?

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Mona,

      you can call the login to get a valid session id and save it in value mapping in directory. When you need to call SFDC SOAP API, then you read the session id from value mapping. If I'm not wrong, the session id returned by SFDC is valid for 120 minutes. so you also need an interface to update the saved session id.

      Regards

      Dingjun

      Author's profile photo Former Member
      Former Member

      Hi Dingjun,

      Thanks for your quick respone. However can you please send me a link so that i can refer to this step by step since i am just a beginner in PI.

      Or if you can mail me the steps at my email id mona.x.lalwani@gmail.com that would be great help.

      Author's profile photo Akhil Kumar
      Akhil Kumar

      Hi Mona,

      If you have done settings related to SFDC session ID with value mapping, then please post the steps or share me any blog related to this.

      Thanks,

      Akhil