Results 1 to 2 of 2
  1. #1
    SamuelD is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default Web Service : nillable

    Hello,
    I have a little problem with Web Services. I receive this error when the response pass in the parser :

    not nillable element of array type in response is missed.
    Here is the WSDL description :
    Java Code:
    <wsdl:definitions xmlns:soap="xschemas.xmlsoap.org/wsdl/soap/" xmlns:tm="xmicrosoft.com/wsdl/mime/textMatching/" xmlns:soapenc="xschemas.xmlsoap.org/soap/encoding/" xmlns:mime="xschemas.xmlsoap.org/wsdl/mime/" xmlns:tns="xtempuri.org/" xmlns:s="xw3.org/2001/XMLSchema" xmlns:soap12="xschemas.xmlsoap.org/wsdl/soap12/" xmlns:http="xschemas.xmlsoap.org/wsdl/http/" targetNamespace="xtempuri.org/" xmlns:wsdl="xschemas.xmlsoap.org/wsdl/"> 
      <wsdl:types> 
        <s:schema elementFormDefault="qualified" targetNamespace="xtempuri.org/"> 
          <s:element name="GetHRRequestToApprove"> 
            <s:complexType> 
              <s:sequence> 
                <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" /> 
                <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> 
                <s:element minOccurs="1" maxOccurs="1" name="initUserContext" type="s:boolean" /> 
                <s:element minOccurs="1" maxOccurs="1" name="maximumRows" type="s:int" /> 
                <s:element minOccurs="1" maxOccurs="1" name="startRowIndex" type="s:int" /> 
              </s:sequence> 
            </s:complexType> 
          </s:element> 
          <s:element name="GetHRRequestToApproveResponse"> 
            <s:complexType> 
              <s:sequence> 
                <s:element minOccurs="1" maxOccurs="1" name="GetHRRequestToApproveResult" type="s:boolean" /> 
                <s:element minOccurs="0" maxOccurs="1" name="result" type="tns:ArrayOfHRRequest" /> 
                <s:element minOccurs="1" maxOccurs="1" name="rowCount" nillable="true" type="s:int" /> 
                <s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" /> 
              </s:sequence> 
            </s:complexType> 
          </s:element> 
          <s:complexType name="ArrayOfHRRequest"> 
            <s:sequence> 
              <s:element minOccurs="0" maxOccurs="unbounded" name="HRRequest" nillable="true" type="tns:HRRequest" /> 
            </s:sequence> 
          </s:complexType> 
          <s:complexType name="HRRequest"> 
            <s:sequence> 
              <s:element minOccurs="1" maxOccurs="1" name="RequestID" type="s:long" /> 
              <s:element minOccurs="1" maxOccurs="1" name="ParentRequestID" nillable="true" type="s:long" /> 
              <s:element minOccurs="1" maxOccurs="1" name="RequestTypeID" type="s:int" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestTypeDescFr" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestTypeDescEn" type="s:string" /> 
              <s:element minOccurs="1" maxOccurs="1" name="RequestStatusID" type="s:int" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestStatusDescFr" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestStatusDescEn" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="MemberCode" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="MemberLastName" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="MemberFirstName" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestedByMemberCode" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestedByMemberLastName" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestedByMemberFirstName" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="RequestDate" type="s:string" /> 
              <s:element minOccurs="0" maxOccurs="1" name="DateTimeFormat" type="s:string" /> 
            </s:sequence> 
          </s:complexType> 
          <s:element name="GetHRRequestToSign"> 
            <s:complexType> 
              <s:sequence> 
                <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" /> 
                <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> 
                <s:element minOccurs="1" maxOccurs="1" name="initUserContext" type="s:boolean" /> 
                <s:element minOccurs="1" maxOccurs="1" name="maximumRows" type="s:int" /> 
                <s:element minOccurs="1" maxOccurs="1" name="startRowIndex" type="s:int" /> 
              </s:sequence> 
            </s:complexType> 
          </s:element> 
          <s:element name="GetHRRequestToSignResponse"> 
            <s:complexType> 
              <s:sequence> 
                <s:element minOccurs="1" maxOccurs="1" name="GetHRRequestToSignResult" type="s:boolean" /> 
                <s:element minOccurs="0" maxOccurs="1" name="result" type="tns:ArrayOfHRRequest" /> 
                <s:element minOccurs="1" maxOccurs="1" name="rowCount" nillable="true" type="s:int" /> 
                <s:element minOccurs="0" maxOccurs="1" name="errorMsg" type="s:string" /> 
              </s:sequence> 
            </s:complexType> 
          </s:element> 
        </s:schema> 
      </wsdl:types> 
      <wsdl:message name="GetHRRequestToApproveSoapIn"> 
        <wsdl:part name="parameters" element="tns:GetHRRequestToApprove" /> 
      </wsdl:message> 
      <wsdl:message name="GetHRRequestToApproveSoapOut"> 
        <wsdl:part name="parameters" element="tns:GetHRRequestToApproveResponse" /> 
      </wsdl:message> 
      <wsdl:message name="GetHRRequestToSignSoapIn"> 
        <wsdl:part name="parameters" element="tns:GetHRRequestToSign" /> 
      </wsdl:message> 
      <wsdl:message name="GetHRRequestToSignSoapOut"> 
        <wsdl:part name="parameters" element="tns:GetHRRequestToSignResponse" /> 
      </wsdl:message> 
      <wsdl:portType name="HRRequestsListWSSoap"> 
        <wsdl:operation name="GetHRRequestToApprove"> 
          <wsdl:input message="tns:GetHRRequestToApproveSoapIn" /> 
          <wsdl:output message="tns:GetHRRequestToApproveSoapOut" /> 
        </wsdl:operation> 
        <wsdl:operation name="GetHRRequestToSign"> 
          <wsdl:input message="tns:GetHRRequestToSignSoapIn" /> 
          <wsdl:output message="tns:GetHRRequestToSignSoapOut" /> 
        </wsdl:operation> 
      </wsdl:portType> 
      <wsdl:binding name="HRRequestsListWSSoap" type="tns:HRRequestsListWSSoap"> 
        <soap:binding transport="schemas.xmlsoap.org/soap/http" /> 
        <wsdl:operation name="GetHRRequestToApprove"> 
          <soap:operation soapAction="tempuri.org/GetHRRequestToApprove" style="document" /> 
          <wsdl:input> 
            <soap:body use="literal" /> 
          </wsdl:input> 
          <wsdl:output> 
            <soap:body use="literal" /> 
          </wsdl:output> 
        </wsdl:operation> 
        <wsdl:operation name="GetHRRequestToSign"> 
          <soap:operation soapAction="xtempuri.org/GetHRRequestToSign" style="document" /> 
          <wsdl:input> 
            <soap:body use="literal" /> 
          </wsdl:input> 
          <wsdl:output> 
            <soap:body use="literal" /> 
          </wsdl:output> 
        </wsdl:operation> 
      </wsdl:binding> 
      <wsdl:binding name="HRRequestsListWSSoap12" type="tns:HRRequestsListWSSoap"> 
        <soap12:binding transport="xschemas.xmlsoap.org/soap/http" /> 
        <wsdl:operation name="GetHRRequestToApprove"> 
          <soap12:operation soapAction="xtempuri.org/GetHRRequestToApprove" style="document" /> 
          <wsdl:input> 
            <soap12:body use="literal" /> 
          </wsdl:input> 
          <wsdl:output> 
            <soap12:body use="literal" /> 
          </wsdl:output> 
        </wsdl:operation> 
        <wsdl:operation name="GetHRRequestToSign"> 
          <soap12:operation soapAction="tempuri.org/GetHRRequestToSign" style="document" /> 
          <wsdl:input> 
            <soap12:body use="literal" /> 
          </wsdl:input> 
          <wsdl:output> 
            <soap12:body use="literal" /> 
          </wsdl:output> 
        </wsdl:operation> 
      </wsdl:binding> 
      <wsdl:service name="HRRequestsListWS"> 
        <wsdl:port name="HRRequestsListWSSoap" binding="tns:HRRequestsListWSSoap"> 
          <soap:address location="qcap.dev.ent.cginet/Portal/WebServices/HRRequestsListWS.asmx" /> 
        </wsdl:port> 
        <wsdl:port name="HRRequestsListWSSoap12" binding="tns:HRRequestsListWSSoap12"> 
          <soap12:address location="qcap.dev.ent.cginet/Portal/WebServices/HRRequestsListWS.asmx" /> 
        </wsdl:port> 
      </wsdl:service> 
    </wsdl:definitions>
    and here is the SOAP Response :
    Java Code:
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/XMLSchema">
      <soap:Body>
        <GetHRRequestToApproveResponse xmlns="tempuri.org/">
          <GetHRRequestToApproveResult>true</GetHRRequestToApproveResult>
          <result>
            <HRRequest>
              <RequestID>663</RequestID>
              <ParentRequestID xsi:nil="true" />
              <RequestTypeID>51</RequestTypeID>
              <RequestTypeDescFr>Ajustement salarial (C)</RequestTypeDescFr>
              <RequestTypeDescEn>Salary adjustment (C)</RequestTypeDescEn>
              <RequestStatusID>2</RequestStatusID>
              <RequestStatusDescFr>En processus d'approbation</RequestStatusDescFr>
              <RequestStatusDescEn>Waiting for approval</RequestStatusDescEn>
              <MemberCode>072170</MemberCode>
              <MemberLastName>Robidoux</MemberLastName>
              <MemberFirstName>Marc-Andr</MemberFirstName>
              <RequestedByMemberCode>018226</RequestedByMemberCode>
              <RequestedByMemberLastName>Carrier</RequestedByMemberLastName>
              <RequestedByMemberFirstName>Sylvio</RequestedByMemberFirstName>
              <RequestDate>2009-01-28 15:31:30</RequestDate>
              <DateTimeFormat>yyyy-MM-dd HH:mm:ss</DateTimeFormat>
            </HRRequest>
          </result>
          <rowCount>1</rowCount>
          <errorMsg />
        </GetHRRequestToApproveResponse>
      </soap:Body>
    </soap:Envelope>

  2. #2
    SamuelD is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default

    Hello again,
    I found the problem. That's the part of the response that is responsible :

    <ParentRequestID xsi:nil="true" />
    I used SoapUI to mock the response and I set a value to ParentRequestID.
    I have a new question now. Is there a way to receive nil element with the BlackBerry?

    Soapui.org it's free and work just fine.

Similar Threads

  1. Problem of Web Service
    By nihongbin in forum XML
    Replies: 1
    Last Post: 12-11-2008, 05:20 AM
  2. serialize to web service?
    By theartz in forum Advanced Java
    Replies: 2
    Last Post: 08-16-2008, 02:39 AM
  3. Setup RMI service on Ant
    By vaskarbasak in forum Advanced Java
    Replies: 0
    Last Post: 07-24-2008, 03:25 PM
  4. Web Service from JSP
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-02-2007, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •