BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Web Services : not nillable missed (http://www.blackberryforums.com/developer-forum/179277-web-services-not-nillable-missed.html)

SamuelD 03-03-2009 02:29 PM

Web Services : not nillable missed
 
Hello,
I have a little problem with my new Web Service. I always get the error :

Quote:

not nillable element of array type in response is missed.
here is the SOAP Response :
Code:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
    <soap:Body>
        <GetHRRequestToApproveResponse xmlns="">
            <GetHRRequestToApproveResult>true</GetHRRequestToApproveResult>
            <result>
                <HRRequest>
                    <RequestID>6163</RequestID>
                    <ParentRequestID xsi:nil="true" />
                    <RequestTypeID>501</RequestTypeID>
                    <RequestTypeDescFr>Ajustement salarial (C)</RequestTypeDescFr>
                    <RequestTypeDescEn>Salary adjustment (C)</RequestTypeDescEn>
                    <RequestStatusID>20</RequestStatusID>
                    <RequestStatusDescFr>En processus d'approbation</RequestStatusDescFr>
                    <RequestStatusDescEn>Waiting for approval</RequestStatusDescEn>
                    <MemberCode>074566</MemberCode>
                    <MemberLastName>Rioux</MemberLastName>
                    <MemberFirstName>Marc</MemberFirstName>
                    <RequestedByMemberCode>011456</RequestedByMemberCode>
                    <RequestedByMemberLastName>Carrie</RequestedByMemberLastName>
                    <RequestedByMemberFirstName>Joe</RequestedByMemberFirstName>
                    <RequestDate>2009-02-28 15:31:30</RequestDate>
                    <DateTimeFormat>yyyy-MM-dd HH:mm:ss</DateTimeFormat>
                </HRRequest>
            </result>
            <rowCount>1</rowCount>
            <errorMsg />
        </GetHRRequestToApproveResponse>
    </soap:Body>
</soap:Envelope>


SamuelD 03-04-2009 03:04 PM

Don't know if that would help you, the WSDL :

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>


Thank you for your help, have a nice day.

--
Samuel D.

twinfire 03-05-2009 01:23 PM

Hi Samuel. I was wondering if you found out what the problem was? I am experiencing the same error for a web service that works fine from other java clients, just not from the blackberry. I am generating the stub files using the Sun Java Wireless Toolkit 2.5.2 and running via the 4.6 component pack within the eclipse jde plugin.

SamuelD 03-05-2009 01:26 PM

Hello, I'm still looking for a way to resolve that problem.


Thank you, have a nice day.

--
Samuel D.

SamuelD 03-06-2009 03:54 PM

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

Quote:

<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.

AdrianS 03-26-2009 08:27 AM

Hello, I think it's a Blackberry 4.5 bug. I have got the same problem.
I have generated a web service client stub with the Wireless Toolkit 2.5.2 and when I invoke a webservice method that replys with a response that contains a null strings it throws that MarshalException. But when I run the same application on 4.7 devices, it works.
I have made some tests and it seems that null strings can be send but cannot be received although the send/receive packages look the same(I have captured them with a sniffer).
I have searched also a way to catch the package to modify it but i've got nothing.

Did anyone managed to solve this problem?


All times are GMT -5. The time now is 07:53 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.