Вопрос

When one usually creates a SOAP request and response element, it would end in __Request and __Response and SoapUI would pick it up when you import the WSDL.

<xs:element name="SampleRequest">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Testing" type="xs:string" />  
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:element name="SampleResponse">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Testing" type="xs:string" />  
        </xs:sequence>
    </xs:complexType>
</xs:element>

I'm busy converting a piece of old VB6 code and the DTD's SOAP equivalent would use the same element for request and response:

<xs:element name="Sample">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="Testing" type="xs:string" />  
        </xs:sequence>
    </xs:complexType>
</xs:element>

Is there something I can set in the XSD so that SOAPUI would pick up Sample as both a request and a response?

Это было полезно?

Решение

When SOAPUI reads the WSDL, it uses the element (and therefore the element name) defined in the wsdl:message element which is referenced from the wsdl:operation element as the request, response, and optional fault. Nothing you do to an XSD will change that. Nor do elements have to end with "Request" to be considered a request (same for Response).

Другие советы

Solved it by replacing all SampleRequest and SampleResponse with just Sample and removing the now duplicate wsdl:message:

...


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

<wsdl:portType name="SampleSoapService">
    <wsdl:operation name="Sample">
        <wsdl:input message="tns:Sample" name="Sample">
        </wsdl:input>
        <wsdl:output message="tns:Sample" name="Sample">
        </wsdl:output>
    </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="SampleSoapServiceSoap11" type="tns:SampleSoapService">
    <soap:binding style="document"
        transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="Sample">
        <soap:operation soapAction="" />
        <wsdl:input name="Sample">
            <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output name="Sample">
            <soap:body use="literal" />
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="SampleSoapServiceService">
    <wsdl:port binding="tns:SampleSoapServiceSoap11" name="SampleSoapServiceSoap11">
        <soap:address location="http://localhost:8080/paygate-SampleSoapService/ws/SampleSoapService" />
    </wsdl:port>
</wsdl:service>

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top