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

[Resolved] WebServices And Component

New Here ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

Hi all

I creat a Component And i Want to use it like a WebService

The WSDL is :
http://www.elkotan.com/Script/CFC/choix.cfc?wsdl
I make a test page .. on this page i call the component in 1 and web services in 2
http://www.elkotan.com/test.cfm

The componen work but the WebServices no

My code for call it the simple:

<cfinvoke
component="Script.CFC.choix"
method="DonneeChoixRace"
returnvariable="DonneeChoixRaceRet">
<cfinvokeargument name="IdJoueur" value="enter_value_here"/>
</cfinvoke>

<cfdump var="#DonneeChoixRaceRet#" />

<cfinvoke webservice=" http://www.elkotan.com/Script/CFC/choix.cfc?wsdl"
method="DonneeChoixRace"
returnvariable="ArrayChoix">
<cfinvokeargument name="IdJoueur" value="XXXX"/>
</cfinvoke>

<cfdump var="#ArrayChoix#" />

When I examine the WSDL, I can not see method or argument ....
I think the probleme is the WSDL is not correctely formed

Tanks for help

PS: Sorry for my poor english
TOPICS
Advanced techniques

Views

430

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
Advocate ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

You may have done this but in your CFC/Web Service, did you set the access attribute to remote for all functions you want available as a web service?

For example, if I have a CFC called HelloWorld.cfc with one method (getHelloWorld) and want to make it available as a web service, I need to do the following:
<cfcomponent>
<cffunction name="getHelloWorld" returntype="string" access="remote">
<cfreturn "Hello World"/>
</cffunction
</cfcomponent>

The attribute setting access="remote" tells CF that this method is available for Web Service calls, Flash Remoting and the like. If you have not added this to your functions/methods, try it to see if it takes care of your issue.

If not, could you post a little code from the CFC?

Cheers,
Craig

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
New Here ,
Jun 10, 2007 Jun 10, 2007

Copy link to clipboard

Copied

Tanks all for your answer.

Many Tanks to craigkaminsky, I change Access to remote and all work well ...

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
LEGEND ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

Something that often happens to me since we use "windows integrated
security" by default on our servers, a web service CAN NOT connect to a
resource that is restricted by windows integrated security. What I have
got to do is change the security on the cfc file to allow anonymous
access or basic security depending on the requirements.

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 ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

"Something that often happens to me since we use "windows integrated
security" by default on our servers, a web service CAN NOT connect to a
resource that is restricted by windows integrated security. What I have
got to do is change the security on the cfc file to allow anonymous
access or basic security depending on the requirements."

Ian, I'm curious why you would opt for that option, rather than to go ahead and pass a Windows username/password to the CFC when invoking it as that would permit you to continue to maintain your integrated authentication on those files?

David

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
LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

Ian, I'm curious why you would opt for that option, rather than to go
ahead and pass a Windows username/password to the CFC when invoking it
as that would permit you to continue to maintain your integrated
authentication on those files?

Not that I know of, windows integrated asks for a browser to send
credentials using special HTTP response headers. Web services can not
understand and respond to these headers. You can pass credentials if
you uses the other authentication choices, but not windows integrated as
far as I know.

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 ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

Actually ColdFusion can pass a Windows username and password to a protected CFC. That's what the username and password parameters of the CFINVOKE tag do.

David

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
LEGEND ,
Jun 11, 2007 Jun 11, 2007

Copy link to clipboard

Copied

LATEST
davidsimms wrote:
> Actually ColdFusion can pass a Windows username and password to a protected CFC. That's what the username and password parameters of the CFINCOKE tag do.
>
> David

Yes it can and these usernames and passwords will work if the site uses
Digest or Basic authentication. But I don't believe it works with
Integrated Windows, since this authentication uses special response headers.

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
LEGEND ,
Jun 08, 2007 Jun 08, 2007

Copy link to clipboard

Copied

> You may have done this but in your CFC/Web Service, did you set the access
> attribute to remote for all functions you want available as a web service?

I'd say you've got it.

If one browses to here:
http://www.elkotan.com/Script/CFC/choix.cfc?method=DonneeChoixRace

One gets this:

The method 'DonneeChoixRace' in component
D:\clients\elkotan.com\www\Script\CFC\choix.cfc cannot be accessed
remotely.

--
Adam

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