2

We have a sequence that calls a REST service, and in the receiving sequence we call a SOAP service.

This is the xml payload that is passed to that SOAP call.

 <payloadFactory media-type="xml">
        <format>
            <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
                <env:Header/>
                <S:Body>
                    <ns0:searchCust xmlns:ns0="">
                        <customerData xmlns="">
                            <Instrument/>
                            <EntityInformation>
                                <Individual>
                                    <Name>
                                        <Name Location="First">$1</Name>
                                     
                                    </Name>
                                    <ContactInformation>
                                        <Address/>
                                        <EMail>
                                            <EMailAddress>$3</EMailAddress>
                                        </EMail>
                                    </ContactInformation>
                                </Individual>
                            </EntityInformation>
                        </customerData>
                    </ns0:searchCust>
                </S:Body>
            </S:Envelope>
        </format>
        <args>
           
        </args>
    </payloadFactory>

But for some reason, I get the following as response:

<?xml version='1.0' encoding='utf-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
            <faultcode>S:Client</faultcode>
            <faultstring>Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)</faultstring>
        </S:Fault>
    </S:Body>
</S:Envelope>

When the SOAP service is called on it's own through the ESB or through soapUI, it works fine. But through WSO2 Integration studio I get the above error.

These are my wirelogs.

[2023-01-04 17:15:21,061] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "HTTP/1.1 500 Internal Server Error[\r][\n]"
[2023-01-04 17:15:21,061] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Date: Wed, 04 Jan 2023 11:45:21 GMT[\r][\n]"
[2023-01-04 17:15:21,062] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Transfer-Encoding: chunked[\r][\n]"
[2023-01-04 17:15:21,063] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Type: text/xml; charset=utf-8[\r][\n]"
[2023-01-04 17:15:21,063] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "Strict-Transport-Security: max-age=31536000[\r][\n]"
[2023-01-04 17:15:21,064] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-ORACLE-DMS-RID: 0[\r][\n]"
[2023-01-04 17:15:21,064] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Content-Type-Options: nosniff[\r][\n]"
[2023-01-04 17:15:21,065] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-ORACLE-DMS-ECID: d53a62da-093e-46c4-8f0b-4aabb22b9e40-00000052[\r][\n]"
[2023-01-04 17:15:21,065] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Frame-Options: SAMEORIGIN[\r][\n]"
[2023-01-04 17:15:21,066] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]"
[2023-01-04 17:15:21,066] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "006e[\r][\n]"
[2023-01-04 17:15:21,067] DEBUG {wire} - HTTPS-Sender I/O dispatcher-2 >> "<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body>[\r][\n]"

Is there any way I can fix this? An extra properties to be set to get a proper response?

Ruby
  • 368
  • 1
  • 9
  • The above issue can happen if you send a malformed XML payload is sent to the server. If possible, please update the description with wirelogs so that we can see the payload and the headers in your request. – Arunan Sugunakumar Jan 04 '23 at 10:03
  • The XML payload is correctly formed, because if we use the same payload in SOAPUI to hit the API, it works fine. I'll update the description with wirelogs. – Ruby Jan 04 '23 at 11:30
  • @Ruby Also share the complete integration as well. (At least the relevant sections) – ycr Jan 04 '23 at 12:05

1 Answers1

3

Try adding the following property before the second SOAP call.

<property action="remove" name="TRANSPORT_HEADERS" scope="axis2"/>
ycr
  • 12,828
  • 2
  • 25
  • 45
  • This works!! Can I know what this property actually does? – Ruby Jan 04 '23 at 12:34
  • 1
    @Ruby Glad, it worked. This will remove all the transport headers received from your first call (Transfer-Encoding, Content-Type etc ) and avoid sending them in the second call. In WSO2 if you don't explicitly remove the transport headers they will be sent in the next consecutive call. – ycr Jan 04 '23 at 12:46