0 Replies Latest reply on May 15, 2006 11:14 AM by Jim the Knife

    How to use cfinvoke against a .NET web service

    Jim the Knife

      I'm trying to write a CFM page that calls a .NET web service. My call works fine as long as challenge response is turned off on the IIS server:

      <cfinvoke webservice="" returnvariable="sam" method="GetGeos" />
      <p><cfdump var=#sam# /></p>

      However, when we turn authentication (challenge response) on on IIS, and add a user name and password to the above CFINVOKE call, we get the error: (401)Access Denied. Here is the adjusted CFM code:

      <cfinvoke webservice="" username="myUser" password="myPassword" returnvariable="sam" method="GetGeos" />
      <p><cfdump var=#sam# /></p>

      I am able to go to a browser and, after entering the correct user name & password, navigate to the WSDL for this web service. We also tried going to the Data & Services > Web Services section of CF Administrator and adding a reference to the web service; it worked fine when challenge response is off, and fails when it is on.

      Any ideas about how I can work around this? Also, right now I have a local user defined on the Win2K machine rather than a domain user, since I'm not sure if CF can pass a domain name for authentication. Can it? E.g.

      <cfinvoke ... username="mydomain\myusername" ... />

      Thanks, Jim