Action settings when an error message is returned by WCF

Source: Internet
Author: User

Problem:

When an error message is created and returned to the client, specify action.

You just need to use the passed operationcontext. Current. incomingmessageheaders. Action.

You can perform one test to detect security exceptions. The client cannot receive the correct error information as scheduled.

According to Microsoft's ability to return examples and monitor results normally. The action is [http://www.w3.org/2005/08/addressing/soap/fault ].

Therefore, it is found that the action is set to null or the above monitoring results can be returned normally.

But why can't I receive the Action normally? Later I learned that as long as the namespace is set on the Service property, the normal value can be returned according to the original path.

Example:

[Servicecontract (name = "authservice", namespace = "http://si812cn.cnblogs.com/Gateway")]
Public interface iauthservice

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.