cancel
Showing results for 
Search instead for 
Did you mean: 

Calling multiple methods of Inbound Interface in sequence

Former Member
0 Kudos

Hi Gurus,

I am working on a web service scenario from PI. My Receiver is a secure external web service.

This external webservice has several methods and each time I need to call one of the soapin methods, I also need to populate a header with authentication with the payload. So I need to call HeaderLogin method and QuerySoapIn method in sequence may be.

'Header login' message doesn't return anything. 'Querysoapin' returns a 'Resultset' with dynamic field list.

I have two problems

Firstly, How do I achieve mentioning two methods as Input messages in my Inbound Interface? (I can either select QuerySoapIn or HeaderLogin)

Secondly what do I define 'ResultSet' as in my Outbound Interface's output structure to capture the 'Resultset' returned by the external interface, as it has no fixed structure and the fields of this are generated at runtime ?

Since the fields of the Result Set node is generated dynamically, it is defined as 'xsd:any' in the external web service wsdl. So to match that to the closest possibility, I have defined it as xsd:entity at my end since I couldn't find xsd:any in PI data type definition editor.

Please also keep in mind that this external web service expects authentication at the document/payload level and not at web service adapter level. So please don't advise to provide username/pwd at receiver soap adapter config as this is not applicable for my scenario.

I am looking for quick help.

Thanks

Jhansi

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks very much for all the help..:-)

Since there are other in-consistencies with the web service output fields we have asked the provider to readdress this service which they are going to do shortly. Hopefully the new version of the web service should be good enough.

Former Member
0 Kudos

Hi Peter,

Nope that is not what the web service does.

I checked with soapui, the request generated by this tool some how incorporates the header login bit of the xml for both the methods of the web service

So when I delete the query bits of the xml, it fails. So just the headerlogin by itself cannot be called and it doesn't return HTTP Ok.

This is the sample request created by SOAP UI:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v0="http://www.xxxxxxx/v0-1">

<soapenv:Header>

<v0:HeaderLogin>

<!You may enter the following 2 items in any order>

<!type: string>

<username>user</username>

<!type: string>

<password>pass</password>

</v0:HeaderLogin>

</soapenv:Header>

<soapenv:Body>

<v0:query type="full">

<!type: string>

<dataset>xyz</dataset>

</v0:query>

</soapenv:Body>

</soapenv:Envelope>

the Input structure for my method which I need to call starts with 'Query' tag..So I need to populate this headerlogin part of it before I call the method.

Hope you got my problem now.

Thanks

Jhansi

Former Member
0 Kudos

Hi Jhansi,

hope I get you right this time

I see the HeaderLogin is in the soap envelope, and you have your query in the SOAP body. During mapping, you only have access to the soap body, and some header attributes. I presume only your query part is dynamic, and you have a fixed user and password.

If I'm not mistaken, the SOAP adapter authenticates via the HTTP header, so there's no standard way to access the SOAP header. I think your only option will be to use the HTTP adapter, and build the SOAP request, envelope, header and body, yourself. You can do this with an xslt mapping step, which you specify as a second mapping step in your operation mapping. First, you build your query xml, and then the xslt mapping step will pick this up.

Your xslt will look something like this:

<xsl:stylesheet ...>

<soapenv:Envelope>

<soapenv:Header>

yoursoap_envelope_header_fixed_text_

</soapenv:Header>

<soapenv:Body>

<xsl template select ="/">

<xsl:value-of select="*"/>

</xsl:template>

</soapenv:Body>

</soapenv:Envelope>

</xsl:stylesheet>

If you need dynamic user and password, you can pass parameters to the xslt map. I've written a blog about that ^^

kr,

Peter

Former Member
0 Kudos

Hi Peter,

Thanks very much for your quick help.

I will try your suggestion for xml:any bit of my question.

But still I need the right answer for my first question of calling HeaderLogin method before any other method. What I don't understand is how can I use BPM as u suggested because this method doesn't return any response fr which the BPM process can wait and then trigger the next method. And also, this header login structure is expected as a part of the payload for every method call.?

Hope I am clear with my question.

Thanks

Jhansi

Former Member
0 Kudos

Hi Jhansi,

your HeaderLogin method probably responds by HTTP response code. If you get HTTP 200, then you are authenticated, else not. You don't get an actual XML message as response. No problem, that just means you need to evaluate the technical error. When you don't get an HTTP 200, your send step will get a system error. Test this service with soapUI (free download), and check if this is actually the case.

kr,

Peter

Former Member
0 Kudos

Hi Jhansi,

I have had a similar requirement, needing to call an authentication service before each functional interface operation.

- sequence: whenever you hear this word, you should think BPM. This will enable you to call the authentication service, wiat for a response, and send the next message

- xsd:any : this indeed isn't supported by PI, which wants strong-typed messages. However, the root of your ResultSet message is fixed, so you define only this root element with an xsd:string type. All XML tags that appear under the root are treated as text, and so pass XML validation. This means you will not be able to use graphical mapping, as most of the structure is missing, but you can still use an XSLT or Java mapping in order to process the response.

Hope this helps.

kr,

Peter Glas