cancel
Showing results for 
Search instead for 
Did you mean: 

Payload structure not visible in Moni

Former Member
0 Kudos

Hello All,

One of the interface where we are calling RESTful webservice thru java code, when we calling java code from standalone the webservice working fine based on input parameters webservice sending response back, but the same one when I import in as Import Archive in PI, and test this scenario. I see success in moni, but  I do not see request-target structure payload. I see only request sender-payload structure in moni. 

At this point I only testing request map for call the webservice , where I am getting this error.

Any idea what is the cause of this? Network issue? but this java code working fine in same Network.

Trace showing following information:

<Trace level="1" type="T">Reading sender agreement</Trace>

<Trace level="1" type="T">Inbound validation by adapter does not take place</Trace>

<Trace level="1" type="T">Inbound validation by Integration Engine does not take place</Trace>

Other question was , since this class file we imported into PI, how do I send the input parameters to this class file. As original sender was file, from CSV file we'll take input parameters and send those to this java code and pass it to webservice.

Right now for testing  purpose i have hardcoded input values in Java code and trying to call this webservice, and I am using  sender side HTTP adapter to invoke this PI interface.

One more questions was, since we are calling this webservice thru java mapping, what adapter should I use in receiver?

Thanks,

Gayatri.

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Gayatri,

                   

Any idea what is the cause of this? Network issue? but this java code working fine in same Network.

ans) Please include trace statements within java code to find out target xml created by the code.

here are few articles/blogs on the issue . A very useful blog

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/09/18/tracing-in-sap-pi-731-single-stac...

by  Kapila Epasinghe



SAPTechnical.COM - Handling and Tracing Runtime Exceptions in Java Mapping (SAP PI/XI)

By Prasanna Krishna Mynam

Other question was , since this class file we imported into PI, how do I send the input parameters to this class file.

ans)  The input source XML should contain necessary values. In case you need to pass fixed values to the mapping you can look into this article parametrized java mapping

http://help.sap.com/saphelp_nwpi71/helpdata/en/43/bc2fd4da1e1bbce10000000a1553f7/content.htm

One more questions was, since we are calling this webservice thru java mapping, what adapter should I use in receiver?

ans)  try to execute the java mapping code from your local system. In this case you do not require any adapter to communicate with web service right?. Apply the same principle for java mapping within PI server. Here also you do not need any receiver adapter. In fact the whole idea of using a java mapping was to avoid using a receiver adapter.

Regards

Anupam

Former Member
0 Kudos

Thanks , Will consider these points.

Reg this Answer from you:

One more questions was, since we are calling this webservice thru java mapping, what adapter should I use in receiver?

>>>ans)  try to execute the java mapping code from your local system. In this case you do not require any adapter to communicate with web service right?. Apply the same principle for java mapping within PI server. Here also you do not need any receiver adapter. In fact the whole idea of using a java mapping was to avoid using a receiver adapter.

Q) I did not get this answer clearly, If I run that java code using eclipse/standalone I can able to call that webservice and getting the response back, but when I import this code and calling thru PI, only giving the issue

Seems to my java code point of view , we don't need receiver adapter in PI. but just wondering PI will allow without Receiver channel? Any way I'll ...

You told me execute the java mapping code from your local system?  can you give me more clarity on this.

Thanks your time.

Gayatri.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Gayatri,

                  Java code is responsible for sending the request and accepting the response.

You can see that java mapping is able to do this when you run the code in eclipse in your local system right?. That's what I meant.

If java mapping is able to  send and receive response you see there is no need for adapter. Now coming to the question why there is an issue in PI? Please add exception at the point where the mapping tries to connect to the web server. Put the result in trace steps. I am sure you will get the reason of error. Generally the reason is network firewall which stops request flow to target server.

Regards

Anupam

Former Member
0 Kudos

Thanks Anupam,

Your suggestions worked until getting the response from REST service as plain http string using Java map. Initially I thought it required receiver adapter, later I realized the java code do every thing with out adapters.

The output showing like this :

<String output134 = "<string xmlns="http://schemas.microsoft.com/2003/15/Normalization/"><xml version="1.0" encoding="utf-8"?><EMP><Email_Address>NNNNNNN</Email_Address><First_Name>JJJJJJ</First_Name><Last_Name>MMMMMM</Last_Name><Manager>XXXXXX</Manager></EMP></string >

Now I need to convert this string into PI-XML format and after send this response to file formats.

Can you let me know any suggestions how to handle from here?

I think I need to parse this string into PI-XML format using Java code and after configure the File/receiver adapter and do the content conversion and drop the file in destination folder, Am I right?

If you think any changes please let me know.

Any sample code available for parse this response into PI-XML ?

Thank you.

Gayatri.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Gayatri,

                

I think I need to parse this string into PI-XML format using Java code and after configure the File/receiver adapter and do the content conversion and drop the file in destination folder, Am I right?

ans) you are absolutely right. Configure a receiver file adapter and output the response from web service to the adapter. The response from web service is in form of a string , please convert it to output stream/bytes and write to receiver file adapter. That's all you need to do.

Here is a sample code to do so


public void print(String s){

  private OutputStream o;
  o
.write(s.getBytes());
}

Regards

Anupam

Answers (0)