You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by mxc <ma...@jumpingbean.co.za> on 2015/08/30 21:52:13 UTC

Web Service Discovery - Some questions

Hi there,

I am new to SOAP web services and I am using the WSDiscoveryClient object to
search for available web services on the network. I have two questions:

1) There is a version 1.0 and a version 1.1 for web service discovery. If I
query a service that supports 1.0 with the client set to 1.1 I get an
exception. So this means there is no backwards compatibility? I have read
articles how to version control your own web services but is there no
general approach for version control of the standard behind them? This seems
like a major oversight to me. What is the general approach here. Do you just
run the query twice one for each version? In general what happens if the web
services returned support different version of SOAP? Do you have to manage
this all yourself? This could get quiet unmanageable.

2) I can get a port object with the following: (Using the returned reference
as a parameter to getPort on the service object

        try (WSDiscoveryClient client = new
WSDiscoveryClient("soap.udp://192.168.1.64:3702")) {
            List<EndpointReference> references;
            client.setVersion10();
            references = client.probe();
            //client.close();
            DeviceService service = new DeviceService();
            for (EndpointReference ref : references) {
                System.out.println(ref.toString());
                Device dev = service.getPort(ref,Device.class);
                System.out.println(dev.getHostname());
            }
        }
    }

But if I get a EndPointReference and call getPort on that instead I get a
version error:

            Device dev = references.get(0).getPort(Device.class); // instead
of service.getPort(ref,Device.class);

The error is "Exception in thread "main"
javax.xml.ws.soap.SOAPFaultException: A SOAP 1.2 message is not valid when
sent to a SOAP 1.1 only endpoint."

Why is this? The auto-generated classes used are the same in both cases.
Must I force the SOAP version number to be 1.2? If so how do I do this
programmatically?  The references I could find suggested using a
WebServiceFeature but I couldn't find any additional info on this.


Thanks for the help. (Is it just me or is this whole SOAP thing a bit of a
mess?) -> Setting myself up here I think :)





--
View this message in context: http://cxf.547215.n5.nabble.com/Web-Service-Discovery-Some-questions-tp5760589.html
Sent from the cxf-user mailing list archive at Nabble.com.