use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.
the class JBWS3773TestCase method initPort.
private Greeter initPort() throws Exception {
URL wsdlURL = new URL(baseURL + "/SOAPService?wsdl");
QName qname = new QName("http://jboss.org/hello_world", "SOAPService");
Service service = Service.create(wsdlURL, qname);
Greeter greeter = service.getPort(Greeter.class, new AddressingFeature());
return greeter;
}
use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.
the class EndpointReferenceTestCase method testDispatchWithFeatures.
@Test
@RunAsClient
public void testDispatchWithFeatures() throws Exception {
final Dispatch<Source> dispatch = service.createDispatch(PORT_QNAME, Source.class, Mode.PAYLOAD, new AddressingFeature(false, false));
this.validateEndpointReferences(dispatch);
}
use of javax.xml.ws.soap.AddressingFeature in project jbossws-cxf by jbossws.
the class CXFServiceObjectFactoryJAXWS method getFeatures.
private WebServiceFeature[] getFeatures(final UnifiedPortComponentRefMetaData portComponentRefMD) {
List<WebServiceFeature> features = new LinkedList<WebServiceFeature>();
// configure @Addressing feature
if (portComponentRefMD.isAddressingAnnotationSpecified()) {
final boolean enabled = portComponentRefMD.isAddressingEnabled();
final boolean required = portComponentRefMD.isAddressingRequired();
final String refResponses = portComponentRefMD.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(enabled, required, responses));
}
// configure @MTOM feature
if (portComponentRefMD.isMtomEnabled()) {
features.add(new MTOMFeature(true, portComponentRefMD.getMtomThreshold()));
}
// configure @RespectBinding feature
if (portComponentRefMD.isRespectBindingAnnotationSpecified()) {
final boolean enabled = portComponentRefMD.isRespectBindingEnabled();
features.add(new RespectBindingFeature(enabled));
}
return features.size() == 0 ? null : features.toArray(new WebServiceFeature[] {});
}
use of javax.xml.ws.soap.AddressingFeature in project tomee by apache.
the class WebServiceInjectionTest method checkConfiguration.
@Test
public void checkConfiguration() {
// assertEquals("ok", api.test()); // local call so skip it but check config which is actually the only interesting thing
final Client client = ClientProxy.getClient(api);
testPort(client);
testPort(ClientProxy.getClient(service.getMyWsApi()));
testPortWithFeature(ClientProxy.getClient(service.getMyWsApi(new AddressingFeature())));
}
use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.
the class SymmetricBindingTest method testUsernameTokenSAML2Dispatch.
@org.junit.Test
public void testUsernameTokenSAML2Dispatch() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = SymmetricBindingTest.class.getResource("cxf-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL wsdl = SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
Service service = Service.create(wsdl, SERVICE_QNAME);
QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML2Port");
Dispatch<DOMSource> dispatch = service.createDispatch(portQName, DOMSource.class, Service.Mode.PAYLOAD, new AddressingFeature());
updateAddressPort(dispatch, test.getPort());
// Setup STSClient
STSClient stsClient = createDispatchSTSClient(bus);
String wsdlLocation = "http://localhost:" + test.getStsPort() + "/SecurityTokenService/UT?wsdl";
stsClient.setWsdlLocation(wsdlLocation);
// Creating a DOMSource Object for the request
DOMSource request = createDOMRequest();
// Make a successful request
Client client = ((DispatchImpl<DOMSource>) dispatch).getClient();
client.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
if (test.isStreaming()) {
client.getRequestContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
client.getResponseContext().put(SecurityConstants.ENABLE_STREAMING_SECURITY, "true");
}
DOMSource response = dispatch.invoke(request);
assertNotNull(response);
bus.shutdown(true);
}
Aggregations