Closed GoogleCodeExporter closed 9 years ago
WS-Discovery 1.1 uses WS-Addressing 1.0
(http://www.w3.org/TR/2006/REC-ws-addr-core-
20060509/#eprs). Thus it is no longer possible to set port type and service
name directly through
the endpointreference and the values are silently ignored (this should be
fixed). You can use
service.setPortTypes(), service.setScopes() and service.setXAddrs() instead,
where service is an
instance of WsDiscoveryService.
If you configure the library to use the WS-Discovery draft-version which uses
and older version of
WS-Addressing, your example should work (see
WsDiscoveryConstants.defaultNsDiscovery).
endpointReference.setReferenceParameters() should still be supported, though. I
will investigate
this further and get back to you shortly.
Original comment by mmag...@gmail.com
on 25 Jan 2010 at 12:14
Have you added JAXB annotations to all the objects that you pass as reference
parameters?
You can test the XML-generating code without having to monitor the network.
Here's an example:
---
WsDiscoveryService service1 = WsDiscoveryFactory.createService(
new QName("namespace", "myTestService"), // Port type.
"http://myscope", // Scope.
"http://localhost:1234/myTestService"); // Invocation address (XAddrs)
service1.getEndpointReference().setMetadata(new SOAPOverUDPGenericAnyType());
// this will fail in JAXB:
service1.getEndpointReference().getMetadata().getAny().add("test");
WsDiscoveryS11SOAPMessage m =
WsDiscoveryS11Utilities.createWsdSOAPMessageHello(service1);
System.out.println(m.toString(true, Charset.defaultCharset()));
---
The above example will fail with an exception, though - as the String-object
passed to getAny().add() can't be handled directly by JAXB. If you remove the
two lines that
invoke getEndpointReference() you should see the XML.
Original comment by mmag...@gmail.com
on 25 Jan 2010 at 1:01
Original comment by mmag...@gmail.com
on 3 Feb 2010 at 11:25
Original issue reported on code.google.com by
nasgow...@gmail.com
on 22 Jan 2010 at 8:47