1 Reply Latest reply on Jun 7, 2006 11:18 PM by Fernis

    web service method not found???

    GuyPhempoompanitch
      Hi,

      I am trying to invoke a web service method, which when I view it directly at the URL, it shows the available method. However, when I try to invoke the method, I get this error:

      Web service operation "ValidateUser" with
      parameters {password={12345},userName={Guy}} could not be found.


      I can invoke the method through a ASP.Net page without a problem, but not through a CFM page. Also, other methods that do not require anything passed to them work correctly. Its only the methods that require something passed, like a login method.

      When I create the web service object and then dump it, It shows the method "ValidateUser", but has a "returns void" next to it. Again, the only problem is invoking it through CF.

      Here's how I'm invoking it:

      <cfinvoke
      webservice=" http://www.xyz.com/RemoteService.asmx?wsdl"
      method="ValidateUser"
      returnvariable="myresponse">
      <cfinvokeargument name="userName" value="Guy">
      <cfinvokeargument name="password" value="12345">
      </cfinvoke>

      or

      <cfset wsURL = " http://www.xyz.com/RemoteService.asmx?wsdl">
      <cfscript>
      ws = CreateObject('webservice', '#wsURL#');
      myresponse = ws.ValidateUser('Guy','12345');
      </cfscript>

      <cfdump var="#myresponse#">


      Both give me the same error. Thanks for any help!
        • 1. Re: web service method not found???
          Fernis Level 3
          Does your web service method validateUser support more than those two arguments?

          From my experience, you need to use <cfinvokeargument> for every possible method attribute the WSDL describes. The error you're getting typically indicates that you are not providing the correct number of arguments.

          The problem with CF is that it won't automatically fill in the NULLs for the arguments you didn't specify, as other platforms do. Yes, it sucks a bit, but once you get used to it, you can live with it. This also renders the CFSCRIPT model of invoking a bit useless, when there are lots of optional arguments in the method.

          CFMX 7's <cfinvokeargument> has a new attribute "omit", which, I'm just guessing, sends a NULL value for that attribute. Leave the value attribute empty when you use that.

          (Edited to finish a missing sentence in paragraph 3 :-)