29
Views
0
Comments
How to add xsi:type attribute to an outgoing SOAP Request
Question
Service Studio Version
11.53.25 (Build 61588)
Platform Version
11.17.0 (Build 37007)

Hey all,

I am currently struggling with some very specific SOAP service. 

I do want to consume an existing SOAP Service of a 3rd Party application. So I have to use the service as-is and there is no chance to change the way it is implemented. 

Unfortunately the supplier is making use of the xs:anySimpleType attribute rather frequently. In most cases I do consume fields of this specific type only and can apply the proposed workaround to modify the WSDL and replace the type with a simple xs:string type. In this case everything works as expected.

But now I do need to write the data into 3rd party system and I tried to apply the same workaround. This works for the message itself and the data is send out and also processed by the SOAP Server.  But the outcome is not as expected. Instead of the value send within the request the target systems stores a nil value. 

I have analyzed the issue by manually manipulating the SOAP requests within SOAP-UI and I could finally nail down the problem to a missing xsi:type attribute attached to the specific xml element.


The data type of the value node is anySimpleType and I changed it to string to load the WSDL in outsystems.

The request send by Outsystems looks like this:



This does not cause any error at the receiving system, but the value ABC is not handled as expected. Instead the outcome is [value: null]. As I cannot influence the target system I searched for a solution in the source system / outsystems platform.

After doing several trials in SOAP-UI I figured out how to create a valid request. To create a valid request the type contained in the field must be added as an attribute:


Not the target system documents ABC as expected.


Is there any (compliant or even dirty) way to change the outgoing message and include the xsi:type attribute for this specific field?

Any help is well apreciated. 


Many thanks,

Matthias


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.