cancel
Showing results for 
Search instead for 
Did you mean: 

Soap Adapter request header

Former Member
0 Kudos

We are tyring to figure out how to read information in the request header and use it in the SOAP services we have created on PI. The caller sets accept-language and we are supposed to read this out to determine the language to use in responses.

I have been attempting this using ASMA by clicking the check boxes for Set ASMA and Variable Transport binding. I then set the name of the header attribute I want, and try to read it out with a piece of java in the mapping.

I have used ASMA's with other adapters, but not with SOAP.  Am I interpreting the documentation incorrectly?

Example raw message:

POST http://someserver:53000/XISOAPAdapter/MessageServlet?senderParty=&senderService=WEBSERVICES_DEV&rece... HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://sap.com/xi/WebService/soap1.1"
Accept-Language: en-US
Authorization: Basic

User-Agent: Jakarta Commons-HttpClient/3.1
Host: mancala:53000
Content-Length: 276

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="urn:nuskin.com/ws/customer">
   <soapenv:Header/>
   <soapenv:Body>
      <cus:SRCheckRequest>
         <ID>BE1111111</ID>
      </cus:SRCheckRequest>
   </soapenv:Body>
</soapenv:Envelope>

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184681
Active Contributor
0 Kudos

Hi Ron,

I believe you are on the right track . Let me give you a few hints as a checklist:

1. You say that you marked "Set ASMA" and "Variable Transport Binding" checkboxes in sender SOAP CC. Did you check if you can see the Dynamic Config attributes in moni? See how described it in one of his blogs: (for SRemoteUser in his example, but should work identically for you).

2. Use a UDF similar to the one described here: http://www.saptechnical.com/Tips/XI/ASMA/Index.htm to get the value from Dynamic Configuration, based on its name and namespace that you checked in moni. I believe the code should be something close to:

DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters()

   .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/SOAP","Accept-Language");

String languages = conf1.get(key1);

return languages;

Hope this helps,

Greg

Former Member
0 Kudos

I did verify in Moni that the ASMA's are there, but I never see XHeaderName1 or Accept-Language in that list no matter what I put in the SOAP Channel settings.

I currently am using a UDF as you described above to read the ASMA value:

DynamicConfiguration attrib = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/SOAP",keyName);
String val = attrib.get(key);
if(val == null) val = "";
return val;

This is what is in moni:

<SAP:DynamicConfiguration SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SHeaderUSER-AGENT">Jakarta Commons-HttpClient/3.1</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SQueryString">senderParty=&senderService=WEBSERVICES_DEV&receiverParty=&receiverService=&interface=SRCheck&interfaceNamespace=urn:nuskin.com/ws/customer</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/Message/30/general" name="senderAgreementGUID">d675067d2b1b3f4c8e31c4a32c97b5ea</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SRequestScheme">http</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SHeaderSOAPACTION">http://sap.com/xi/WebService/soap1.1</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SServerHost">mancala</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SAuthType">BASIC</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SServerPort">53000</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SRemoteAddr">10.5.61.155</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SRemoteHost">10.5.61.155</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SServerName">mancala</SAP:Record>

  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="SRemoteUser">RKSTAMM</SAP:Record>

  </SAP:DynamicConfiguration>

former_member184681
Active Contributor
0 Kudos

Dear Ron,

Did you try to implement this SAP Note 1470127 - Sender SOAP Adapter- Missing headers in DynamicConfiguration? It looks like it is addressing exactly the same problem as you have. And it is related to many PI versions, so maybe it also relates to yours?

Hope this helps,

Greg

baskar_gopalakrishnan2
Active Contributor
0 Kudos

One possible approach is to use Java mapping and look for Accept-Language String and retrieve value. I don't think there is attribute for the language in the help link

http://help.sap.com/saphelp_nw73/helpdata/en/48/3555240bea31c3e10000000a42189d/content.htm