Search in sources :

Example 36 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().getResourceAsStream("newAddress.epr.xml"))), true);
}
Also used : InputStreamReader(java.io.InputStreamReader) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference)

Example 37 with WSEndpointReference

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

the class EPRWithNSDeclarationsTest method test1.

public void test1() throws Exception {
    URL fileurl = getResource("hello_literal_identity1.wsdl");
    WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
    WSDLService service = doc.getService(new QName("urn:test", "Hello"));
    WSDLPort port = service.getFirstPort();
    WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
    QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
    WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
    XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
    if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
        xsr.next();
    assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
    assertEquals(q.getLocalPart(), xsr.getLocalName());
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) URL(java.net.URL)

Example 38 with WSEndpointReference

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

the class EPRWithNSDeclarationsTest method test3.

public void test3() throws Exception {
    URL fileurl = getResource("hello_literal_identity3.wsdl");
    WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
    WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
    WSDLPort port = service.getFirstPort();
    WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
    QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
    WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
    XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
    if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
        xsr.next();
    assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
    assertEquals(q.getLocalPart(), xsr.getLocalName());
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) URL(java.net.URL)

Example 39 with WSEndpointReference

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

the class EPRWithNSDeclarationsTest method test2.

public void test2() throws Exception {
    URL fileurl = getResource("hello_literal_identity2.wsdl");
    WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
    WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
    WSDLPort port = service.getFirstPort();
    WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
    QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
    WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
    XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
    if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
        xsr.next();
    assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
    assertEquals(q.getLocalPart(), xsr.getLocalName());
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) URL(java.net.URL)

Example 40 with WSEndpointReference

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

the class EPRWriteNReadTest method test2.

public void test2() throws Exception {
    URL fileurl = getResource("hello_literal_identity2.wsdl");
    WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
    WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
    WSDLPort port = service.getFirstPort();
    WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
    verifyEPR(wsepr);
}
Also used : QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) URL(java.net.URL)

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