cancel
Showing results for 
Search instead for 
Did you mean: 

How to see the SOAP request created by SOAP Adapter?

0 Kudos

Hello PI-Experts,

I am trying to cal a webservice using a SOAP Adapter. And I am getting some errors back from the receiver party (invalid content type for SOAP: TEXT/HTML; HTTP 500 Internal Server Error).

I would like to see the whole SOAP Request created by the adapter (envelope + Attachements,...).

Thanks

Armin

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Armin,

When i had that error i usually put the check Do Not Use SOAP envelope and to construct the request with the SOAP envelope manually. Then, i can get the exact response of the webservice endpoint in the monitor.

Regards,

0 Kudos

Hi Inaki,

I am now trying this option, after resolving the issue with error 500.

I am using SOAP 1.1 for getting a text/html content.  I deactivated the standard envelope and created it using the PI mapping and some java coding. The message I see in sxi_monitor/RWB after mapping looks good. (Pls see my response to sudhansu)

When I send it using CURL or SOAPUI it works very well. When I send it using SOAP Adapter I get an 401 error (Authority)

User and password are included in SOAP Header. It seems to me that the receiver service cannot read the content and get this information. Maybe it is now a SSL problem between sender and receiver?

Many Thanks

Armin

iaki_vila
Active Contributor
0 Kudos

Hi Armin,

When the problem is the certificate i usually get an error like "bad certificate" or something nearer to the SSL protocol. In SOAPui you could try to use also the username/password:

May be the problem is the configuration in the webservice point and they required the two authentications (SOAP + HTTP). If the problem persists i would contact with them in order to clarify the error and that they give a request  example.

Regards.

Dear Jörg, Inaki and  Sudhansu,

Thank you very much for all responses. They all are were helpful and very interesting.

Following options could be used to see more about the responses:

-XPI-Inspector is also a great tool to check many problems (SSL, .Adapter issues, ..). 

-Finally I installed wireshark on my XI-Server and I got the http request leaving my system. So I could see the request created by my adapter.

(I was trying to create the envelope and the wsse security tags with mapping. I found out I need an AXIS-SOAP Adapter to deal with wsse security tags.)

Many Thanks

Armin

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can you try the following and let me know if it works:

NWA -> Configuration -> Infrastructure -> Java System Properties -> Services -> XPI Service: Messaging System -> Properties -> messaging.SyncMessageRemover.removeBody = false (default = true).

You can then go into http://<host>:port/rwb --> Message Monitoring --> Select Message Content (dropdown)

Thanks,

Sudhansu

0 Kudos

Hi Sudansukumar,

I couldnt find this option in nwa. Maybe it is available in nwa as of 7.10 (Actually I am using a 7.0 PI here. I have not tried it in a PI 7.10 yet)

I used visual admin to set the parameter :

Visualadmin  -  Server - Services - SAP XI AF Messaging - Messaging.syncmessageRemover.remveBody = false

I can not see any more information as before about my message:

<?xml version="1.0" encoding="UTF-8" ?>

<env:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/">

<env:Header>

<wsse:Security>

<wsse:UsernameToken>

<wsse:Username>xxxxx</wsse:Username>

<wsse:Password>xxxxx</wsse:Password>

</wsse:UsernameToken>

</wsse:Security>

</env:Header>

<env:Body>

<uploadDocument xmlns="http://erb.eproc.brz.gv.at/ws/documentupload/20121205/">

<Document encoding="UTF-8">PD94bWwgdm.....bnZvaWNlPg==</Document>

<Settings test="true" />

</uploadDocument>

</env:Body>

</env:Envelope>

I am not sure if this exactly is the SOAP Messsage leaving my adapter !

The URL I am using in my SOAP adapter is a https Link.

Maybe there is some issues with ssl configuration causing the 401 error?

Thanks

Armin

Former Member
0 Kudos

Hi Armin,


<env:Body>

<uploadDocument xmlns="http://erb.eproc.brz.gv.at/ws/documentupload/20121205/">

<Document encoding="UTF-8">PD94bWwgdm.....bnZvaWNlPg==</Document>

<Settings test="true" />

</uploadDocument>

</env:Body>

Is the above SOAP body same as what is being generated in your Operation Mapping when you do a local testing using the same payload ? Then you are correct that it is the same message leaving the adapter.

Thanks,

Sudhansu

0 Kudos


Hi Sudhansu,

I deactivated the SOAP Envelope in SOAP 1.1 Adapter to create the WHOLE envelope including Header (wirh logon informations) and body  in my Operation Mapping. The result of my operation mapping is what I need to deliver to receiver, without any additional envelopes, headers,...

Here is the result of my operation mapping. (When I download this window and send it using CURL, it is working well)

This is the way I am doing it:

I map the BASE64-Content into the whole envelope structure. I map constant values into Envelope Header and attributes, and security fields.

After that I do some corrections on fieldnames,... using a java-mapping:

I hope I am not making a mistake here and this approach is a possible way to create the envelope?

Many thanks

Armin

Former Member
0 Kudos

Hi Armin,

It looks find for the SOAP Envelop generation.

Have you used the SOAP Action in communication channel ?

Thanks,

Sudhansu

Former Member
0 Kudos

Hello Armin,

normally you don't need to care about the SOAP envelope, SAP creates that for you. In your mapping you just care for the payload. Even in a Java Mapping I would expect that you only modify the payload by API access.

If in SXMB_MONI you right-click on "Payloads->Main Document" and select "Download Message" you can save the whole SOAP message in PI in MIME format with headers, body and attachments. I thought you were interested in the SOAP request actually leaving your system. This you don't get in SXMB_MONI.

Regards,

Jörg

Former Member
0 Kudos

Hello Armin,

I recommend you use the XPI Inspector. There may be other ways to obtain the SOAP request from the system, but this one logs almost everything and even things you might not think about in the first place. It should give you the complete HTTP requests and responses.

But if you receive an HTTP 500 I would first try to get logs from the server side. There must be something in their logs then, and probably you'll learn more about your error there than in PI.

Regards,

Jörg

0 Kudos

Hi Jörg,

You were right: I found out, that error 500 was related to some content encoding problems. After correcting them I am getting some 401-errors (authority).

I deployed XPI-Inspector and tried to get my whole SOAP message leaving my system. I can get a lot of usefull informations from the tool. But I cannot see the whole message. (I tried differnet options)

Thank you

Former Member
0 Kudos

Hello Armin,

have you tried the HTTP protocol? Doesn't it print the full HTTP request outgoing and incoming in the trace?

To your problem: I assume you checked your authorizations. I see two possibilities: Either you have an internet proxy behind your PI system which needs extra authorization (to be configured in communication channel) or you have a firewall problem. It is not very logical, but this is often rejected with an HTTP 401. Reading that you use HTTPS there could also be an issue with your certificates. With XPI Inspector you should be able to see which communication exactly fails and on which call you get the 401. The whole SSL handshake should be clearly visible there.

Regards,

Jörg