93
Views
1
Comments
Solved
Consuming a SOAP that results in a type of the binding error
Question

Hi,

I am consuming the following SOAP webservice  : https://ipaasgw.edicomgroup.com/services/EBIBrokerWSV2?wsdl

I am trying to get the publishWS method to work. 

I am receiving the following error: 

"The content type multipart/related; type="application/xop+xml"; boundary="uuid:91d22ed2-b323-4823-9ca2-bd9000b2a5ff"; start="<root.message@cxf.apache.org>"; start-info="text/xml" of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 487 bytes of the response were: '
--uuid:91d22ed2-b323-4823-9ca2-bd9000b2a5ff
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:publishWSResponse xmlns:ns2="http://com.edicom.broker.adapter.services"><return>2210191232351241896</return></ns2:publishWSResponse></soap:Body></soap:Envelope>
--uuid:91d22ed2-b323-4823-9ca2-bd9000b2a5ff--'.
"

I have a hard time interpreting the error. I found out that it might have something to do with the encoding of the response so I have found this article :

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/SOAP/Consuming_SOAP_Web_Services/Use_Advanced_Extensibility/Use_a_different_character_encoding

I have created my own extension with the SetEncoding action and an input parameter 'Encoding' of the type text. However I do not know what the Input parameter needs to be when using it in the 'OnBeforeRequestAdvanced'  action. So my first question is, how do I find out what type of encoding is used? Is it 'Content-Transfer-Encoding: binary ', and if so than according to this article https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding?view=netframework-4.6#remarks it will not work:

"Note that Encoding is intended to operate on Unicode characters instead of arbitrary binary data, such as byte arrays. If you must encode arbitrary binary data into text, you should use a protocol such as uuencode, which is implemented by methods such as Convert.ToBase64CharArray. "

If above statement is true then what are my options ?

PS: Also I have found that there already is an 'SetEncoding' action inside SOAPExtensibility extension does that not make the whole article obsolete?


I hope someone can help me a bit further with this. I am thankful for your time.

Greetings,


Robert

2022-02-01 09-31-26
Robert Hantink
Solution

Ok so apparently it is enough to use EnableMTOM in the OnBefroeRequestAdvanced to solve this problem:

 

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