Issue Consuming Simple Coldfusion 8 Webservice

Hello,
I'm exploring the use of web services in our Coldfusion 8 environment for possible use in future development. I've come up to speed on the topic, but I am having an issue in getting even a basic example to work. Basically, when I run the Coldfusion page to invoke the web service it simply spins and spins and never does anything. I've tried placing the files in different folders as well as on different servers, but to no avail. Is there a CF service that needs to be turned on for this work? Could it be a permissions issue? Any thoughts?

Cheers,
Ty

Here are the components I've put together:

The CFC file called: "WebServiceFunctionTest.cfc"
<cfcomponent>
<cffunction name="WelcomeMsg" access="remote" returntype="string" output="no">
<cfargument name="name" type="string" required="yes">
<cfreturn "<h3><font color='blue'>Welcome to my Web Service Site</font>
</h3> " & arguments.name &"! " & "What would you like to do?">
</cffunction>
</cfcomponent>

The .cfm that calls the web service, "index.cfm"
<cfinvoke webservice="http://webServerName/CF_Webservice/WebServiceFunctionTest.cfc?wsdl" method="WelcomeMsg" returnvariable="strg">
      <cfinvokeargument name="name" value="Neo"/>
</cfinvoke>
<cfoutput>
#strg#
</cfoutput>



MedtronicVascSRAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dgrafxConnect With a Mentor Commented:
???
i don't really see anything ...

try to make it even simpler like without any input params and just return like this
<cfset str="Hello">
<cfreturn str />

also - do you have any code that sets sessions? and relocates if not set or ???
if so - you need to add in code to keep the same session alive
and without it a new session is acquired on each request
just a thought ...
0
 
dgrafxCommented:
where you have webservice="http://webservicename ..."
is that just for examples sake?
because you do need a webaddress like http://somedomain.com ... or an ip addr
0
 
MedtronicVascSRAuthor Commented:
Yes, it is for example sake since it's an internal address for our company :-)
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dgrafxCommented:
ok - i didn't notice before but where you have WebServiceFunctionTest.cfc?wsdl
remove the .cfc

whenever you are calling a component you never include the extension (.cfc)
if calling helloworld.cfc it is always called as helloworld
0
 
MedtronicVascSRAuthor Commented:
I gave that a shot, though all the documentation I read indicated and showed in example the inclusion of the extension .cfc, but it didn't work. The error message reads, "Unable to read WSDL from URL." I know what you mean about omitting .cfc when calling it as I do that in other apps. However, the simple examples I've studied by Ben Forta and Adobe include it.
0
 
duncancummingCommented:
What happens when you try and directly access the CFC through your browser?  i.e.
http://webservername/CF_Webservice/WebServiceFunctionTest.cfc


0
 
dgrafxCommented:
also try cfhttp using http://webServerName/CF_Webservice/WebServiceFunctionTest.cfc for the url
again though remove all input params and output a simple string like i said above
0
 
MedtronicVascSRAuthor Commented:
Thanks for the suggestions. I've tried them, but there seems to be some underlying issue going on that I can't seem to track down at the moment. The .cfc file works (simple and complex varieties) as intended. I can call it with <Cfinvoke> as a component rather than a web service when the .cfc file is located in the same folder as the calling .cfm file. But, as soon as I move the .cfc file to another server and use "webservice" with the url nothing happens. It simply spins forever.

To answer your question about directly accessing the .cfc file through the browser I get 1 of 2 responses. Against our test server it immediately re-directs to a non-existent "index.cfm" file and displays the tradiional "can not find page" error. Against our production server it access the CF components utility and displays "The component definition file for component 'WebServiceFunctionTest' cannot be found on this server."

Thanks again for the suggestions.

Cheers,
Ty
0
 
MedtronicVascSRAuthor Commented:
Hi,
I've been able to sift through the layers in our environment and get my webservices to run properly. For closure sake I needed to bypass a CF Fusebox switch that re-route traffic that came in without the use of an index.cfm file. Secondly, having a root mapping in the CF admin can be an issue when looking for cfc files so I created a new mapping to the cfc webservice folder I set up. http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:50855

Anyway, thanks for taking the time to post suggestions.

Cheers,
Ty

0
 
dgrafxConnect With a Mentor Commented:
this is EXACTLY the "type" of situation I was referring to when i asked if you had any code that RELOCATES if ???

i asked you about sessions or ???

??? translated simply means an unknown situation
0
 
MedtronicVascSRAuthor Commented:
dgrafx, I did not mean to offend. I disregarded your suggestion as it pertained to "sessions" since I knew that was not the issue so I did my own exploratory work and found a couple un-related items getting in the way.

Cheers,
Ty
0
 
MedtronicVascSRAuthor Commented:
Final suggestions weren't specific enough to be of particular use. In the end it takes some digging around in your own environment to determine why a web service won't work right out of the box.
0
All Courses

From novice to tech pro — start learning today.