Search in sources :

Example 26 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class HelloLiteralTest method xxtestMSReadFrom.

public void xxtestMSReadFrom() {
    Source mssrc = makeStreamSource(msEprString);
    EndpointReference result = EndpointReference.readFrom(mssrc);
    assertTrue(result != null);
    assertTrue(result instanceof MemberSubmissionEndpointReference);
// result.writeTo(new StreamResult(System.out));
}
Also used : MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference)

Example 27 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class HelloLiteralTest method testGetMSEPRFromClass.

// functionality needs to be clarrified
public void testGetMSEPRFromClass() {
    EndpointReference epr = ((BindingProvider) stub).getEndpointReference(MemberSubmissionEndpointReference.class);
    assertTrue(epr != null);
    assertTrue(epr instanceof MemberSubmissionEndpointReference);
}
Also used : MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference) W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference)

Example 28 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class ClientEprTest method msEprGettertest.

private void msEprGettertest(BindingProvider bp, boolean hasWSDL) throws Exception {
    Service service = Service.create(serviceName);
    service.addPort(portName, jakarta.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    // validate ms epr
    MemberSubmissionEndpointReference msEpr = bp.getEndpointReference(MemberSubmissionEndpointReference.class);
    // printEPR(msEpr);
    assertTrue(EprUtil.validateEPR(msEpr, endpointAddress, serviceName, portName, portTypeName, hasWSDL));
    W3CEndpointReference w3cEpr = bp.getEndpointReference(W3CEndpointReference.class);
    // printEPR(w3cEpr);
    // assertTrue(EprUtil.validateEPR(w3cEpr,endpointAddress, serviceName, portName, portTypeName, hasWSDL));
    assertTrue(EprUtil.validateEPR(w3cEpr, endpointAddress, null, null, null, false));
}
Also used : W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference)

Example 29 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EprMarshalUnmarshalTest method testMSEprMarshalling.

public void testMSEprMarshalling() throws JAXBException {
    HelloService service = new HelloService();
    BindingProvider bp = (BindingProvider) service.getHelloPort();
    // validate w3c epr
    W3CEndpointReference w3cEpr = (W3CEndpointReference) bp.getEndpointReference();
    w3cEpr.writeTo(new StreamResult(System.out));
    // assertTrue(EprUtil.validateEPR(w3cEpr, endpointAddress, serviceName, portName, portTypeName, true));
    assertTrue(EprUtil.validateEPR(w3cEpr, endpointAddress, null, null, null, false));
    Marshaller m = jaxbCtx.createMarshaller();
    DOMResult w3cResult = new DOMResult();
    m.marshal(w3cEpr, w3cResult);
    // assertTrue(EprUtil.validateEPR(w3cResult.getNode(), W3CEndpointReference.class, endpointAddress, serviceName, portName, portTypeName, true));
    assertTrue(EprUtil.validateEPR(w3cResult.getNode(), W3CEndpointReference.class, endpointAddress, null, null, null, false));
    // validate ms epr
    MemberSubmissionEndpointReference msEpr = bp.getEndpointReference(MemberSubmissionEndpointReference.class);
    w3cEpr.writeTo(new StreamResult(System.out));
    assertTrue(EprUtil.validateEPR(msEpr, endpointAddress, serviceName, portName, portTypeName, false));
    DOMResult msResult = new DOMResult();
    m.marshal(msEpr, msResult);
    assertTrue(EprUtil.validateEPR(msResult.getNode(), MemberSubmissionEndpointReference.class, endpointAddress, serviceName, portName, portTypeName, true));
}
Also used : Marshaller(jakarta.xml.bind.Marshaller) DOMResult(javax.xml.transform.dom.DOMResult) StreamResult(javax.xml.transform.stream.StreamResult) W3CEndpointReference(jakarta.xml.ws.wsaddressing.W3CEndpointReference) BindingProvider(jakarta.xml.ws.BindingProvider) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference)

Example 30 with MemberSubmissionEndpointReference

use of com.sun.xml.ws.developer.MemberSubmissionEndpointReference in project metro-jax-ws by eclipse-ee4j.

the class EndpointEPRTest method testMSEPR.

public void testMSEPR() throws Exception {
    int port = PortAllocator.getFreePort();
    String address = "http://localhost:" + port + "/hello";
    Endpoint endpoint = Endpoint.create(new RpcLitEndpoint());
    List<Source> metadata = new ArrayList<Source>();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    String[] docs = { "RpcLitEndpoint.wsdl", "RpcLitAbstract.wsdl", "RpcLitEndpoint.xsd" };
    for (String doc : docs) {
        URL url = cl.getResource(doc);
        metadata.add(new StreamSource(url.openStream(), url.toExternalForm()));
    }
    endpoint.setMetadata(metadata);
    endpoint.publish(address);
    MemberSubmissionEndpointReference epr = endpoint.getEndpointReference(MemberSubmissionEndpointReference.class);
    endpoint.stop();
    EprUtil.validateEPR(epr, address, serviceName, portName, portTypeName, Boolean.TRUE);
    printEPR(epr);
}
Also used : Endpoint(jakarta.xml.ws.Endpoint) StreamSource(javax.xml.transform.stream.StreamSource) ArrayList(java.util.ArrayList) MemberSubmissionEndpointReference(com.sun.xml.ws.developer.MemberSubmissionEndpointReference) Endpoint(jakarta.xml.ws.Endpoint) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) URL(java.net.URL)

Aggregations

MemberSubmissionEndpointReference (com.sun.xml.ws.developer.MemberSubmissionEndpointReference)31 W3CEndpointReference (jakarta.xml.ws.wsaddressing.W3CEndpointReference)13 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)8 Element (org.w3c.dom.Element)7 Endpoint (jakarta.xml.ws.Endpoint)6 EndpointReference (jakarta.xml.ws.EndpointReference)6 W3CEndpointReferenceBuilder (jakarta.xml.ws.wsaddressing.W3CEndpointReferenceBuilder)6 URL (java.net.URL)6 ArrayList (java.util.ArrayList)6 DocumentBuilder (javax.xml.parsers.DocumentBuilder)6 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)6 Source (javax.xml.transform.Source)6 Document (org.w3c.dom.Document)6 StreamSource (javax.xml.transform.stream.StreamSource)5 JAXBElement (jakarta.xml.bind.JAXBElement)4 HashMap (java.util.HashMap)3 QName (javax.xml.namespace.QName)3 DOMResult (javax.xml.transform.dom.DOMResult)3 MemberSubmissionAddressingFeature (com.sun.xml.ws.developer.MemberSubmissionAddressingFeature)2 JAXBContext (jakarta.xml.bind.JAXBContext)2