CXF WS-Discovery Client
CXF WS-Discovery Client explains step by step details of discovering a JAX-WS service using CXF WS-Discovery feature
For Creating Apache CXF WS-Discovery Client, We are using org.apache.cxf.ws.discovery.WSDiscoveryClient. WSDiscoveryClient is an in built CXF class
Which helps us to search the services on the network and invoke the operation on that available service.
Required Libraries
You need to download following libraries in order to Generate CXF WS-Discovery Client
- JDK 6
- Eclipse 3.7
- CXF-2.7.12
- Tomcat 7 (Deploying Web Service)
Following jar must be in classpath
- commons-collections-3.2.1.jar
- commons-lang-2.6.jar
- cxf-2.7.12.jar
- cxf-services-ws-discovery-api-2.7.12.jar
- jaxb-impl-2.2.6.jar
- jaxb-xjc-2.2.6.jar
- mina-core-2.0.7.jar
- neethi-3.0.3.jar
- slf4j-api-1.7.7.jar
- slf4j-jdk14-1.7.7.jar
- stax2-api-3.1.4.jar
- velocity-1.7.jar
- woodstox-core-asl-4.4.0.jar
- wsdl4j-1.6.3.jar
- xml-resolver-1.2.jar
- xmlschema-core-2.1.0.jar
CXF WS-Discovery Client
package com.student;
import java.util.List;
import javax.xml.ws.EndpointReference;
import org.apache.cxf.ws.discovery.WSDiscoveryClient;
public final class WSDiscovery_Client {
public static void main(String[] args) throws Exception {
//Use WS-Discovery to find references to services that implement the changeName portType
WSDiscoveryClient client = new WSDiscoveryClient();
// Setting timeout for WS-Discovery
client.setDefaultProbeTimeout(1000);
// Use WS-discovery 1.0
// client.setVersion10();
System.out.println("Probe:" + client.getAddress());
List<EndpointReference> references = client.probe();
client.close();
ChangeStudentDetailsImplService service = new ChangeStudentDetailsImplService();
Student student = new Student();
student.setName("Rockey");
// loop through all of them and have them & invoke changeName method.
for (EndpointReference ref : references) {
ChangeStudentDetails details = service.getPort(ref, ChangeStudentDetails.class);
Student changeName = details.changeName(student);
System.out.println("Server said: " + changeName.getName());
}
}
}
import java.util.List;
import javax.xml.ws.EndpointReference;
import org.apache.cxf.ws.discovery.WSDiscoveryClient;
public final class WSDiscovery_Client {
public static void main(String[] args) throws Exception {
//Use WS-Discovery to find references to services that implement the changeName portType
WSDiscoveryClient client = new WSDiscoveryClient();
// Setting timeout for WS-Discovery
client.setDefaultProbeTimeout(1000);
// Use WS-discovery 1.0
// client.setVersion10();
System.out.println("Probe:" + client.getAddress());
List<EndpointReference> references = client.probe();
client.close();
ChangeStudentDetailsImplService service = new ChangeStudentDetailsImplService();
Student student = new Student();
student.setName("Rockey");
// loop through all of them and have them & invoke changeName method.
for (EndpointReference ref : references) {
ChangeStudentDetails details = service.getPort(ref, ChangeStudentDetails.class);
Student changeName = details.changeName(student);
System.out.println("Server said: " + changeName.getName());
}
}
}
Output
Probe:soap.udp://239.255.255.250:3702
Oct 16, 2014 8:10:23 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy from class org.apache.cxf.jaxws.support.DummyImpl
Oct 16, 2014 8:10:24 AM com.student.ChangeStudentDetailsImplService
INFO: Can not initialize the default wsdl from ChangeStudent.wsdl
Oct 16, 2014 8:10:24 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://student.com/}ChangeStudentDetailsImplService from class com.student.ChangeStudentDetails
Oct 16, 2014 8:10:25 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://student.com/}ChangeStudentDetailsImplService from class com.student.ChangeStudentDetails
Server said: Hello Rockey
hi... i tried the example...... but.... probe() returning null... the error is WARNING: Interceptor for {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy#{http://cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:882) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:703) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:160) at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:193) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:780) at org.apache.cxf.transport.udp.UDPConduit.dataReceived(UDPConduit.java:116) at org.apache.cxf.transport.udp.UDPConduit.access$000(UDPConduit.java:63) at org.apache.cxf.transport.udp.UDPConduit$UDPBroadcastOutputStream.close(UDPConduit.java:309) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.udp.UDPConduit.close(UDPConduit.java:137) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:416) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:394) at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:387) at org.apache.cxf.jaxws.DispatchImpl.invokeAsync(DispatchImpl.java:432) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:378) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:327) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:320) at com.client.WSDiscovery_Client.main(WSDiscovery_Client.java:27) Caused by: javax.xml.bind.UnmarshalException - with linked exception: [com.sun.istack.SAXParseException2; lineNumber: 8; columnNumber: 11; unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs>] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:483) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:417) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:386) at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:843) at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102) at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:871) at java.security.AccessController.doPrivileged(Native Method) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:869) ... 21 more Caused by: com.sun.istack.SAXParseException2; lineNumber: 8; columnNumber: 11; unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1063) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415) ... 27 more Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> ... 37 more Mar 07, 2016 11:21:19 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}DiscoveryProxy#{http://cxf.apache.org/jaxws/dispatch}Invoke has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:882) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:703) at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:160) at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:193) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:780) at org.apache.cxf.transport.udp.UDPConduit.dataReceived(UDPConduit.java:116) at org.apache.cxf.transport.udp.UDPConduit.access$000(UDPConduit.java:63) at org.apache.cxf.transport.udp.UDPConduit$UDPBroadcastOutputStream.close(UDPConduit.java:309) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.udp.UDPConduit.close(UDPConduit.java:137) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:416) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:394) at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:387) at org.apache.cxf.jaxws.DispatchImpl.invokeAsync(DispatchImpl.java:432) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:378) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:327) at org.apache.cxf.ws.discovery.WSDiscoveryClient.probe(WSDiscoveryClient.java:320) at com.client.WSDiscovery_Client.main(WSDiscovery_Client.java:27) Caused by: javax.xml.bind.UnmarshalException - with linked exception: [com.sun.istack.SAXParseException2; lineNumber: 8; columnNumber: 11; unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs>] at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:483) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:417) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:386) at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:843) at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102) at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:871) at java.security.AccessController.doPrivileged(Native Method) at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:869) ... 21 more Caused by: com.sun.istack.SAXParseException2; lineNumber: 8; columnNumber: 11; unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1063) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:246) at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:180) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415) ... 27 more Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://schemas.xmlsoap.org/ws/2005/04/discovery", local:"ProbeMatches"). Expected elements are <{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}AppSequence>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Bye>,<{http://www.w3.org/2005/08/addressing}EndpointReference>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Hello>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}MetadataVersion>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Probe>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ProbeMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Resolve>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}ResolveMatches>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Scopes>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Security>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Sig>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}SupportedMatchingRules>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}Types>,<{http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01}XAddrs> ... 37 more