Skip to main content
Participant
March 22, 2011
Question

createObject webservice with basic authentication

  • March 22, 2011
  • 2 replies
  • 1181 views

I'm trying to connect to a webservice with basic http authentication on. When I use createObject, the authentication fails. It does work through cfinvoke though. Here's the code I'm using:

    var WSoptions = {};    WSoptions["username"] = "MyUsername";    WSoptions["password"] = "MyPassword";     WS = createObject("webservice", "WSurl", WSoptions);     WSaction = WS.methodName();

When i try this code I get a 401 error. Any idea what I'm doing wrong?

    This topic has been closed for replies.

    2 replies

    March 23, 2011

    You are not puting the site to the correct folder

    Checked the Location or the Root Folder

    mike00817Author
    Participant
    March 22, 2011

    I was able to get this working by using the setUsername and setPassword methods. Not sure why the regular authentication didn't work though.