Search in sources :

Example 71 with WSEndpointReference

use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EprExtensionsContributorTest method testEprOnServerSide.

/**
 * Tests server-side access to EPR extensions specified in WSDL
 *
 * @throws Exception
 */
public void testEprOnServerSide() throws Exception {
    HelloService service = new HelloService();
    Hello hello = service.getHelloPort();
    W3CEndpointReference serverEpr = hello.getW3CEPR();
    // printEPR(serverEpr);
    WSEndpointReference wsepr = new WSEndpointReference(serverEpr);
    assertTrue(wsepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
Also used : W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference)

Example 72 with WSEndpointReference

use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EprExtensionsContributorTest method testEprWithDispatchWithWSDL.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 *
 * @throws Exception
 */
public void testEprWithDispatchWithWSDL() throws Exception {
    Service service = new HelloService();
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Example 73 with WSEndpointReference

use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EprExtensionsContributorTest method testEprInPublishedWSDL.

/**
 * Tests the published wsdl for EPR extensions
 * @throws Exception
 */
public void testEprInPublishedWSDL() throws Exception {
    HelloService service = new HelloService();
    Hello hello = service.getHelloPort();
    WSDLPort wsdlModel = ((WSBindingProvider) hello).getPortInfo().getPort();
    WSEndpointReference wsdlepr = wsdlModel.getExtension(WSEndpointReference.class);
    assertTrue(wsdlepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsdlepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort)

Example 74 with WSEndpointReference

use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class WSEndpointReferenceTest method testReplace.

public void testReplace() throws Exception {
    WSEndpointReference n = createEPR().createWithAddress("newAddress");
    System.out.println(n);
    assertEquals("newAddress", n.getAddress());
    XMLAssert.assertXMLIdentical(compareXML(n.toString(), new InputStreamReader(getClass().getClassLoader().getResourceAsStream("newAddress.epr.xml"))), true);
}
Also used : InputStreamReader(java.io.InputStreamReader) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference)

Example 75 with WSEndpointReference

use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class WSEndpointReferenceTest method testCreateViaSpec.

public void testCreateViaSpec() throws Exception {
    W3CEndpointReference spec = new W3CEndpointReference(new StreamSource(getClass().getClassLoader().getResource("test-epr.xml").toExternalForm()));
    new WSEndpointReference(spec, W3C);
}
Also used : W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) StreamSource(javax.xml.transform.stream.StreamSource) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference)

Aggregations

WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)80 QName (javax.xml.namespace.QName)32 Element (org.w3c.dom.Element)17 URL (java.net.URL)16 StreamSource (javax.xml.transform.stream.StreamSource)16 EndpointReference (jakarta.xml.ws.EndpointReference)13 WSBindingProvider (com.sun.xml.ws.developer.WSBindingProvider)11 SAAJMessage (com.sun.xml.ws.message.saaj.SAAJMessage)11 SOAPMessage (jakarta.xml.soap.SOAPMessage)11 Packet (com.sun.xml.ws.api.message.Packet)10 XMLStreamReader (javax.xml.stream.XMLStreamReader)10 Message (com.sun.xml.ws.api.message.Message)9 WebServiceException (jakarta.xml.ws.WebServiceException)9 MemberSubmissionEndpointReference (com.sun.xml.ws.developer.MemberSubmissionEndpointReference)8 ByteArrayInputStream (java.io.ByteArrayInputStream)8 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)6 MessageFactory (jakarta.xml.soap.MessageFactory)6 MimeHeaders (jakarta.xml.soap.MimeHeaders)6 Service (jakarta.xml.ws.Service)6 W3CEndpointReference (jakarta.xml.ws.wsaddressing.W3CEndpointReference)6