2

I am trying to send a request to a SOAP API using a call mediator. I receive proper response when I use SoapUI, but get the following error when I try it on WSO2 Integration studio.

<faultstring>Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {some-url}Fulfillments</faultstring>

This is the content of my Insequence.

I'm not finding a proper solution for this. Any idea how this can be solved? Thanks in advance!

<payloadFactory media-type="xml">
                <format>
                    <soapenv:Envelope xmlns:loc="some-url" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                        <soapenv:Header/>
                        <soapenv:Body>
                            <loc:Fulfillments>
                                
                                
                                    <message_header >
                                        
                                    </message_header>
                                    <message_body>
                                        
                                    </message_body>
                                
                            </loc:Fulfillments>
                        </soapenv:Body>
                    </soapenv:Envelope>
                </format>
                <args/>
            </payloadFactory>

                 <property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
                 <property name="Content-Type" scope="axis2" type="STRING" value="text/xml"/>
                 <!-- Setting the Credentials-->
                 <property name="Action" scope="transport" type="STRING" value=""/>
           <call>
                <endpoint>
                    <address format="soap11" uri="">
                        <timeout>
                            <duration>60000</duration>
                            <responseAction>fault</responseAction>
                        </timeout>
                    </address>
                </endpoint>
            </call>

            <property name="messageType" scope="axis2" type="STRING" value="text/xml"/>
            <property name="Content-Type" scope="axis2" type="STRING" value="text/xml"/>
            <respond/>

Ruby
  • 368
  • 1
  • 9
  • What's the EI version you are using? What message formatters have you configured in axis2.xml or deployment.toml? Does the message has to be SOAP 1.1 or does the backend support both SOAP 1.1 and 1.2? – ycr Aug 12 '22 at 11:42
  • The EI version i am using is 7.2.0. I am using the default Message-Formatters that come WSO2-MI-4.0.0. The backend supports only 1.1. – Ruby Aug 12 '22 at 14:04
  • If your remove your `` sequence does it work? – ycr Aug 12 '22 at 17:56
  • I get the same response if I remove the credentials. I get the same No Envelop error. – Ruby Aug 13 '22 at 03:48
  • Does that mean it is not getting into the Authorization part? But all the logs outside the after the Authorization get printed. – Ruby Aug 13 '22 at 04:45

2 Answers2

1

I had same problem and fixed by these:

<property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>  
<property name="ContentType" value="text/xml" scope="axis2"/>
Mr White
  • 97
  • 1
  • 9
0

Try to use respond mediator check what is the payload returned by the payload factory.

If wso2 is not preserving or removing the soap envelop tag please use the below property.

<property name="messageType" scope="axis2" type="STRING" value="application/soap+xml"/>

rahul
  • 406
  • 1
  • 5
  • 14
  • I tried above and it gave me HTTP Response error 415 415 | Error:Response bodyDownload {"text": null} Response headers content-type: application/json; charset=UTF-8 – Mr White Jan 28 '23 at 23:05