Skip to Content
0

Get XML from website with dynamic parameter

Jan 10, 2017 at 02:32 PM

111

avatar image
Former Member

Hello People,

I have a scenario in which I have to get the XML from a website, I've read many posts but since I'm kind newbie with PI(Just made a few JDBC,FTP scenarios) I'm not getting exactly what I have to do.

I'm on SAP PI 7.4 double stack without REST adapter. Using SoapUI to get the XML is pretty easy with REST project, analysing the raw information it says "Content-Type: text/xml"

What I was trying to do is create a Proxy<->PI<->HTTP_AAE(get) synchronous interface sending a date as a parameter for the URL and getting the XML as the response

I have many doubts among them are, can I make a simple mapping sending the date and retrieving the XML from the service? How am I going to redirect the date value from my outbound XML to the website parameter? On HTTP_AAE adapter what do I have to fill the obligatory field "Main Payload PArameter Name", and the field Target Port, is it 80 or another?

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Manoj K Jan 10, 2017 at 03:11 PM
1

Marcelo,

can I make a simple mapping sending the date and retrieving the XML from the service?

Yes, you just need to map the date to the UDF which generates the URL for the website.

How am I going to redirect the date value from my outbound XML to the website parameter?

This can be done UDF for dynamically generating URl , but however I am not sure if HTTP_AAE does support dynamic URL so instead of HTTP_AAE you can use SOAP adapter with option enabled "Do not use Soap Envelope" in reciver SOAP channel this behaves like HTT_AAE adapter only.

and the field Target Port, is it 80 or another?

Usually for HTTP its 80 and HTTPS its 443 port , cross check with the third party.

Br,

Manoj

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Manoj

I did what you told me and changed to SOAP adapter and used the UDF as told here. Right now I'm getting the error "ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier" I'll instal the certificate on the server and tell if everything is fine

0
Former Member

Hello Manoj,

I finally was able to pass through the SSL problem, but know I'm facing a new error, can you help me?

I'm getting this error on monitor

Runtime exception occurred during application mapping 
com/sap/xi/tf/_mm_XXXXXXXXXX_Resp_Out_In_; 
com.sap.aii.utilxi.misc.api.BaseRuntimeException:Fatal Error: 
com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here (:main:, row:2, col:2)

Looks like a mapping error. One thing I'm not sure is about the first element on my mapping

The mapping is http://i.imgur.com/TWZXv5o.jpg

And the actual XML from the website is http://i.imgur.com/ihNK6t3.jpg

Sorry, but I'm having a problem uploading the image to SCN then I used IMGUR to store the print

Thanks

0