Search in sources :

Example 1 with GreeterService

use of org.apache.cxf.hello_world.discovery.GreeterService in project cxf by apache.

the class Client method main.

public static void main(String[] args) throws Exception {
    // Use WS-Discovery to find references to services that implement the Greeter portType
    WSDiscoveryClient client = new WSDiscoveryClient();
    List<EndpointReference> references = client.probe(new QName("http://cxf.apache.org/hello_world/discovery", "Greeter"));
    client.close();
    GreeterService service = new GreeterService();
    // loop through all of them and have them greet me.
    for (EndpointReference ref : references) {
        Greeter g = service.getPort(ref, Greeter.class);
        System.out.println(g.greetMe("World"));
    }
}
Also used : QName(javax.xml.namespace.QName) Greeter(org.apache.cxf.hello_world.discovery.Greeter) WSDiscoveryClient(org.apache.cxf.ws.discovery.WSDiscoveryClient) GreeterService(org.apache.cxf.hello_world.discovery.GreeterService) EndpointReference(javax.xml.ws.EndpointReference)

Aggregations

QName (javax.xml.namespace.QName)1 EndpointReference (javax.xml.ws.EndpointReference)1 Greeter (org.apache.cxf.hello_world.discovery.Greeter)1 GreeterService (org.apache.cxf.hello_world.discovery.GreeterService)1 WSDiscoveryClient (org.apache.cxf.ws.discovery.WSDiscoveryClient)1