Wcf receives an unhandled request from an operation

I searched a lot for a good answer, but received a lot of answers that did not satisfy me.

We have a service with ordinary operations. Inside each operation, we call another project to process the te operation and store some information about the operation inside the database.

We have a new requirement: also store the message about the operation cape in the database. Is it possible to get soap (xml) from a wcf operation? Or do you really need an event?

+4
source share
2 answers

For myself, I found this solution for receiving an unprocessed soap message in the 4.5 framework:

OperationContext.Current.RequestContext.RequestMessage.ToString()

Read all the comments above for more details on the alternatives and their concerns.

+3

OperationContext.Current.RequestContext.RequestMessage.ToString(), Xml. JSON, , . , Request.InputStream --- <add key="wcf:serviceHostingEnvironment:useClassicReadEntityBodyMode" value="true" /> web.config(FYI: .Net 4.5.2).

, , Application_BeginRequest Global.asax.cs. Request.InputStream Context.Items. , IErrorHandler ProvideFault(...), Exception Data, , HandleError(...) (Items HandleError ).

+2

All Articles