4 Replies Latest reply on Nov 20, 2012 6:36 AM by Daz440

    web service call fails - type mismatch

    Daz440

      Hi All

       

      I hope someone can help, as I have been struggling with this issue for a few days. If I have missed any useful information off of this post, please ask and I will try to supply.

       

      I am trying to call a web service, but contantly receiving the error:

      "{http://springframework.org/spring-ws}ValidationError:cvc-elt.4.3: Type 'xsd:long' is not validly derived from the type definition, 'idField', of element 'documentId'."

       

      An example of the call to the webservice is:

       

      <cfscript>

      getDocumentAsPdfRequest = structNew();
      getDocumentAsPdfRequest.documentId = 12017988;
      getDocumentAsPdfRequest.ignoreUnsupportedConversion = 0;

      ws = createObject("webservice", "#wsdldocumenturl#");
      ws.setUsername("#wsdlusername#");
      ws.setPassword("#wsdlpassword#");

      myresult = ws.getDocumentAsPdf(getDocumentAsPdfRequest);

      </cfscript>

      <cfdump var="#myresult#">

       

       

      the webservice definition is:

       

      getDocumentAsPdfRequest type getDocumentAsPdfRequest 

      Returns the document as a pdf if possible
      • documentId type idField - type long with restriction minInclusive(1000) maxInclusive(9223372036854775807) 

      Id of the document to be converted to pdf

      • ignoreUnsupportedConversion type boolean 

      Specifying true for this will return the original document without converting - if a conversion is not possible

       

      the webservice xml is:

       

      <xs:element name="getDocumentAsPdfRequest"> 

      <xs:annotation> 
      <xs:documentation>Returns the document as a pdf if possible</xs:documentation>
      </xs:annotation>

      <xs:complexType> 

      <xs:sequence> 
      <xs:element name="documentId" type="tns:idField"> 
      <xs:annotation> 
      <xs:documentation>Id of the document to be converted to pdf</xs:documentation>
      </xs:annotation>
      </xs:element>

      <xs:element name="ignoreUnsupportedConversion" type="xs:boolean"> 

      <xs:annotation> 
      <xs:documentation>Specifying true for this will return the original document without converting - if a conversion is not possible</xs:documentation>
      </xs:annotation>
      </xs:element>

      </xs:sequence>
      </xs:complexType>

      </xs:element>

       

       

       

       

      I have tried using javacast("long", "12017988"), but the same error is shown

       

      any help or advise gratefully received.

       

      Thanks,

      Darren