cancel
Showing results for 
Search instead for 
Did you mean: 

Add field inside SOAP header PI 7.1

Former Member
0 Kudos

Hello,

by proyect needs we need to add into SOAP header some dynamic information

(Web Services calls to target systems from PI 7.1). This information is

needed in target application for validating permissions of the web

services calls.

The tags are

<soap:Header>

<CarHeader xmlns="http://xxxxx.xxxxxxxx.xxx.org/">

<TicketCar>xxxxxxxxxxxxxxxxxxxxxx......</TicketCar>

</CarHeader>

</soap:Header>

TicketCar's value (xxxxxx....) will be different in each call.

We think that this is not possible with standar or Axis PI SOAP receiverchannel and a solution could be making a Abap mapping for composing the

SOAP call with this tags and values, and in the comunication channel

check the parameter "Do not use SOAP Envelope".

It's rigth? Is there any other solution for doing it?

An example of a call will be:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Header>

<CarHeader xmlns="http://xxxxx.xxxxxxxx.xxx.org/">

<TicketCar>C4A8A61D86C56DC27......</TicketCar>

</CarHeader>

</soap:Header>

<soap:Body>

<E000xx xmlns="http://xxxxx.xxxxxxxx.xxx.org/">

<_request>

<NumeroExpedienteAdministrativo>xxx</NumeroExpedienteAdministrativo>

<CodigoDocumentoInterno>xxx</CodigoDocumentoInterno>

<Status>xx</Status>

<NumeroExpedienteContable>xxx</NumeroExpedienteContable>

</_request>

</E000xx>

</soap:Body>

</soap:Envelope>

Any idea will be welcome

Edited by: Ramon Coma Alcantara on Feb 2, 2010 4:15 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ramon,

> TicketCar's value (xxxxxx....) will be different in each call.

>

> We think that this is not possible with standar or Axis PI SOAP receiverchannel and a solution could be making a Abap mapping for composing the

> SOAP call with this tags and values, and in the comunication channel check the parameter "Do not use SOAP Envelope".

>

> It's rigth? Is there any other solution for doing it?

It's not right. See the axis adapter faq note. There are some examples for adding an arbitrary soap header with values passed along the message (like in the adapter specific message properties). In this case, you can still use all the soap processing features like standard fault handling, additional ws-* features, etc.

Regards, Yza

Former Member
0 Kudos

Hi Yza,

I'm not sure it's possible to do this header tag addition with the adapter specific message properties. SAP documentation says, if you want add additional header tags in a SOAP request you must do it creating the entire SOAP request in a mapping. Perhaps consulted documentation is old. By other hand, value of header can't be send in XML request, only in SOAP header and I understand if I want get the value of the tag this value must be in XML payload. It's right? Have you some example? I would be grateful.

Regards.

Former Member
0 Kudos

Hi,

I had the same requirement, and I created a AdapterModule that was called just before the SOAP adapter which was in `Do not use envolope` mode. You can use the same approach and create the SOAP envelope + header and pass it to the SOAP adapter to make the call and this will avoid the performance loss you would face in Java mapping as the ABAP stack would have to call the Java stack in the middle of routing each time, and again at the end of pipeline steps for the final call.

You can use the SAAJ API for constructing the message, just search for some Java blogs on the net on how to do so. Also, adapter specific properties in the SOAP adapter will not be able to help you in any way in this case.

Regards,

Gokhan

Former Member
0 Kudos

Hi,

I solved the problem modifying the WSDL with the addition of the SOAP envelope and headers tags inside. Then I full headers tags in a message mapping and in the communication channel I activated the check "Do not use SOAP envelope". It works fine.

Thanks alot.

Former Member
0 Kudos

Hi Ramon,

The axis adapter comes with a convenient header insertion handler where you can insert an arbitrary header using a template.

For example, you can define a template like this in the module configuration.

<x:header xmlns:x="urn:x"><me>i say </me><you>you say </you></x:header> where , , ... are variable place holders.

and you associate these variables with any context value available in the message.

For example, when you pass Hello and Bye for these variables, you soap message will get the header:

<x:header xmlns:x="urn:x"><me>i say Hello</me><you>you say Bye</you></x:header>

You can look at the examples described in Note 1039369 Axis Adapter FAQ.

As I said before, the mileage you can go with the do-not-use-envelope mode is very limited. But if you are happy with it, why not.

Best regards, Yza

Former Member
0 Kudos

HI,

I need to pass one field from the message to the soap header. I used the dynamic configuration to copy the field in mapping.. How can i get this one from dynamic config to Soap header. I have gone through axis faq. Can any one point me in the right direction.

1. need to know how to use java:com.sap.aii.axis.xi.XI30DynamicConfigurationHandler to read from Dynamic Config

2. Need to know how to use java:com.sap.aii.axis.soap.HeaderInsertionHandler and pass the value from the above step

Thank you

Moni

Former Member
0 Kudos

Ramon

I have a similar requirement and was investigating the various options. I found a couple of options - Explicit and implicit headers in

the WSDL. Which option did you finally choose ? Can you please post a sample WSDL ?

By default the adapter populates a default soap header tag in the envelope. If you include it in the WSDL and populate it, does it recognize that the tag exists and not create an invalid XML ? I am assuming it does as you mentioned that your solution works.

Appreciate your help.

Thanks

Sridhar

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Ramon,

I have almost same requirement, i want to use message mapping and need to modify soap envolpe before soap call.

Please provide me sample java code or some step by step kind of stuff.

Thanks,

Sandip

Former Member
0 Kudos

Hi,

finally is solved with a Java mapping.

Thanks.

siddhesh_pathak4
Contributor
0 Kudos

Hello,

You can use XSLT mapping for this. or otherwise please follow the below link,

[;

santhosh_kumarv
Active Contributor
0 Kudos

Yes. Use option "Do Not Use Soap Envelop" and populate the SOAP header and Body tags in the Mapping.

You can use XSLT mapping instead ABAP, which will be simpler.

~SaNv...