Integration of Java and. NET Web Services Based on WS-Security (II)
Rottenapple
4. Open Jbuilder9 and create a new java class named TestNetService. And add the jar package of the axis-wsse-1.0 to jdk of Jbuilder (Tools-> configions jdks-> class tab-> add) the code is as follows:
Package MyWebServiceJavaClient;
Import java. util. Date;
Import java. text. DateFormat;
Import org. apache. axis. MessageContext;
Import org. apache. axis. message .*;
Import org. apache. axis. client .*;
Import org. apache. axis. utils .*;
Import javax. xml. namespace. QName;
Import java. lang. Integer;
Import javax. xml. rpc. ParameterMode;
Import net. vitale. filippo. axis. handlers. WsseClientHandler;
/**
* <P> Title: </p>
* <P> Description: </p>
* <P> Copyright: Copyright (c) 2004 </p>
* <P> Company: </p>
* @ Author not attributable
* @ Version 1.0
*/
Public class TestNetService {
Static String usernameS = null;
Static String passwordS = null;
Public TestNetService (){
}
Public static void main (String [] args ){
Try {
Integer I = new Integer (2 );
Integer j = new Integer (2 );
String endpoint = "http: // localhost/MyServices/WebServiceTest/SumService. asmx ";
Service service = new Service ();
Call call = (Call) service. createCall ();
Call. setTargetEndpointAddress (new java.net. URL (endpoint ));