3 Replies Latest reply on Jan 5, 2007 12:40 PM by insuractive

    Error message when trying to connect to a web service

    critical5
      Hi all,

      I am trying to consume a third party web service using the attached code and i get this big massive error about complex types:


      [The following information is meant for the website developer for debugging purposes.

      Error Occurred While Processing Request
      Complex object types cannot be converted to simple values.
      The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values.
      The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in later versions. ]

      Has anyone encountered this before or what this may mean....thanks

      Code:



        • 1. Re: Error message when trying to connect to a web service
          insuractive Level 3
          What kind of data is returned by your callcredit webservice? Try performing a cfdump on "io".

          Also, the cfinvoke/webservice method usually generates the SOAP wrapper around your webservice arguments. You may want to try just passing the XML expected by Job5314 (unless, of course, the method is expecting a full SOAP message as a parameter).

          i.e.
          <cfsavecontent variable="strpost2">
          <pwdchangerequest>
          <oldpwd>oldpassword</oldpwd>
          <newpwd>newpass</newpwd>
          <confirmpwd>newpass</confirmpwd>
          </pwdchangerequest>
          </cfsavecontent>

          <cfinvoke
          webservice=" http://localhost/callcredit.wsdl"
          method="Job5314"
          returnvariable="io">
          <cfinvokeargument name="io" value="#strpost2#"/>
          </cfinvoke>

          <cfdump var="#io#">

          • 2. Re: Error message when trying to connect to a web service
            critical5 Level 1
            Thanks Michael...I tried what you mentioned but I still get the same error...I think my fundemental proble is I do not understand my WSDL file very well....
            • 3. Re: Error message when trying to connect to a web service
              insuractive Level 3
              If you have access to them, I would try loading the WSDL as a web reference in either .NET studio or Dreamweaver MX. From there you can inspect the webservice and see what the input and output variables for the web service functions are. Its much easier that trying to read through the WSDL document if you're not familiar with the structure of the document.

              If you are still having problems with the webservice, you could always contact the 3rd party developer and see if they have any sample code showing how to consume the webservice. Odds are they probably won't have anything in CF, but it might give you more of an idea of what the methods expect and return.