Package javax.xml.ws.wsaddressing

Examples of javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder


        if (getBinding() instanceof HTTPBinding) {       
            throw new UnsupportedOperationException(new Message("GET_ENDPOINTREFERENCE_UNSUPPORTED_BINDING",
                                                                LOG).toString());
        }       
       
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(address);
        builder.serviceName(serviceName);
        builder.endpointName(endpointName);
        if (referenceParameters != null) {
            for (Element referenceParameter : referenceParameters) {
                builder.referenceParameter(referenceParameter);
            }
        }
        builder.wsdlDocumentLocation(wsdlLocation);       
       
        return builder.build();
    }
View Full Code Here


    public EndpointReference getEndpointReference(Element... referenceParameters) {
        WrappedMessageContext ctx = (WrappedMessageContext)getMessageContext();
        org.apache.cxf.message.Message msg = ctx.getWrappedMessage();
        Endpoint ep = msg.getExchange().get(Endpoint.class);

        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(ep.getEndpointInfo().getAddress());
        builder.serviceName(ep.getService().getName());
        builder.endpointName(ep.getEndpointInfo().getName());
        URI wsdlDescription = ep.getEndpointInfo().getProperty("URI", URI.class);
        if (wsdlDescription == null) {
            String address = ep.getEndpointInfo().getAddress();
            try {
                wsdlDescription = new URI(address + "?wsdl");
            } catch (URISyntaxException e) {
                // do nothing
            }
            ep.getEndpointInfo().setProperty("URI", wsdlDescription);
        }
        if (wsdlDescription != null) {
            builder.wsdlDocumentLocation(wsdlDescription.toString());
        }
       
        /*
        if (ep.getEndpointInfo().getService().getDescription() != null) {
            builder.wsdlDocumentLocation(ep.getEndpointInfo().getService()
                                     .getDescription().getBaseURI());
        }
        */
        if (referenceParameters != null) {
            for (Element referenceParameter : referenceParameters) {
                builder.referenceParameter(referenceParameter);
            }
        }
       
        ClassLoaderHolder orig = null;
        try {
            orig = ClassLoaderUtils.setThreadContextClassloader(EndpointReferenceBuilder.class.getClassLoader());
            return builder.build();
        } finally {
            if (orig != null) {
                orig.reset();
            }
        }
View Full Code Here

        TestUtils.testReferenceProperties(response, "BarKey1", "FooBarReply");
    }
   
    public void testReferenceProperties() throws Exception {
        // test request reference properties       
        W3CEndpointReferenceBuilder builder = createERPBuilder();
        Document refParam = TestUtils.createDocument(REF_PARAM);
        builder.referenceParameter(refParam.getDocumentElement());
        EndpointReference epr = builder.build();
       
        Calculator calc = service.getPort(epr, Calculator.class, new AddressingFeature());
        Assert.assertEquals(36, calc.multiply(6, 6));
    }
View Full Code Here

    private void testMultiplyResponse(SOAPMessage message, int sum, boolean mtom) throws Exception {
        TestUtils.testResponse(message, BASE_ACTION + "/multiplyResponse", "multiplyResponse", sum, mtom);
    }
       
    private W3CEndpointReferenceBuilder createERPBuilder() {
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder = builder.address(address);
        builder = builder.serviceName(SERVICE);
        builder = builder.endpointName(PORT);
        return builder;
    }
View Full Code Here

    public EndpointReference getEndpointReference(Element... referenceParameters) {
        org.apache.cxf.message.Message msg = getWrappedMessage();
        Endpoint ep = msg.getExchange().get(Endpoint.class);

        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(ep.getEndpointInfo().getAddress());
        builder.serviceName(ep.getService().getName());
        builder.endpointName(ep.getEndpointInfo().getName());

        if (referenceParameters != null) {
            for (Element referenceParameter : referenceParameters) {
                builder.referenceParameter(referenceParameter);
            }
        }
       
        return builder.build();
    }
View Full Code Here

        }
        setXAddrs(ht, server);
        String uuid = (String)getProperty(server, "ws-discovery-uuid");
        if (uuid != null) {
            //persistent uuid
            W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
            builder.address(uuid);
            ht.setEndpointReference(builder.build());
        }
        ht = client.register(ht);
        registered.add(ht);
        server.getEndpoint().put(HelloType.class.getName(), ht);
    }
View Full Code Here

            throw new UnsupportedOperationException(new org.apache.cxf.common.i18n.Message(
                                                        "GET_ENDPOINTREFERENCE_UNSUPPORTED_BINDING",
                                                        LOG).toString());
        }       
       
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(address);
        builder.serviceName(serviceName);
        builder.endpointName(endpointName);
        if (referenceParameters != null) {
            for (Element referenceParameter : referenceParameters) {
                builder.referenceParameter(referenceParameter);
            }
        }
        builder.wsdlDocumentLocation(wsdlLocation);       
       
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(EndpointReferenceBuilder.class.getClassLoader());
            return builder.build();
        } finally {
            Thread.currentThread().setContextClassLoader(cl);
        }
    }
View Full Code Here

        if (getBinding() instanceof HTTPBinding) {       
            throw new UnsupportedOperationException(new Message("GET_ENDPOINTREFERENCE_UNSUPPORTED_BINDING",
                                                                LOG).toString());
        }       
       
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(address);
        builder.serviceName(serviceName);
        builder.endpointName(endpointName);
        if (referenceParameters != null) {
            for (Element referenceParameter : referenceParameters) {
                builder.referenceParameter(referenceParameter);
            }
        }
        builder.wsdlDocumentLocation(wsdlLocation);       
       
        return builder.build();
    }
View Full Code Here

        }
        ProbeMatchesType pmt = probe(p, defaultProbeTimeout);
        List<EndpointReference> er = new ArrayList<EndpointReference>();
        for (ProbeMatchType pm : pmt.getProbeMatch()) {
            for (String add : pm.getXAddrs()) {
                W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
                builder.address(add);
                //builder.serviceName(type);
                //builder.endpointName(type);
                er.add(builder.build());
            }
        }
        return er;
    }   
View Full Code Here

        return (ProbeMatchesType)o;
    }
   
   
    private W3CEndpointReference generateW3CEndpointReference() {
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.address(ContextUtils.generateUUID());
        return builder.build();
    }
View Full Code Here

TOP

Related Classes of javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.