8 Replies Latest reply on Jun 11, 2007 7:11 AM by Newsgroup_User

    [Resolved] WebServices And Component

    Lorr_Hyde
      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
        • 1. Re: WebServices And Component
          craigkaminsky Level 3
          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
          • 2. Re: WebServices And Component
            Level 7
            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.
            • 3. Re: WebServices And Component
              Level 7
              > 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
              • 4. Re: WebServices And Component
                Lorr_Hyde Level 1
                Tanks all for your answer.

                Many Tanks to craigkaminsky, I change Access to remote and all work well ...
                • 5. Re: WebServices And Component
                  davidsimms Level 1
                  "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
                  • 6. Re: WebServices And Component
                    Level 7
                    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.

                    • 7. [Resolved] WebServices And Component
                      davidsimms Level 1
                      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
                      • 8. Re: WebServices And Component
                        Level 7
                        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.