uCosminexus Application Server, Web Service Development Guide
Create an Implementation Class for Web Service client that uses the Web Services.
The following is an example for creating a Web Service client that invokes Web Services once:
package com.example.sample.client;
import com.example.sample.TestJaxWs;
import com.example.sample.TestJaxWsService;
import com.example.sample.UserDefinedException;
public class TestClient {
public static void main( String[] args ) {
try {
TestJaxWsService service = new TestJaxWsService();
TestJaxWs port = service.getTestJaxWs();
String returnValue = port.jaxWsTest1( "Invocation test.", 1003 );
System.out.println( "[RESULT] " + returnValue );
}
catch( UserDefinedException e ){
e.printStackTrace();
}
}
}
|
The created TestClient.java is stored in the c:\temp\jaxws\works\wsrm\client\src\com\example\sample\client\ directory in the UTF-8 format. Note that com.example.sample, TestJaxWs, TestJaxWsService, TestJaxWs, and jaxWsTest1 change according to the package name, the class name, and the 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, the class name, and the method name in the class.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.