cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Design - SOAP body content needs to be different between test and production

Former Member
0 Kudos

Hello,

We are integrating with a 3rd party SOAP receiver who uses the same web service URLS for test and production.

So to differentiate they exposed 2 web services which do the same thing but have different root and payload node names...along with account details.

For example, for production our SOAP XML must follow pattern like:

<Envelope>

<Body>

<appRequest>

<userID>produser</userID><password>prodpwd</password>

<appPayload>

<?xml>

blah blah this XML is the same between test and production

</xml>

</appPayload>

etc

But for their testing we must use:

<Envelope>

<Body>

<appRequestTest>

<userID>testuser</userID><password>testpwd</password>

<appPayloadTest>

<?xml>

blah blah this XML is the same between test and production

</xml>

</appPayload>

etc

So I'm trying to think of a good way to handle this difference in one set of mappings that we can use in our 3 PI platforms Dev / Test / Prod

Since these differences are in the SOAP Body does it need handled in mapping or is there a way to handle it in the Adapter Config which is naturally different between our environments (mapping we like to keep the same).

What is a smart way to handle this scenario?

Many thanks,

Aaron

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Final answer, I used two different mappings until developer finally chose a better design and unified the web service calls between development and production.

Answers (2)

Answers (2)

JaySchwendemann
Active Contributor
0 Kudos

I second Artem when he states that this is a bad design decission from the caller's side.

However this is not gonna help you in the current situation, right?

The problem you are facing is that by poor design the message does not have a root node which you may use to handle occurences. Let me explain further

You would be good if prod message looked like so


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

<soapenv:Header/>

<soapenv:Body>

  <appData>

   <appRequest>

    ...

   </appRequest>

  </appData>

</soapenv:Body>

</soapenv:Envelope>

and test message looked like so


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

<soapenv:Header/>

<soapenv:Body>

  <appData>

   <appRequestTest>

    ...

   </appRequestTest>

  </appData>

</soapenv:Body>

</soapenv:Envelope>

--> Then you would have been able to specify occurence of <appRequest> and <appRequestTest> as 0..1

So I think you have (besides what Artem already pointed out) 2 other options:

1. activate "do not use SOAP envelope" on sender SOAP channel and then designing the data types like above

2. Use HTTP instead of SOAP adapter and designing data types like above

Hope I didn't miss something crucial 🙂

Cheers

Jens

former_member192851
Active Participant
0 Kudos

I see four possibilities

1. One Integration Configuration with Extended Receiver Agreement or something like that. And two DT, MT, MM,OM,SI, two channels - one for test, one for prod.

2. Two Integration Configurations.

3. Java Mapping or xslt, that will dynamically create all that you want depending on system, where it run. But it can be difficult to support.


4. Change web-service, so it will be the same structure, but different urls. I think this is smartest way to handle this scenario

Former Member
0 Kudos

Thanks Artem. Its a 3rd party web service we can't change. To those with more experience with these interfaces, is this a common approach to a test environment? (separate web service methods on the same box)

I'm thinking about adding some logic inside one MM which checks the source system of message (internal) and then use Value Mapping to choose the correct node names and values. Maybe I don't define these high level XML elements in the datatype, and inject this XML manually or by using 2 maps in a row.

My dev / test / prod platforms could all then just store these parameters in config but I think it could share the same mappings then.

former_member181985
Active Contributor
0 Kudos

Hi Aaron,

I think you can have the two wsdl structures as external definition in PI and then use multi-mapping with a condition. For e.g., you can get PI system SID in mapping using java udf code and then decide which system it is i.e., test, production based on SID and then formulate message in multi-mapping accordingly.

Best Regards,

Praveen Gujjeti