简体   繁体   中英

Error calling a class library from a wcf service

I have an MVC project where I am using a WCF service as a pass through to methods in a class library. I put a query in the service and called the service from my project and the query worked fine and returned the result. I have changed my code to point directly at the class library and the method runs great and returns what I expect. When I call the web service which just has a call to the class library and returns the result, it breaks. The error I get in the code is:

An error occurred while receiving the HTTP response to 'url'. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

While researching this I found several people said this is a generic 'It broke' error and to enable tracing. When I turn on tracing I only see one error message:

Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched.

I don't define any bindings in my .config files. I had this set up working but changes were made to the class library to make it more object oriented. I have resolved all of the errors stemming from that change but I can't figure this error out. I have tried several of the fixes I found by googling this error but none of them have been successful. Does anyone have any suggestions on what else I can try?

Edit:

Looking at the config of my project a binding was setup when I set the web service reference. It is using basichttp binding. I am guessing now that I can talk to the part separately since the first binding is defined and the second is auto detect. I am thinking my issue is when the 2 auto detect parts talk to each other. Trying to figure something along that angle.

My manager was the one that changed my class library. She changed all of the id's that I had on my objects to objects. So a reservation instead of having a event id had an event object. In doing this she created a series of loops where an event has a room object which has an event object. Or a person has an address object which has a person object. So the errors I was getting above really were generic "it broke" messages.

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