简体   繁体   中英

Apply service behavior to Service Reference

I have added to my web application a Service Reference to a .svc web service on a remote server. When I call a method from this webservice i get the following error.

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server

First question: IncludeExceptionDetailinFaults must be turned on my server or on the remote server that the .svc service is hosted?

Second question: If IncludeExceptionDetailinFaults must be turned on, on my server how can I configure the web.config file properly to apply the behavior for the Service Reference I have added. This post describes the way to apply it to a service in the web.config but in my web.config there are no services defined since I added a Service Reference from the solution explorer. (Only bindings and client are automatically defined under serviceModel node) Another thing to note is that when i run the application locally on my laptop in visual studio debugging I don't get the error. But when I publish the solution to my server I get the above error.

The property must be set on the hosting server, as it's the server that determines whether to include exception details, not the client. The question you linked to shows how to do that.

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