Jeroen van Veldhuizen
Jeroen van Veldhuizen

Reputation: 176

wso2esb soap-to-pox gives pox answer instead of soap

I have created a soap-to-pox proxy in WSO2ESB version 4.8.1 so that I can call the service from BPEL. This proxy transforms the message to POX (using <address uri="service-address" format="pox"/>). I see in the logs that the service is correctly called and that is returns a valid response.

The response is plain XML without a namespace.

ESB returns this answer without wrapping it in a soap envelope. Why is this? I think it should be wrapped.

Can somebody tell me what I am missing?

Below is my proxy definition.

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="RDW-OPENB-VRTG-INFO" transports="https http" startOnLoad="true" trace="enable">
<target>
    <inSequence>
        <property name="PRESERVE_WS_ADDRESSING" value="true" scope="default" type="STRING" description="preserve_ws_addressing"/>
        <payloadFactory media-type="xml" description="CreatePayload">
            <format>
                <OPENB-VRTG-INFO xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/OPENB-VRTG-INFO.xsd">
                    <ALG-GEG>
                        <GEBR-IDENT>$1</GEBR-IDENT>
                        <WACHT-WOORD-ACT>$2</WACHT-WOORD-ACT>
                        <PROC-IDENT>2336</PROC-IDENT>
                        <PROC-FUNC>1</PROC-FUNC>
                    </ALG-GEG>
                    <KENT-GEG>
                        <KENTEKEN>$3</KENTEKEN>
                    </KENT-GEG>
                </OPENB-VRTG-INFO>
            </format>
            <args>
                <arg value="50200003"/>
                <arg value="redora05"/>
                <arg xmlns:r="http://argus.cale.nl/soa/RDW/" evaluator="xml" expression="//r:getOpenbVrtgInfo/r:licensePlate"/>
            </args>
        </payloadFactory>
        <log level="full" description="logSendMessage"/>
        <send>
            <endpoint key="RDW"/>
        </send>
    </inSequence>
    <outSequence>
        <log level="full" description="log"/>
        <send/>
    </outSequence>
    <faultSequence>
        <drop description="drop"/>
    </faultSequence>
</target>
<publishWSDL>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:rdw="http://argus.cale.nl/soa/RDW/" name="RDW" targetNamespace="http://argus.cale.nl/soa/RDW/">
        <wsdl:types>
            <xsd:schema targetNamespace="http://argus.cale.nl/soa/RDW/" elementFormDefault="qualified">
                <xsd:element name="getOpenbVrtgInfo">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="licensePlate" type="xsd:string"/>
                            <xsd:element name="rdwUser" type="xsd:string"/>
                            <xsd:element name="rdwPassword" type="xsd:string"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="getOpenbVrtgInfoResponse" type="xsd:string"/>
            </xsd:schema>
        </wsdl:types>
        <wsdl:message name="getOpenbVrtgInfoRequest">
            <wsdl:part element="rdw:getOpenbVrtgInfo" name="parameters"/>
        </wsdl:message>
        <wsdl:message name="getOpenbVrtgInfoResponse">
            <wsdl:part element="rdw:getOpenbVrtgInfoResponse" name="parameters"/>
        </wsdl:message>
        <wsdl:portType name="RDW">
            <wsdl:operation name="getOpenbVrtgInfo">
                <wsdl:input message="rdw:getOpenbVrtgInfoRequest"/>
                <wsdl:output message="rdw:getOpenbVrtgInfoResponse"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="RDWSOAP" type="rdw:RDW">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="getOpenbVrtgInfo">
                <soap:operation soapAction="http://argus.cale.nl/soa/RDW/getOpenbVrtgInfo"/>
                <wsdl:input>
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="RDW">
            <wsdl:port binding="rdw:RDWSOAP" name="RDWSOAP">
                <soap:address location="http://argus.cale.nl/soa/rdw"/>
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>
</publishWSDL>
</proxy>

Upvotes: 2

Views: 367

Answers (1)

Jean-Michel
Jean-Michel

Reputation: 5946

In your outSequence, before send mediatior, you should add this property if you want a SOAP response :

<property name="messageType" value="text/xml" scope="axis2" />

Upvotes: 2

Related Questions