cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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..

0 Likes
View Entire Topic
former_member181985
Active Contributor
0 Likes
former_member198445
Participant
0 Likes

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..

Former Member
0 Likes

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.

former_member198445
Participant
0 Likes

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

azharshaikh
Active Contributor
0 Likes

Hi Amith,

Can you try to do a test with the approach you mentioned and check the results...from SPROXY try to push the User ID/pwd and map it to the fields in the Target SOAP structure and check the status in Channel logs if it helps..

Regards,

Azhar

Former Member
0 Likes

Hi Amith,

As far as i know you can not treat the header as part of your method Execute because the header is not part of the payload.

As you i haven't tried to change the header in a PI proxy, but i can find the class to change the header in the proxy class:

Regards.

former_member198445
Participant
0 Likes

You're right Inaki,

I am only able to map the Sender message type to one of the WS message types i.e. either the header or payload or response.

I will try the solution provided by Praveen or maybe use an XSLT mapping and get back..

Regards,

Amith