use of jakarta.xml.ws.soap.SOAPBinding in project metro-jax-ws by eclipse-ee4j.
the class ServerTubeAssemblerContext method createHandlerTube.
/**
* Creates a {@link Tube} that invokes protocol and logical handlers.
*/
@NotNull
public Tube createHandlerTube(@NotNull Tube next) {
if (!binding.getHandlerChain().isEmpty()) {
HandlerTube cousin = new ServerLogicalHandlerTube(binding, seiModel, wsdlModel, next);
next = cousin;
if (binding instanceof SOAPBinding) {
// Add SOAPHandlerTube
next = cousin = new ServerSOAPHandlerTube(binding, next, cousin);
// Add MessageHandlerTube
next = new ServerMessageHandlerTube(seiModel, binding, next, cousin);
}
}
return next;
}
use of jakarta.xml.ws.soap.SOAPBinding in project metro-jax-ws by eclipse-ee4j.
the class BindingTest method testSoapBinding1.
/*
* tests for SOAPBinding.
*
*/
public void testSoapBinding1() throws Exception {
TestService_Service service = getService();
TestService stub = getTestStub(service);
Binding binding = ((BindingProvider) stub).getBinding();
if (binding instanceof SOAPBinding) {
SOAPBinding sb = (SOAPBinding) binding;
assertNotNull("did not get SOAPBinding", sb);
Set<String> roles = sb.getRoles();
assertNotNull("roles cannot be null", roles);
assertFalse("found zero roles in SOAPBinding", roles.isEmpty());
assertTrue("soap 1.1 \"next\" role is not included in roles", roles.contains(NEXT_1_1));
assertFalse("soap 1.2 \"none\" role cannot be included in roles", roles.contains(NONE));
// try setting new roles
Set<String> newSet = new HashSet<String>();
String testURI = "http://java.sun.com/justanexample";
newSet.add(testURI);
sb.setRoles(newSet);
try {
newSet.add(NONE);
sb.setRoles(newSet);
throw new RuntimeException("did not get jaxrpc exception for setting \"none\" role");
} catch (WebServiceException e) {
// pass
}
newSet.addAll(roles);
newSet.remove(NONE);
sb.setRoles(newSet);
// add empty set and check for next/ultimate
newSet = new HashSet<String>();
sb.setRoles(newSet);
Set<String> newSet2 = sb.getRoles();
assertTrue("soap 1.1 \"next\" role is not included in roles", newSet2.contains(NEXT_1_1));
assertFalse("soap 1.2 \"none\" role cannot be included in roles", newSet2.contains(NONE));
} else {
throw new Exception("binding is not a SOAPBinding");
}
}
use of jakarta.xml.ws.soap.SOAPBinding in project metro-jax-ws by eclipse-ee4j.
the class BindingTest method testSoapBinding2.
/*
* test the roles of the binding
*/
public void testSoapBinding2() throws Exception {
TestService_Service service = getService();
TestService stub = getTestStub(service);
SOAPBinding binding = (SOAPBinding) ((BindingProvider) stub).getBinding();
Set<String> roles = binding.getRoles();
if (HandlerTracker.VERBOSE_HANDLERS) {
System.out.println("roles: " + roles);
}
String uri1 = "http://sun.com/client/role1";
String uri2 = "http://sun.com/client/role2";
assertTrue("test \"role1\" is not included in roles", roles.contains(uri1));
assertTrue("test \"role2\" is not included in roles", roles.contains(uri2));
}
use of jakarta.xml.ws.soap.SOAPBinding in project metro-jax-ws by eclipse-ee4j.
the class EndToEndTester method testAllRoles.
/*
* Test the allRoles boolean argument of getHeaders()
* method in SOAPMessageContext.
*/
public void testAllRoles() throws Exception {
TestService_Service service = getService();
TestService testStub = getTestStub(service);
ReportService reportStub = getReportStub(service);
HandlerTracker tracker = HandlerTracker.getClientInstance();
// these lines make calls to the server
reportStub.clearHandlerTracker();
reportStub.setInstruction(SERVER_PREFIX + 4, HA_ADD_HEADER_OUTBOUND_CLIENT_ROLE1);
// so we clear out the client handlers afterwards
tracker.clearAll();
tracker.setHandlerAction(CLIENT_PREFIX + 7, HA_CHECK_SMC_ALL_ROLES);
// first check with the client1 role
int result = testStub.testInt(5);
// now check without the known role (should get no headers in handler)
SOAPBinding sBinding = (SOAPBinding) ((BindingProvider) testStub).getBinding();
sBinding.setRoles(new HashSet<String>());
result = testStub.testInt(5);
}
use of jakarta.xml.ws.soap.SOAPBinding in project metro-jax-ws by eclipse-ee4j.
the class AppTest method setUp.
@Override
public void setUp() throws Exception {
HelloService helloService = new HelloService();
Object obj = helloService.getHelloPort();
assertTrue(obj != null);
// set Mtom optimization.
SOAPBinding binding = (SOAPBinding) ((BindingProvider) obj).getBinding();
binding.setMTOMEnabled(true);
port = (Hello) obj;
}
Aggregations