cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SOAP Receiver

Former Member
0 Kudos

Hello PI friends,

I'm connecting PI to an external SOAP web service developed in .NET. I created a scenario which should be very close to what I need but I was getting an error when testing in RWB:

SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 400 Bad Request

So then I captured my payload and tried to get this working in SOAPUI, but came to the same 400 response.

I have a prototype program written in .NET which can execute the call correctly :-).

I watched this in Fiddler and compared the headers / payload to what I had, making an interesting discovery.

The overall message structure is something like this:

<soap:Envelope>

<soap:Body>

<WebServiceMethod>

<usuario/>

<password/>

<MyPayload>

.....more "XML", I use quotes here for a reason, please read on...

</MyPayload>

</WebServiceMethod>

</Body>

</Envelope>

What I noticed in Fiddler with the working .NET prototype is everything inside MyPayload is escaped XML, like: &lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;

My message in PI is sending true XML inside that element structure. So when I change from my payload in SOAPUI using that escaped notation it works great.

But now either I need to accomplish this strange notation in PI, or perhaps I am doing something wrong with the way I've configured my datatype and mapping in the first place and it should always get escaped this way by using only passing the "MyPayload" section into the SOAP adapter?

However, when I tried this I am missing the key parts of the SOAP Body... e.g. WebServiceMethod, usuario, password, MyPayload

(BTW - This web service is in Spanish so username is really "usuario". I don't know if there is a way for this to be passed using the Adapter authentication options or if it must be coded into the message body)

Currently I named my datatype to match like "WebServiceMethod" and then defined all nodes underneath this. When I capture the SOAP output it looks OK to me structure wise... its just this internal web service XML payload which is giving me trouble.

Anyone run into this before? I hope it is something simple, I'm not a web service developer and am more accustomed to using the RFC / IDOC / JMS / JDBC adapters. Thanks for your ideas.

-Aaron

Accepted Solutions (1)

Accepted Solutions (1)

JaySchwendemann
Active Contributor
0 Kudos

Hi Aaron,

about "usario" being part of payload: The receiver seems to want it that way.As long as transport protocol is HTTPS you should not be worried about this.

About your escaped XML: I'm assuming this is a follow up of your last post? Anyways, having an additional <?xml version...> statement within an xml document is not allowed and would render the whole document ill-formed (is that proper English?) Seems like the .net program implicitly sends all payload data (maybe only the actual data within the tags) through a serializer , which is quite normal / best practice.

You could do so on PI also of course. As the .net program works, receiver should be able (or even may assume) that any data within <MyPayload> is serialized. Have a look at my post in your former thread about some possible util classes for that. (Beware, I'm not a Java expert and haven't done this yet, so YMMV)

HTH

Cheers

Jens

Former Member
0 Kudos

Yes Jens, as you guessed it is a follow on 🙂

So serializing this data is maybe a better terminology.

I'm looking for experience with SOAP adapter, is this a common need in developing web services?

I was working with a different web service before this and everything needed base64 encoded for the <MyPayload> type section which I guess solved all of these problems.

Former Member
0 Kudos

I ended up running through 2 mappings to get the internal payload information in the escaped form like we needed.

Answers (0)