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

Consuming a web service

Participant ,
Feb 19, 2009 Feb 19, 2009
I am not sure how to get to a web service. The web service is written in Perl and from a browser I pass it a string, and the service passes back my results:

I enter to the browser:
http://server/chkuser.pl?ID=12345

and either a 0 or a longer string is returned.

How do I call this web service from a CF page?

How do I reference what is returned?
474
Translate
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

correct answers 1 Correct answer

LEGEND , Feb 19, 2009 Feb 19, 2009
spacehog wrote:
> So then the webservice as we currently have it is not useable?
>
> Is there any way then to pass a URL like:
>
> http://servername/filename.pl?ID=12345
>
> and be able to use the string that is passed back?
>

Well that does not seem to be a web service. If you just want to
request an HTTP url, the <cfhttp...> tag is pretty useful for this.

<cfhttp url=" http://servername/filename.pl?id=12345">

OR

<cfhttp url=" http://servername/filename.pl">
<cfhttpparam name="id" va...
Translate
Community Expert ,
Feb 19, 2009 Feb 19, 2009
<cfset wsObject=createobject("webservice", "url_of_web_service_wsdl")>
<cfset x = wsObject.wsMethodCall(arguments_if_any).

Translate
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
Participant ,
Feb 19, 2009 Feb 19, 2009
So I have to know the URL of the WSDL and the method?

Translate
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
LEGEND ,
Feb 19, 2009 Feb 19, 2009
quote:

Originally posted by: spacehog
So I have to know the URL of the WSDL and the method?



yes
Translate
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
Participant ,
Feb 19, 2009 Feb 19, 2009
So then the webservice as we currently have it is not useable?

Is there any way then to pass a URL like:

http://servername/filename.pl?ID=12345

and be able to use the string that is passed back?
Translate
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
LEGEND ,
Feb 19, 2009 Feb 19, 2009
LATEST
spacehog wrote:
> So then the webservice as we currently have it is not useable?
>
> Is there any way then to pass a URL like:
>
> http://servername/filename.pl?ID=12345
>
> and be able to use the string that is passed back?
>

Well that does not seem to be a web service. If you just want to
request an HTTP url, the <cfhttp...> tag is pretty useful for this.

<cfhttp url=" http://servername/filename.pl?id=12345">

OR

<cfhttp url=" http://servername/filename.pl">
<cfhttpparam name="id" value="12345" type="url">
</cfhttp>

and then

<cfoutput>#len(cfhttp.filecontent)#</cfoutput>
OR
<cfoutput>#httpCodeFormat(cfhttp.filecontent)#</cfoutput>
Translate
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