.net - Error calling web service 401: Unauthorized -


i get

the request failed http status 401: unauthorized

my web service .net 4 running on iis6. client .net 2 running on iis6

when run both client , serivce on local host works. when move service web server above error. have set allow an

i have tried every combination of anonymous access & integrated windows authentication within iis can access web service via brower , call using web service studio ok, not work when call .net service

update

i have checked iusr account has ntfs file permissions , added in local security policy user can access server on network.

when call webservice studio makes 2 request first called gets 401, calls again passing 'authorization' , works. see below. reason anonymous access not working. when have anonymous access ticked , integrated windows authentication unticked cannot access brower

content-type: text/xml; charset=utf-8 soapaction: "http://tempuri.org/helloworld" host: webdev1 content-length: 314 expect: 100-continue connection: keep-alive  <?xml version="1.0" encoding="utf-8"?><soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"><soap:body><helloworld xmlns="http://tempuri.org/"><echo>sd</echo></helloworld></soap:body></soap:envelope>  http/1.1 401 unauthorized content-length: 1539 content-type: text/html server: microsoft-iis/6.0 www-authenticate: negotiate www-authenticate: ntlm date: thu, 28 jun 2012 12:26:33 gmt proxy-support: session-based-authentication 

call 2 (happens automatically)

post http://webdev1/cshrservice/cshr.asmx http/1.1 content-type: text/xml; charset=utf-8 soapaction: "http://tempuri.org/helloworld" authorization: negotiate yiilzqygkwybbqucoiilwtccc72gjdaib/eg1wyqalj3e67ga0...... host: webdev1 content-length: 314 expect: 100-continue  <?xml version="1.0" encoding="utf-8"?><soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"><soap:body><helloworld xmlns="http://tempuri.org/"><echo>sd</echo></helloworld></soap:body></soap:envelope> http/1.1 200 ok date: thu, 28 jun 2012 12:26:34 gmt server: microsoft-iis/6.0 www-authenticate: negotiate oyggmigdoamkaqchcwyjkozigvcsaqicoogibi.. x-aspnet-version: 4.0.30319 cache-control: private, max-age=0 content-type: text/xml; charset=utf-8 content-length: 360 

my code calls service just

  cshrservice cshrservice = new cshrservice();   string s = cshrservice.helloworld("d"); 

my problem iusr account password wrong changed password or create new account run app pool , fixed it.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -