• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Webservices operation can not be found

Contributor ,
Jul 17, 2009 Jul 17, 2009

Copy link to clipboard

Copied

I've got a webservice and for some reason I can not access the 2nd method in it. I get this error message :

Web service operation "DoComment" with parameters {donomite} could not be found

Now what is crazy about this is that the first method in the cfc works perfectly. So is there a restriction on calling methods from cfcs remotely? Only 1 per cfc?

BUT if I hit it directly via browser it works fine too.

Here is the URL for the test page I'm now trying to get to work. http://www.donomite.com/testwsdl.cfm


As you can see the first one works. The 2nd one does not. The 2nd one right now is just supposed to take the input string and return it.

Here it is the url for hitting it directly :

http://www.donomite.biz/remote/freelance.cfc?wsdl&method=DoComment&yourname=donomite

Here is the cfc code.

<cfcomponent>
<cfset dsn = "mysecretdsn">
<cffunction name="CheckLogin" access="remote" returntype="xml">
  <cfargument name="fusername" type="string" required="yes">
  <cfargument name="fpassword" type="string" required="yes">
  <cfset theResult = "">
  <cfstoredproc datasource="#dsn#" procedure="FreelanceLogin">
   <cfprocparam type="in" cfsqltype="cf_sql_varchar" dbvarname="fusername" value="#fusername#">
   <cfprocparam type="in" cfsqltype="cf_sql_varchar" dbvarname="fpassword" value="#fpassword#">
   <cfprocresult name="test">
  </cfstoredproc>
  <cfif ISXML(test.computed_column_1)>
   <cfset theResult = #xmlparse(test.computed_column_1)#>
  <cfelse>
   <cfset theResult = "FAIL">
  </cfif>
  <cfreturn theResult>
</cffunction>
<cffunction name="DoComment" access="remote" returntype="string">
  <cfargument name="yourname" type="string" required="yes">
  <cfset sendback = "#yourname#">
  <cfreturn sendback>
</cffunction>
</cfcomponent>

TOPICS
Advanced techniques

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 17, 2009 Jul 17, 2009

Copy link to clipboard

Copied

Well, crud, my code didn't show up.  Try again.

<cfcomponent>
<cfset dsn = "mydsn">
<cffunction name="CheckLogin" access="remote" returntype="xml">
  <cfargument name="fusername" type="string" required="yes">
  <cfargument name="fpassword" type="string" required="yes">
  <cfset theResult = "">
  <cfstoredproc datasource="#dsn#" procedure="FreelanceLogin">
   <cfprocparam type="in" cfsqltype="cf_sql_varchar" dbvarname="fusername" value="#fusername#">
   <cfprocparam type="in" cfsqltype="cf_sql_varchar" dbvarname="fpassword" value="#fpassword#">
   <cfprocresult name="test">
  </cfstoredproc>
  <cfif ISXML(test.computed_column_1)>
   <cfset theResult = #xmlparse(test.computed_column_1)#>
  <cfelse>
   <cfset theResult = "FAIL">
  </cfif>
  <cfreturn theResult>
</cffunction>
<cffunction name="DoComment" access="remote" returntype="string">
  <cfargument name="yourname" type="string" required="yes">
  <cfset sendback = "#yourname#">
  <cfreturn sendback>
</cffunction>
</cfcomponent>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

No ideas? Figgers I would be the only person in the whole wide world who has run into this one. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

It works for me. Did you fix it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

You're telling me that when you go to http://www.donomite.com/testwsdl.cfm both calls work? I get the dump for the first one but an error for the 2nd one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

It was working a few minutes ago.  Now I see an error.  For what it is worth, I can run this locally and get a response of "donomite".

<cfscript>
comment = createObject("webservice","http://www.donomite.biz/remote/freelance.cfc?wsdl");
returnit = comment.DoComment("donomite");
WriteOutput(returnit);
</cfscript>

BTW, you should "var" scope all of the function local variables.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

So if you run it from your local machine it works? hmmmmmmmmm.

I wonder if there is some weird caching going on on the server.  It is a shared hosting service.

I'll worry about doing stuff the right way once it works at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 20, 2009 Jul 20, 2009

Copy link to clipboard

Copied

LATEST

Yes, the comments method works for me locally.  You must be testing, because now the public page generates an error for the first method.

Dinghus wrote:

I'll worry about doing stuff the right way once it works at all.

Famous last words 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation