on 11-11-2014 6:05 AM
Hello experts,
I am trying to consume an external web service in SAP PI (Proxy -> SOAP). The web service uses SOAP 1.1 and has the following SOAP header:
<soapenv:Header>
<urn:AuthenticationInfo>
<urn:userName> </urn:userName>
<urn:password> </urn:password>
<!--Optional:-->
<urn:authentication>?</urn:authentication>
<!--Optional:-->
<urn:locale>?</urn:locale>
<!--Optional:-->
<urn:timeZone>?</urn:timeZone>
</urn:AuthenticationInfo>
</soapenv:Header>
My question is if I can fill the SOAP Header from the proxy consuming ABAP program or do I have to wrote an XSLT mapping for this?
Or, alternatively, will the SOAP Receiver adapter automatically fill the credentials if I maintain the Authentication details in the ID Communication channel?
Looking forward to your responses.
Regards..
Hello experts.
I have used an XSLT mapping and have managed to generate the request message.
Now I have an issue with the response.
My response structure is:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns0:UpdateTaskResponse xmlns:ns0="urn:EQU:SAP:UpdateTask">
<ns0:Request_ID>000000000000008</ns0:Request_ID>
</ns0:UpdateTaskResponse>
</soapenv:Body>
</soapenv:Envelope>
I am unable to map this to my response message type.
I tried using this XSLT:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="*">
<xsl:copy-of select="soap:Body/*"/>
</xsl:template>
</xsl:stylesheet>
But I am still not able to process the response.
Any help on this please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I finally got this scenario working.
The issue was that, in spite of ticking the ‘Do not use SOAP envelope’ checkbox, the response message was wrapped in a SOAP envelope. Also, my endpoint URL in the SOAP comm channel wasn’t the correct one ( I had wrongly used the WSDL link and not the endpoint).
So I changed the URL and then created an inbound XSLT for removing the SOAP envelope from the response message.
The XSLT mentioned in my previous response worked a charm.
I picked up both the XSLTs from Simone Pantaleoni's responses in other threads..
Thanks to all..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this: http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/11/22/addsoapheaderbean-module
Best Regards,
Praveen Gujjeti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank You Praveen.
My question is do I really have to do this? I don't want to customize the header structure as such. I only want to pass the Username and password.
While importing the external definitions, I get the soap header in the interface message type. Can't I just map this to the proxy outbound structure and send the values from the calling ABAP program?
Appreciate your answers..
Hi Amith,
If i understand you right you only want to pass-thorough the header to the ABAP proxy. You only need to set in the SOAP adapters the flag Keep Headers. Later in the ABAP proxy you can get the Header with the class IF_WSPROTOCOL_WS_HEADER. You have some examples in these threads:
Hope this helps.
Regards.
Thanks Inaki, Appreciate your response.
Aren't the examples that you have provided for Non-PI scenario? I have used this in the past to consume a WS directly in ABAP, after creating logical port, etc.
Well,in this scenario i am using PI.
The Sender in my case is a proxy (called from a BADI) and receiver would be a SOAP adapter.
What I am trying to get at is the header would be a part of my request structure - like this:
Isn't it possible to just map the oubound and inbound structures and pass the data while calling the outbound proxy?
CALL METHOD lr_proxy->execute
EXPORTING
output = output (this is where the uname and password would go)
Sorry if I have misunderstood your response.
Regards,
Amith
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.