Extended Wcf call security service, manually added Soap Security Head., wcfsoap

Source: Internet
Author: User

Extended Wcf call security service, manually added Soap Security Head., wcfsoap

Once we have a project that needs to Call a Java web service, and the Soap package needs a Security Head.

However, the UserName added by. net's default Credentials does not conform to this format.

Therefore, errors are always reported.

System. Web. Services. Protocols. SoapHeaderException: An error was

Discovered processing the <wsse: Security> header

 

If you have no choice, you only need to use the power to manually add the WSSE head to the Soap package.

The following is Behavior.

Note that 13 lines of red code are equivalent to the Provider mode.

The following is the part written into the Head.

This is a success!

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.