cancel
Showing results for 
Search instead for 
Did you mean: 

How to add SOAP header element?

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Scenario : RFC --> SOAP

I would like to add parameters into the soap header :


<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP:Header>
            *<OPER_REF>SAPPI</OPER_REF>*
      </SOAP:Header>
      <SOAP:Body>
		<ns2:createSapProductRequest xmlns:ns2="http://www.mycompnay.com/projectname">
	   	       <country>FR</country>
		       <division>1300</division>
		       <productStage/>
		</ns2:createSapProductRequest>
        </SOAP:Body>
</SOAP:Envelope>

So I made a Java Mapping to reach my goal so my message looks like :


<ns0:Messages 
	xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
	<ns0:Message1>
		<SOAP:Envelope 
			xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
			<SOAP:Header>
				<OPER_REF>SAPPI</OPER_REF>
			</SOAP:Header>
			<SOAP:Body>
				<ns2:createSapProductRequest 
					xmlns:ns2="http://www.mycompany.com/myproject">
					<country>FR</country>
					<division>1300</division>
					<productStage/>
				</ns2:createSapProductRequest>
			</SOAP:Body>
		</SOAP:Envelope>
	</ns0:Message1>
</ns0:Messages>

But when I launch the process here is what PI do :


<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>
  <soapenv:Header>
   <OPER_REF xmlns="">SAPPI</OPER_REF>
  </soapenv:Header>
  <soapenv:Body>
   <ns2:createSapProductRequest xmlns="http://www.mycompnay.com/myprojecty" xmlns:ns2="http://www.mycompnay.com/myprojecty">
    <country xmlns="">FR</country>
    <division xmlns="">1300</division>
    <productStage xmlns=""></productStage>
   </ns2:createSapProductRequest>
  </soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>

this request has been found thanks to the tool TCPGW. Has you can see there is 2 <soapenv:Body>

What is wrong ?

regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Tell me the parameters which u want to replace with.....

earlier i replace "xmlns=", with xmlns:ns0=" and many more

Regards,

Joseph_BERTHE
Active Contributor
0 Kudos

I want to add <OPER_REF> element in the Soap Header.

Regarding the xmlns, PI add empty one...

Joseph_BERTHE
Active Contributor
0 Kudos

I was right, the solution is :

My problem was the adapter. It was miss used.

_The configuration is : _

HTTP without SOAP Envelope and in the Module :

Name : localejbs/AF_Modules/MessageTransformBean

Type : L

Key : Plain2XML

_Module's Configuration : _

Plain2XML -


> Transform.ContentType -
> text/xml;charset=utf-8

All the XML messages was well formed even with the strange xmlns attributes.

Regards

alancecchini
Participant
0 Kudos

Hi Joseph,

I have a similar requirement to add extra parameters to the SOAP header and plan to use mappings to achieve this.

What I'm unsure about and perhaps you can confirm is that by using the mapping route the SOAP envelope becomes wrapped in the receiver message type node details, as per your example.

Does this matter, presumably if not the receiver just ignores the extra content?

Thanks in advance,

Alan Cecchini

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Joseph:

thing which i undestood : you want to add some additional parameters in payload:

is it right then you can use adapter module for that.

few lines of code will do..

Thanks & Regards

Kunaal

Joseph_BERTHE
Active Contributor
0 Kudos

Thanks,

Can you explain me with some additional links ?

Because, in some post, they said it is not possible to modify the soap header with module.

By the way, I use SOAP - HTTP(Axis) adapter.

regards