Java and. NET Web Services based on WS-Security Integration Implementation (I)

Source: Internet
Author: User
Tags soap
Java and. NET Web Services based on WS-Security Integration Implementation
Rottenapple
Readers of this article:
Web Services developers
Knowledge:
After VS. NET2003 + WSE is used to develop Web Services, Jbuilder9 is used to develop simple java applications.

I. Content overview
WS-Security Description enhances the quality of SOAP message transmission through message integrity, message confidentiality, and individual message authentication. Applicable to the following scenarios:
1. The customer must be able to determine the sender of the message and verify that the sender is the sender claimed by the sender.
2. The customer must be able to confirm that the transmitted data has not been tampered.
This article describes how to implement integrated calls between Java client programs based on the WS-Security protocol and. net web services.
II. Platforms and tools
Operating system: win2000 server
Software: VS. NET2003 + WSE1.0 sp1
Jbuilder9
Axis-wsse-1.0 (ws-security implemented by axis)
III. Implementation
1. Open VS. NET2003 and create an ASP. Net Web Services project. Add a Web Services page named SumService. Its core code is as follows:
[SoapRpcMethod (Action = "http://www.contoso.com/Rpc", RequestNamespace = "http://www.contoso.com/SU", ResponseNamespace = "http://www.contoso.com/SU")]
[WebMethod]
Public int IntAdd (int a, int B)
{
SoapContext requestContext = HttpSoapContext. RequestContext;
If (requestContext = null)
Throw new ApplicationException ("Only SOAP requests are permitted .");
Return a + B;
}
2. Use WSE Setting Tool to set the WSE function for Asp Web Services, and add a PasswordProvider in the "Security" option bar to implement WS-Security authentication. At the same time, the trace function is selected to track the SOAP information received by the Web Services request and the returned SOAP information.

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.