uCosminexus Application Server, Web Service Development Guide
Create an implementation class for the Web Service client that uses the Web Service.
The following is an example of creating a Web Service client that invokes the Web Service once:
package org.example.sample.client;
import org.example.sample.TestJaxWs;
import org.example.sample.TestJaxWsService;
import org.example.sample.AddNumbersFault_Exception;
public class TestClient {
public static void main( String[] args ) {
try {
|
TestJaxWsService service = new TestJaxWsService();
TestJaxWs port = service.getTestJaxWs();
int returnValue = port.jaxWsTest1( 205, 103 );
System.out.println( "[RESULT] " + returnValue );
}
catch( AddNumbersFault_Exception e ){
e.printStackTrace();
}
}
}
|
The created TestClient.java is stored in the c:\temp\jaxws\works\annotations\client\src\com\example\sample\client\directory in UTF-8 format.
Note that org.example.sample, TestJaxWs, TestJaxWsService, and jaxWsTest1 change according to the package name, class name, and method name in the class of the generated Java source. 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.