public EndpointReference getEndpointReference(Element... referenceParameters) { if (!isPublished()) { throw new WebServiceException(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_PUBLISHED", LOG).toString()); } if (getBinding() instanceof HTTPBinding) { 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); } }
public EndpointReference getEndpointReference(Element... referenceParameters) { if (!isPublished()) { throw new WebServiceException(new org.apache.cxf.common.i18n.Message("ENDPOINT_NOT_PUBLISHED", LOG).toString()); } if (getBinding() instanceof HTTPBinding) { 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); } }
protected void run() { Object implementor = new TestMtomImpl(); String address = "http://localhost:" + PORT + "/mime-test"; String addressProvider = "http://localhost:" + PORT + "/mime-test-provider"; try { jaxep = (EndpointImpl) javax.xml.ws.Endpoint.publish(address, implementor); Endpoint ep = jaxep.getServer().getEndpoint(); ep.getInInterceptors().add(new TestMultipartMessageInterceptor()); ep.getOutInterceptors().add(new TestAttachmentOutInterceptor()); jaxep.getInInterceptors().add(new LoggingInInterceptor()); jaxep.getOutInterceptors().add(new LoggingOutInterceptor()); SOAPBinding jaxWsSoapBinding = (SOAPBinding) jaxep.getBinding(); jaxWsSoapBinding.setMTOMEnabled(true); EndpointImpl endpoint = (EndpointImpl)javax.xml.ws.Endpoint.publish(addressProvider, new TestMtomProviderImpl()); endpoint.getProperties().put("schema-validation-enabled", "true"); endpoint.getInInterceptors().add(new LoggingInInterceptor()); endpoint.getOutInterceptors().add(new LoggingOutInterceptor()); } catch (Exception e) { Thread.currentThread().interrupt(); } } public void tearDown() {
@BeforeClass public static void startServers() throws Exception { Object implementor = new TestMtomJMSImpl(); bus = BusFactory.getDefaultBus(); ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false"); PooledConnectionFactory cfp = new PooledConnectionFactory(cf); cff = new ConnectionFactoryFeature(cfp); EndpointImpl ep = (EndpointImpl)Endpoint.create(implementor); ep.getFeatures().add(cff); ep.getInInterceptors().add(new TestMultipartMessageInterceptor()); ep.getOutInterceptors().add(new TestAttachmentOutInterceptor()); //ep.getInInterceptors().add(new LoggingInInterceptor()); //ep.getOutInterceptors().add(new LoggingOutInterceptor()); SOAPBinding jaxWsSoapBinding = (SOAPBinding)ep.getBinding(); jaxWsSoapBinding.setMTOMEnabled(true); ep.publish(); }
@BeforeClass public static void startServers() throws Exception { broker = new EmbeddedJMSBrokerLauncher(); broker.startInProcess(); bus = BusFactory.getDefaultBus(); broker.updateWsdl(bus, "testutils/jms_test_mtom.wsdl"); Object mtom = new JMSMTOMImpl(); EndpointImpl ep = (EndpointImpl)Endpoint .publish("jms:jndi:dynamicQueues/test.cxf.jmstransport.queue&receiveTimeout=10000", mtom); Binding binding = ep.getBinding(); ((SOAPBinding)binding).setMTOMEnabled(true); }
((SOAPBinding)cxfendpoint.getBinding()).setMTOMEnabled(true);