THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
<wsdl11:binding name="exampleBinding"> <soapjms:jndiContextParameter name="name" value="value" /> <soapjms:jndiConnectionFactoryName>ConnectionFactory </soapjms:jndiConnectionFactoryName> <soapjms:jndiInitialContextFactory> org.apache.activemq.jndi.ActiveMQInitialContextFactory </soapjms:jndiInitialContextFactory> <soapjms:jndiURL>tcp://localhost:61616 </soapjms:jndiURL> <soapjms:deliveryMode>PERSISTENT</soapjms:deliveryMode> <soapjms:priority>5</soapjms:priority> <soapjms:timeToLive>200</soapjms:timeToLive> </wsdl11:binding> <wsdl11:service name="exampleService"> <soapjms:jndiInitialContextFactory> com.example.jndi.InitialContextFactory </soapjms:jndiInitialContextFactory> <soapjms:timeTolive>100</soapjms:timeToLive> ... <wsdl11:port name="quickPort" binding="tns:exampleBinding"> ... <soapjms:timeToLive>10</soapjms:timeToLive> </wsdl11:port> <wsdl11:port name="slowPort" binding="tns:exampleBinding"> ... </wsdl11:port> </wsdl11:service> |
...
Sample code to consume a SOAP-over-JMS service is as follows:
Code Block | ||||
---|---|---|---|---|
| ||||
public void invoke() throws Exception {
// You just need to set the address with JMS URI
String address = "jms:jndi:dynamicQueues/test.cxf.jmstransport.queue3"
+ "?jndiInitialContextFactory"
+ "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+ "&jndiConnectionFactoryName=ConnectionFactory&jndiURL="
+ "tcp://localhost:61500";
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
// And specify the transport ID with SOAP over JMS specification
factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
factory.setServiceClass(Hello.class);
factory.setAddress(address);
Hello client = (Hello)factory.create();
String reply = client.sayHi(" HI");
System.out.println(reply);
}
|
...