0

I have created a wbservice. In the webservice I have created a method to send an acknowledgement. For sending the acknowledgement I have provided the link of the url in my web.config file as below:-

<applicationSettings>
 <ABCD.Properties.Settings>
 <setting name="Servicename"
serializeAs="String">
  <value>http://10.237.1.1/X/Y/Z</value>
 </setting>
  </ABCD.Properties.Settings>
  </applicationSettings>
</configuration>

But when I am running my webservice then I am getting the error as:- The request failed with HTTP status 401: Unauthorized. Is it that I have to provide the username and password while sending the acknowledgement. If yes then please tell me how is it possible?

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • What type of Web Service you created? What is Web Service configuration? – marisks Oct 18 '12 at 07:55
  • The webservice is developed in .Net4.0 configuration – Rahul Tripathi Oct 18 '12 at 08:01
  • I meant if it is WCF service, Web API service or ASMX service? And what configuration is in your Web.config/App.config of Web Service? – marisks Oct 18 '12 at 08:21
  • It is a WCF webservice. And the target framework is 4.0 in the Web.Config. I am not getting exactly what you want in the Web.config? – Rahul Tripathi Oct 18 '12 at 08:57
  • See here: http://stackoverflow.com/questions/105499/how-to-set-proxy-with-credentials-to-generated-wcf-client – nick_w Oct 18 '12 at 09:09
  • You have to read about how to configure WCF services first: http://msdn.microsoft.com/en-us/library/ms733932.aspx and then how to configure WCF clients: http://msdn.microsoft.com/en-us/library/ms735103.aspx – marisks Oct 18 '12 at 09:30

1 Answers1

0

if the service is hosted in IIS, you may have set authentication on, if so, you'll need to have your client send credentials depending on your authentication type. if you didn't intend to set authentication up, set it to allow anonymous access

EdmundYeung99
  • 2,461
  • 4
  • 27
  • 43