5 Replies Latest reply on Jun 6, 2007 1:22 PM by StokeyTCI

    Web Service consumer

    StokeyTCI
      I'm getting
      java.lang.IllegalArgumentException: java.lang.ClassCastException@8d878a

      CFC
      <cfcomponent>
      <cfproperty name="serverID" type="string">
      <cfproperty name="dealerNbr" type="numeric" >
      </cfcomponent>

      CFM
      <cfset aAppPing=CreateObject('component','/gateway/aAppPing')>
      <cfset aAppPing.serverID="test">
      <cfset aAppPing.dealerNbr=111111>

      <cfset webService = CreateObject('webservice',' http://10.20.1.247:8080/ws/servlet/aapplicping?wsdl')>
      <cfset testResult = webService.execute(aAppPing)>

      wsdl
      - <complexType name="AppPing">
      - <all>
      <element name="ServerID" type="xsd:string" />
      <element name="DealerNbr" type="xsd:int" />
      </all>
      </complexType>

      Any ideas, I'm at my wits end, I have been trying and googleing for two weeks now
        • 1. Re: Web Service consumer
          insuractive Level 3
          Ah, fun with complex types in CF webservices!

          Try something like this:
          <cfset stArgs = StructNew()>
          <cfset stArgs.AppPing = StructNew()>
          <cfset stArgs.AppPing.ServerID = "test">
          <cfset stArgs.AppPing.dealerNbr = 11111>
          <cfinvoke webservice=" http://10.20.1.247:8080/ws/servlet/aapplicping?wsdl" returnvariable="objResponse" argumentcollection="#stArgs#">
          • 2. Re: Web Service consumer
            StokeyTCI Level 1
            that gives me the error

            Web service parameter name "parameters" could not be found in the provided parameters {APPPING}.
            • 3. Re: Web Service consumer
              StokeyTCI Level 1
              So I change it to

              <cfset stArgs = StructNew()>
              <cfset stArgs.AppPing = StructNew()>
              <cfset stArgs.AppPing.ServerID = "BIBNET">
              <cfset stArgs.AppPing.dealerNbr = 3413454>
              <cfinvoke webservice=" http://10.20.1.247:8080/ws/servlet/aapplicping?wsdl" method="execute" returnvariable="a_ApplicPingExecuteResponse" >
              <cfinvokeargument name="parameters" value="#stArgs#"/>
              </cfinvoke>

              Which gives me this error
              Web service operation "execute" with parameters {parameters={{APPPING={{DEALERNBR={3413454},SERVERID={BIBNET},}},}},} could not be found.

              Which was why I was using the CFC to pass a 2 part variable Parameters to the web service
              • 4. Re: Web Service consumer
                insuractive Level 3
                Can you post the entire WSDL?
                • 5. Re: Web Service consumer
                  StokeyTCI Level 1
                  <?xml version="1.0" encoding="UTF-8" ?>
                  - <definitions name="ApplicPing" targetNamespace=" http://tempuri.org/action/" xmlns:tns=" http://tempuri.org/action/" xmlns:wsdlns=" http://tempuri.org/action/" xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns=" http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="GpWebSrv">
                  - <types>
                  - <schema targetNamespace="GpWebSrv" xmlns=" http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC=" http://schemas.xmlsoap.org/soap/encoding/" elementFormDefault="qualified">
                  - <complexType name="AppPing">
                  - <all>
                  <element name="ServerID" type="xsd:string" />
                  <element name="DealerNbr" type="xsd:int" />
                  </all>
                  </complexType>
                  - <complexType name="AppPing_output">
                  - <all>
                  <element name="ServerID" type="xsd:string" />
                  <element name="ServerErrors" type="tns1:AppPing_output.ServerErrors" />
                  <element name="DealerNbr" type="xsd:int" />
                  <element name="DealerErrors" type="tns1:AppPing_output.DealerErrors" />
                  <element name="TimeStamp" type="xsd:string" />
                  </all>
                  </complexType>
                  - <complexType name="AppPing_output.ServerErrors">
                  - <all>
                  <element name="SrvErrCode" type="xsd:string" />
                  <element name="SrvErrSeverity" type="xsd:byte" />
                  <element name="SrvErrMessage" type="xsd:string" />
                  </all>
                  </complexType>
                  - <complexType name="AppPing_output.DealerErrors">
                  - <all>
                  <element name="DealerErrCode" type="xsd:string" />
                  <element name="DealerErrSeverity" type="xsd:byte" />
                  <element name="DealerErrMessage" type="xsd:string" />
                  </all>
                  </complexType>
                  </schema>
                  - <schema targetNamespace=" http://tempuri.org/action/" xmlns=" http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC=" http://schemas.xmlsoap.org/soap/encoding/" elementFormDefault="qualified">
                  <import namespace="GpWebSrv" />
                  - <element name="ApplicPing.Execute">
                  - <complexType>
                  - <sequence>
                  <element minOccurs="1" maxOccurs="1" name="Sdtin" type="tns1:AppPing" />
                  </sequence>
                  </complexType>
                  </element>
                  - <element name="ApplicPing.ExecuteResponse">
                  - <complexType>
                  - <sequence>
                  <element minOccurs="1" maxOccurs="1" name="Sdtout" type="tns1:AppPing_output" />
                  </sequence>
                  </complexType>
                  </element>
                  </schema>
                  </types>
                  - <message name="ApplicPing.ExecuteSoapIn">
                  <part name="parameters" element="tns:ApplicPing.Execute" />
                  </message>
                  - <message name="ApplicPing.ExecuteSoapOut">
                  <part name="parameters" element="tns:ApplicPing.ExecuteResponse" />
                  </message>
                  - <portType name="ApplicPingSoapPort">
                  - <operation name="Execute">
                  <input message="wsdlns:ApplicPing.ExecuteSoapIn" />
                  <output message="wsdlns:ApplicPing.ExecuteSoapOut" />
                  </operation>
                  </portType>
                  - <binding name="ApplicPingSoapBinding" type="wsdlns:ApplicPingSoapPort">
                  <soap:binding style="document" transport=" http://schemas.xmlsoap.org/soap/http" />
                  - <operation name="Execute">
                  <soap:operation soapAction=" http://tempuri.org/action/action/AAPPLICPING.Execute" />
                  - <input>
                  <soap:body use="literal" />
                  </input>
                  - <output>
                  <soap:body use="literal" />
                  </output>
                  </operation>
                  </binding>
                  - <service name="ApplicPing">
                  - <port name="ApplicPingSoapPort" binding="wsdlns:ApplicPingSoapBinding">
                  <soap:address location=" http://S109319D.TIRECENTERS.COM:8080/ws/servlet/aapplicping" />
                  </port>
                  </service>
                  </definitions>