package demo.hw.client;
import java.io.File;
import java.util.concurrent.Future;
import javax.xml.namespace.QName;
import javax.xml.ws.Response;
import org.apache.hello_world_async_soap_http.*;
public final class Client
{
private static final QName SERVICE_NAME
= new QName("http://apache.org/hello_world_async_soap_http",
"SOAPService");
private Client() {}
public static void main(String args[]) throws Exception
{
...
// port is a previously established proxy object.
Response<GreetMeSometimeResponse> resp =
port.greetMeSometimeAsync(System.getProperty("user.name"));
while (!resp.isDone())
{
// client does some work
}
try
{
GreetMeSometimeResponse reply = greetMeSomeTimeResp.get();
// process the response
}
catch (ExecutionException ee)
{
Throwable cause = ee.getCause();
System.out.println("Exception "+cause.getClass().getName()+" thrown by the remote service.");
}
}
}
package demo.hw.client;
import java.io.File;
import java.util.concurrent.Future;
import javax.xml.namespace.QName;
import javax.xml.ws.Response;
import org.apache.hello_world_async_soap_http.*;
public final class Client
{
private static final QName SERVICE_NAME
= new QName("http://apache.org/hello_world_async_soap_http",
"SOAPService");
private Client() {}
public static void main(String args[]) throws Exception
{
...
// port is a previously established proxy object.
Response<GreetMeSometimeResponse> resp =
port.greetMeSometimeAsync(System.getProperty("user.name"));
while (!resp.isDone())
{
// client does some work
}
try
{
GreetMeSometimeResponse reply = greetMeSomeTimeResp.get();
// process the response
}
catch (ExecutionException ee)
{
Throwable cause = ee.getCause();
System.out.println("Exception "+cause.getClass().getName()+" thrown by the remote service.");
}
}
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow