uCosminexus Application Server, Web Service Development Guide
Create an Implementation Class for the Web Service client that uses Web Services.
The following is an example of creating Web Service clients that invoke Web Services once:
package com.sample.client;
import com.sample.AddNumbersImpl;
import com.sample.AddNumbersImplService;
import com.sample.AddNumbersFault_Exception;
public class TestClient {
public static void main( String[] args ) {
try {
AddNumbersImplService service = new AddNumbersImplService();
AddNumbersImpl port = service.getAddNumbersImplPort();
int returnValue = port.add( 205, 103 );
System.out.println( "[RESULT] " + returnValue );
}
catch( AddNumbersFault_Exception e ){
e.printStackTrace();
}
}
}
|
Save the created TestClient.java in the c:\temp\jaxws\works\statelessjava\client\src\com\sample\client\ directory in UTF-8 format.
Note that com.sample, AddNumbersImpl, AddNumbersImplService, AddNumbersImplPort, and add change according to the package name, class name, and method name in the class of the generated Java sources. When you want to develop a Web Service with a different configuration, you must review, and if necessary revise, the coding of the package name, class name, and the method name in the class.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.