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

401 Unauthorized error when calling a webservice

New Here ,
Mar 20, 2015 Mar 20, 2015

Copy link to clipboard

Copied

Have ColdFusion 11 installed, I have created a hello web service and I am trying to call it.  Each time I try to call the web service I get an error 401 Unauthorized.  I am not sure if I need to configure something more on the ColdFusion server, IIS or something else.

<cfcomponent displayname="Hello">

<cffunction name="helloWorld" returntype="string" access="remote">

     <cfreturn "Hello World!">

    </cffunction>

</cfcomponent>

<cfinvoke
  webservice="http://MyServer/Hello.cfc?wsdl"
  method="helloWorld"
  returnvariable="ws" refreshwsdl="yes">
</cfinvoke>

<cfdump var="#ws#">

TOPICS
Advanced techniques

Views

1.8K

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
Community Expert ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

can you open the URL in the browser?

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 ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

Yes I can browse to the CFC and browse to the wsdl.  I have no issues opening other files in this folder so it does not appear to be a permission issue to the folder.

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
Community Expert ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

LATEST

It appears that you have inadvertently enforced HTTP authentication. If so, you will have to include the attributes, username="your_username" and password="your_password" in the cfinvoke tag.

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