4

I have been facing the above mentioned error, when generating soap response. I also want to make fname required and I have tried almost everything like minOccurs=1,nillable:false but no luck.

Here is my requested parameters:-

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
    <Body>
        <RUser xmlns="http://www.test.org/">
            <RInfo xmlns="">
                <user>
                    <fname>[string]</fname>
                </user>
            </RInfo>
        </RUser>
    </Body>
</Envelope>

My wsdl file is follow :-

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="TestServiceService" targetNamespace="http://www.test.org/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:tns="http://www.test.org/"
                  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <wsdl:types>
        <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   xmlns:tns="http://www.test.org/"
                   attributeFormDefault="unqualified"
                   elementFormDefault="unqualified"
                   targetNamespace="http://www.test.org/">


            <xs:element name="RUser" type="tns:RUser"/>
            <xs:element name="RResponse" type="tns:RResponse"/>

            <xs:complexType name="RUser">
                <xs:sequence>
                    <xs:element  name="RInfo" type="tns:rInfo"/>
                </xs:sequence>
            </xs:complexType>


            <xs:complexType name="rInfo">
                <xs:sequence>
                    <xs:element name="user">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="fname" type="xs:string" nillable="false"/>
                        </xs:sequence>
                    </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:complexType>


            <xs:complexType name="RResponse">
                <xs:sequence>
                    <xs:element minOccurs="1" name="RResult" type="tns:RResult"/>
                </xs:sequence>
            </xs:complexType>
            <xs:complexType name="RResult">
                <xs:sequence>
                    <xs:element minOccurs="0" name="rType" type="xs:string"/>
                    <xs:element minOccurs="0" name="ruserID" type="xs:string"/>
                    <xs:element minOccurs="0" name="authFailed" type="xs:string"/>
                    <xs:element minOccurs="0" name="soapMessage" type="xs:string"/>
                </xs:sequence>
           </xs:complexType>

        </xs:schema>
    </wsdl:types>



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




    <wsdl:portType name="TestServiceWsdlEndpointPortType">
        <wsdl:operation name="RUser">
            <wsdl:input name="RUser" message="tns:RUser"/>
            <wsdl:output name="RResponse" message="tns:RResponse"/>
        </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding name="TestServiceWsdlEndpointBinding" type="tns:TestServiceWsdlEndpointPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation name="RUser">
            <soap:operation soapAction="" style="document"/>
            <wsdl:input name="RUser">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="RResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="TestServiceWsdlEndpoint">
        <wsdl:port name="TestServiceWsdlPort" binding="tns:TestServiceWsdlEndpointBinding">
            <soap:address location="http://localhost:8080/testapp/services/TestServiceWsdl"/>
        </wsdl:port>
    </wsdl:service>

</wsdl:definitions>
halfer
  • 19,824
  • 17
  • 99
  • 186
Sumit Verma
  • 91
  • 1
  • 7

1 Answers1

0

This should be your request,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://www.test.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <test:RUser>
         <RInfo>
            <user>
               <fname>?</fname>
            </user>
         </RInfo>
      </test:RUser>
   </soapenv:Body>
</soapenv:Envelope>
kingAm
  • 1,755
  • 1
  • 13
  • 23