I define a complex type in my wsdl and use it as the input parameter in my
input message (complete wsdl follows below):
        <xsd:element name="sendNSRSyncRequestRequest">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="operationCode" 
type="xsd:string"></xsd:element>
                        <xsd:element name="sourceOrderID" 
type="xsd:string"></xsd:element>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>

        <wsdl:message name="sendNSRSyncRequestRequest">
            <wsdl:part name="parameters"
element="tns:sendNSRSyncRequestRequest"></wsdl:part>
        </wsdl:message>

I generate the code and add a simple implementation class:
import com.testnsr.sync.NSRSyncRequest;
import com.testnsr.sync.SendNSRSyncRequestRequest;
import com.testnsr.sync.SendNSRSyncRequestResponse;


public class MyImplComplex implements NSRSyncRequest {

        public SendNSRSyncRequestResponse sendNSRSyncRequest(
                        SendNSRSyncRequestRequest rq) {
                System.out.println(rq.getOperationCode() + 
rq.getSourceOrderID());
                return null;
        }
}

The members of the input class, operationCode amd sourceOrderID are always
set to NULL. Try as I might I can't get them to be populated.

Test SOAP envelope:
<?xml version="1.0" encoding="UTF-8"?>
 <env:Envelope  xmlns:env="http://schemas.xmlsoap.org/soap/envelope/";
   xmlns:tns="http://testnsr.com/sync";>
   <env:Body>
     <tns:sendNSRSyncRequest>
      <tns:sendNSRSyncRequestRequest>                       
<operationCode>activate</operationCode>
       <sourceOrderID>1234</sourceOrderID>
      </tns:sendNSRSyncRequestRequest>
     </tns:sendNSRSyncRequest>
   </env:Body>
 </env:Envelope>
      

Complete WSDL:
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions
name="nsrSyncRequest" targetNamespace="http://testnsr.com/sync";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:tns="http://testnsr.com/sync";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";>
    <wsdl:types>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://testnsr.com/sync";>
        <xsd:element name="sendNSRSyncRequestResponse">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="errorCode" 
type="xsd:string"></xsd:element>
                                <xsd:element name="errorString" 
type="xsd:string"></xsd:element>
                                <xsd:element name="responseCode" 
type="xsd:string"></xsd:element>
                                <xsd:element name="sourceOrderID" 
type="xsd:string"></xsd:element>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="sendNSRSyncRequestRequest">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="operationCode" 
type="xsd:string"></xsd:element>
                        <xsd:element name="sourceOrderID" 
type="xsd:string"></xsd:element>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
        </xsd:schema>
        </wsdl:types>
    <wsdl:message name="sendNSRSyncRequestRequest">
            <wsdl:part name="parameters"
element="tns:sendNSRSyncRequestRequest"></wsdl:part>
        </wsdl:message>
    <wsdl:message name="sendNSRSyncRequestResponse">
        <wsdl:part name="parameters"
element="tns:sendNSRSyncRequestResponse"></wsdl:part>
    </wsdl:message>
    <wsdl:portType name="NSRSyncRequest">
        <wsdl:operation name="sendNSRSyncRequest">
                <wsdl:input 
message="tns:sendNSRSyncRequestRequest"></wsdl:input>
                <wsdl:output 
message="tns:sendNSRSyncRequestResponse"></wsdl:output>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="NewBinding" type="tns:NSRSyncRequest">
        <soap:binding style="rpc"
                transport="http://schemas.xmlsoap.org/soap/http"; />
        <wsdl:operation name="sendNSRSyncRequest">
                <soap:operation
soapAction="http://testnsr.com/sync/sendNSRSyncRequest"; />
                <wsdl:input>
                        <soap:body use="encoded" 
namespace="http://testnsr.com/sync";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                </wsdl:input>
                <wsdl:output>
                        <soap:body use="encoded" 
namespace="http://testnsr.com/sync";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="NSRSyncService">
        <wsdl:port name="NewPort" binding="tns:NewBinding">
                <soap:address location="http://www.example.org/";></soap:address>
        </wsdl:port>
    </wsdl:service></wsdl:definitions>
-- 
View this message in context: 
http://www.nabble.com/Unable-to-use-a-complex-type-as-an-input-parameter---member-attributes-are-always-set-to-NULL-tf4137115s12049.html#a11766883
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to