简体   繁体   中英

WCF service doesn't connect after publishing

I receive a HTTP 400 Bad Request from the server, using Fiddler2 I can see that the reason is

The server encountered an error processing the request. The exception message is 'Access is denied.'. See server logs for more details. The exception stack trace is at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)

I never got this when I was testing locally. Is there maybe an IIS setting that was missed or something?

When I connect to the svc file with a browser it seems ok, it's only when I try and use the POST method from my test client.

I made sure to change the and the baseAddress to match the server also.

Is there a way to remote debug a web service? I've done windows services before.

Update: I got it to work, after figuring out how to remote debug it was just an exception causing the web service to crash which sent back the 400 error. I'll include steps on how to remote debug a web service.

  1. run msvsmon.exe on the server
  2. In visual studio use menus Debug -> Attach To Process...
  3. Connect to the server and find w3wp.exe (it may not be there, if not, access the web service to start a session)
  4. Hit the web service from a client and it should work.

For further info

It was due to internal errors in the service. No communications problems. Remote debugging helped me fix the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM