cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Header to response

former_member10771
Active Participant
0 Kudos

Hi All,

For one of my scenarios SOAP - SOAP the incoming file format is like this .

<soapenv:Envelope >

<soapenv:Header>
      <v2:XHeader> 

<v2:Name>?</v2:Name>

         <v2:Id>?</v2:Id>

      </v2:XHeader>
   </soapenv:Header>
<soapenv:Body>
      Body Fields
   </soapenv:Body>
</soapenv:Envelope>

I have done a XSLT mapping to remove the header and then pass it to ECC and then get a response back. The scenario works fine till here. But the problem is the Header field is sending some value under Name based on the different systems. How can I send that information back in response or how can I hold that information in PI and send it back. Because based on the name the same interface will be trigerred by different legacy systems.

So basically Name can be ABC for one system and XYZ for the other. Can someone please tell me how to go about this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

In the request XSLT, using DC you can set the username in some custom property and while parsing the response in the resp XSLT u can read the username (using DC) set in the request and send it across as a part of the payload.

Thanks

Amit Srivastava

JaySchwendemann
Active Contributor
0 Kudos

Ah, thats great news, didn't know from the top of my head if using DC would be possible to store the values between request and response, hence I opted for passing the values in mapping.

Even the better then 🙂

Cheers

former_member10771
Active Participant
0 Kudos

Hi Jens/Amit,


Can you please explain how this can be achieved. Is there any reference blog as to how to use DC with XSLT . I have written a XSLT now to get the header field and the required target fields and send to ECC., Any pointers how DC can be used so that I can try and modify my mapping.

Harish
Active Contributor
0 Kudos

Hi Amit,

refer the below doc for dynamic configuration in XSLT mapping

regards,

Harish

Former Member
0 Kudos

Hello,

Check this ref  which will help u in explaining how to call DC inside XSLT code.

Define some dynamic property name and then set username inside the same

Edited Section- Below blog has used UDF to set custom namespace and property name but u can refer it also while setting DC in xlst.

Thanks

Amit Srivastava

Message was edited by: Amit Srivastava

former_member10771
Active Participant
0 Kudos

Thanks All,

I will check on the same.

Answers (1)

Answers (1)

JaySchwendemann
Active Contributor
0 Kudos

Amit,

I assume you actually have 2 scenarios, one sending from 3rd party to ECC and one sending from ECC to 3rd party. Is that correct?

I would not throw away the header but map it to some (new) body fields on "request" (3rd party is sender) message. See here

On the "response" message (ECC is sender) I would then use the value ECC stored from the "request" and map to body or fill header values.

However, I'm not sure if I got your setup correctly

Cheers

Jens

former_member10771
Active Participant
0 Kudos

Hi Jens,

No its a synchronous scenario and a single scenario. I dont have two scenarios for this. Actually the WSDL provided by 3rd party is such that it has two separate parts one for header and one for body.

Can anyone please provide some details on this.

JaySchwendemann
Active Contributor
0 Kudos

Hi Amit,

if it's synchronous then I would use 2 XSLT mappings, one for mapping the header values "name" and "id" to some fields that you then can access in ECC. If you are using RFC or Proxy in ECC, please just pass this values to the exporting / output section of RFC / Proxy. Then in PI again do an XSLT mapping filling in the soap header with the then "passed trough" values of "name" and "id". Of course also fill in your regular mappings.

See here for details

Cheers