Forum Discussion

WebServiceUser's avatar
WebServiceUser
New Contributor
16 years ago

SOAP Response Validation

I have just started using SOAP UI . I tried some default requests by SOAPUI and I also got a response. But then when I tried to do the Schema Assertion Compliance it shows "failed" and the error log shows nothing. I went back to the default Request and pressed Alt -V to validate the request and the response. The request side shows " Validation OK" but the response side shows "line -1: null". Please help me to solve the error

SOAP Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://gid.com/div/schemas">
  <soapenv:Header/>
  <soapenv:Body>
      <sch:divisionRequest>
        <sch:RequestMessage>FETCHDATA</sch:RequestMessage>
      </sch:divisionRequest>
  </soapenv:Body>
</soapenv:Envelope>


SOAP Response
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
      <div:divisionResponse xmlns:div="http://gid.com/div/schemas">
        <div:Divisions Added="false" Change-Occured="false" Deleted="false" ID="1">
            <div:Division Changed="false" NewValue="null">AP</div:Division>
            <div:Name Changed="false" NewValue="null">Crop Protection</div:Name>
            <div:Operational Changed="false" NewValue="null">Y</div:Operational>
            <div:ValidFrom Changed="false" NewValue="null">2000-01-01 00:00:00.0</div:ValidFrom>
            <div:ValidTo Changed="false" NewValue="null">9999-12-31 00:00:00.0</div:ValidTo>
        </div:Divisions>
        <div:Divisions Added="false" Change-Occured="false" Deleted="false" ID="32">
            <div:Division Changed="false" NewValue="null">CP</div:Division>
            <div:Name Changed="false" NewValue="null">Inorganics</div:Name>
            <div:Operational Changed="false" NewValue="null">Y</div:Operational>
            <div:ValidFrom Changed="false" NewValue="null">2008-08-18 00:00:00.0</div:ValidFrom>
            <div:ValidTo Changed="false" NewValue="null">9999-12-31 00:00:00.0</div:ValidTo>
        </div:Divisions>
</div:divisionResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

5 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    can you attach the corresponding WSDL also?

    regards,

    /Ole
    eviware.com
  • Thank u for the response.Hope this helps

    <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://gid.com/div/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://gid.com/div/schemas" targetNamespace="http://gid.com/div/schemas">
    - <wsdl:types xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://gid.com/div/schemas" targetNamespace="http://gid.com/div/schemas">
    - <xs:element name="divisionRequest" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:sequence xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element ref="RequestMessage" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
    - <xs:element name="RequestMessage" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:simpleType xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:restriction base="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:enumeration value="FETCHDATA" xmlns:xs="http://www.w3.org/2001/XMLSchema" />
      </xs:restriction>
      </xs:simpleType>
      </xs:element>
      </xs:schema>
      </wsdl:types>
    - <wsdl:message name="divisionRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:part element="tns:divisionRequest" name="divisionRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      </wsdl:message>
    - <wsdl:portType name="GIDResource" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:operation name="division" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:input message="tns:divisionRequest" name="divisionRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="GIDResourceSoap11" type="tns:GIDResource" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
    - <wsdl:operation name="division" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <soap:operation soapAction="" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
    - <wsdl:input name="divisionRequest" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
      </wsdl:input>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="GIDResourceService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    - <wsdl:port binding="tns:GIDResourceSoap11" name="GIDResourceSoap11" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <soap:address location="http://localhost:8080/Spring_WS_GID/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    thanks, but can you pleaze attach it as a file instead?

    TIA!

    /Ole
    eviware.com
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    Problem is that the WSDL does not define a response message at all for the division operation, so soapUI can't validate the response (or it should say that the response is invalid since the WSDL defines it to be empty)..

    regards!

    /Ole
    eviware.com