4 Replies Latest reply on Apr 11, 2009 2:38 PM by BKBK

    coldfusion webservice?

    shafiur Level 1

      I have two webservices with the same code but with different names

      <cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">

      <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

      <cfreturn return>

      </cffunction>

      <cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">

      <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

      <cfreturn return>

      </cffunction>

      But when I invoke the first one return a check box.

      For the second service displays an error as such? Can any one explain me a reason behind it?

       

      Her is the invocation code and the error

       

       

       

       

       

       

      <html>

      <body>

      <cfcomponent>

      <cfinvoke

       

       

      webservice=

      "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"

       

       

      method="getUserNameFormFieldn"

       

       

      returnvariable="saleshistory"

      >

       

       

      <!--- <cfinvokeargument name="requestedEvent" value="recipientForm"/>--->

      </cfinvoke>

      <cfoutput>

       

       

      #saleshistory#

      </cfoutput>

      </cfcomponent>

      </body>

      </html>

       

      The web site you are accessing has experienced an unexpected error.
      Please contact the website administrator.

      The following information is meant for the website developer for debugging purposes.
      Error Occurred While Processing Request

      Web service operation getUserNameFormFieldn with parameters {} cannot be found.

      The error occurred in C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm: line 6
      4 : <cfinvoke webservice="http://172.16.172.41:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
      5 :            method="getUserNameFormFieldn" 
      6 :              returnvariable="saleshistory">
      7 :           <!---     <cfinvokeargument name="requestedEvent" value="recipientForm"/>--->
      8 : </cfinvoke>
      

      Resources:

       

      Browser  Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
      Remote Address  127.0.0.1
      Referrer 
      Date/Time  09-Apr-09 04:05 PM
      Stack Trace (click to expand)
      at cfwebservice32ecfm989209474.runPage(C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm:6 )

      coldfusion.xml.rpc.ServiceProxy$ServiceMethodNotFoundException: Web service operation getUserNameFormFieldn with parameters {} cannot be found.
           at coldfusion.xml.rpc.ServiceProxy.invoke(ServiceProxy.java:147)
           at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
           at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:417)
           at cfwebservice32ecfm989209474.runPage(C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm:6)
           at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
           at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
           at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
           at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
           at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
           at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
           at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
           at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
           at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
           at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
           at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
           at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
           at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
           at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
           at coldfusion.CfmServlet.service(CfmServlet.java:175)
           at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
           at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
           at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
           at jrun.servlet.FilterChain.service(FilterChain.java:101)
           at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
           at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
           at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
           at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
           at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
           at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
           at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
           at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
           at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
      

        • 1. Re: coldfusion webservice?
          ilssac Level 5

          The first thing to try is to refresh the web-service.  The first time a web-service is invoked a 'stub' (I beleive it is called) of it is created that indicates that name and return type of the methods AKA functions and the names and types of the parameters the function expects to be passed in.  If, after this first invocation, this function 'profile' is changed by adding or removing or renaming functions and|or adding or removing or renaming arguments then this error is common.

           

          The brute foruce but often quikest way to refresh the web-service is do delete it from the web service section of the ColdFusion administrator.  There are other ways to do it as well.

           

          HTH

          Ian

           

          Message was edited by: Ian Skinner

          1 person found this helpful
          • 2. Re: coldfusion webservice?
            BKBK Adobe Community Professional & MVP

            There are two methods, but it is one web service, not two. The code you should have saved as the file BaseConsole.cfc is

             

            <cfcomponent>

            </cfcomponent>

             

            There is no need for HTML or component tags in the caller. The calling page, say, wsCaller.cfm, should be something like

             

            <cfinvoke
            webservice= "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
            method="getUserNameFormFieldn"
            returnvariable="saleshistory">
            </cfinvoke>

            <cfoutput>#saleshistory#</cfoutput>

             

             

             

             

            <cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">

            <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

            <cfreturn return>

            </cffunction>

            <cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">

            <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

            <cfreturn return>

            </cffunction>

            • 3. Re: coldfusion webservice?
              BKBK Adobe Community Professional & MVP

              I take it for granted you have verified the wsdl is good, by making sure you can see it when you open its url in the browser.

              • 4. Re: coldfusion webservice?
                BKBK Adobe Community Professional & MVP

                What a mix-up. My earlier post -- which I can't edit because it misses the edit button -- should have read:

                 

                There are two methods, but it is one web service, not two. The code you should have saved as the file BaseConsole.cfc is

                 

                <cfcomponent>

                <cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">

                <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

                <cfreturn return>

                </cffunction>

                <cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">

                <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>

                <cfreturn return>

                </cffunction>

                </cfcomponent>

                 

                There is no need for HTML or component tags in the caller. The calling page, say, wsCaller.cfm, should be something like

                 

                <cfinvoke
                webservice= "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
                method="getUserNameFormFieldn"
                returnvariable="saleshistory">
                </cfinvoke>

                <cfoutput>#saleshistory#</cfoutput>