use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.
the class CXFServiceRefStubPropertyConfigurer method setWSFeature.
private void setWSFeature(JaxWsServiceFactoryBean serviceFactoryBean, UnifiedPortComponentRefMetaData upcmd) {
List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
List<WebServiceFeature> prevFeatures = serviceFactoryBean.getWsFeatures();
if (prevFeatures != null) {
features.addAll(prevFeatures);
}
if (upcmd.isMtomEnabled()) {
if (upcmd.getMtomThreshold() > 0) {
features.add(new MTOMFeature(true, upcmd.getMtomThreshold()));
} else {
features.add(new MTOMFeature(true));
}
}
if (upcmd.isAddressingEnabled()) {
final String refResponses = upcmd.getAddressingResponses();
AddressingFeature.Responses responses = AddressingFeature.Responses.ALL;
if ("ANONYMOUS".equals(refResponses))
responses = AddressingFeature.Responses.ANONYMOUS;
if ("NON_ANONYMOUS".equals(refResponses))
responses = AddressingFeature.Responses.NON_ANONYMOUS;
features.add(new AddressingFeature(true, upcmd.isAddressingRequired(), responses));
}
serviceFactoryBean.setWsFeatures(features);
}
use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.
the class AddressingStatefulTestCase method testItemLifecycle.
@Test
@RunAsClient
public void testItemLifecycle() throws Exception {
URL wsdlURL = new URL(baseURL + "/TestService?wsdl");
QName serviceName = new QName("http://org.jboss.ws/samples/wsaddressing", "TestService");
Service service1 = Service.create(wsdlURL, serviceName);
AddressingPort port1 = new AddressingPort(service1.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
Service service2 = Service.create(wsdlURL, serviceName);
AddressingPort port2 = new AddressingPort(service2.getPort(StatefulEndpoint.class, new AddressingFeature(true, true)));
port1.addItem("Ice Cream");
port1.addItem("Ferrari");
port2.addItem("Mars Bar");
port2.addItem("Porsche");
String items1 = port1.getItems();
assertEquals("[Ice Cream, Ferrari]", items1);
String items2 = port2.getItems();
assertEquals("[Mars Bar, Porsche]", items2);
port1.checkout();
assertEquals("[]", port1.getItems());
port2.checkout();
assertEquals("[]", port2.getItems());
}
Aggregations