assertTrue(e.getFault().getFaultCode().contains("OnlyNonAnonymousAddressSupported"));
}
}
@Test
public void testNonAnonToAnon() throws Exception {
AddNumbersPortType port = getPort();
((BindingProvider)port).getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
"http://localhost:" + PORT + "/jaxws/addAnon");
AddressingPropertiesImpl maps = new AddressingPropertiesImpl();
EndpointReferenceType ref = new EndpointReferenceType();
AttributedURIType add = new AttributedURIType();
add.setValue("http://localhost:" + INVALID_PORT + "/not/a/real/url");
ref.setAddress(add);
maps.setReplyTo(ref);
maps.setFaultTo(ref);
((BindingProvider)port).getRequestContext()
.put("javax.xml.ws.addressing.context", maps);
try {
port.addNumbers3(-1, 2);
} catch (SOAPFaultException e) {
assertTrue(e.getFault().getFaultCode().contains("OnlyAnonymousAddressSupported"));
}
}