use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class JBWS2960TestCase method testOperations.
@Test
@RunAsClient
public void testOperations() throws Exception {
Definition wsdl = getWSDLDefinition(wsdlFile.getAbsolutePath());
PortType port = wsdl.getPortType(new QName("http://foobar.org/", "AddNumbers"));
Operation operation = null;
// addNumbersNoAction
operation = this.getOperation(port, "addNumbersNoAction");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersNoActionRequest");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersNoActionResponse");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersNoAction/Fault/AddNumbersException", "AddNumbersException");
// addNumbersEmptyAction
operation = this.getOperation(port, "addNumbersEmptyAction");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersEmptyActionRequest");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersEmptyActionResponse");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersEmptyAction/Fault/AddNumbersException", "AddNumbersException");
// addNumbers
operation = this.getOperation(port, "addNumbers");
this.assertInput(operation, "http://example.com/input");
this.assertOutput(operation, "http://example.com/output");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbers/Fault/AddNumbersException", "AddNumbersException");
// addNumbers2
operation = this.getOperation(port, "addNumbers2");
this.assertInput(operation, "http://example.com/input2");
this.assertOutput(operation, "http://example.com/output2");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbers2/Fault/AddNumbersException", "AddNumbersException");
// addNumbers3
operation = this.getOperation(port, "addNumbers3");
this.assertInput(operation, "http://example.com/input3");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbers3Response");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbers3/Fault/AddNumbersException", "AddNumbersException");
// addNumbers4
operation = this.getOperation(port, "addNumbers4");
this.assertInput(operation, "http://example.com/input4");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbers4Response");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbers4/Fault/AddNumbersException", "AddNumbersException");
// addNumbersFault1
operation = this.getOperation(port, "addNumbersFault1");
this.assertInput(operation, "finput1");
this.assertOutput(operation, "foutput1");
this.assertFault(operation, "http://fault1", "AddNumbersException");
// addNumbersFault2
operation = this.getOperation(port, "addNumbersFault2");
this.assertInput(operation, "finput2");
this.assertOutput(operation, "foutput2");
this.assertFault(operation, "http://fault2/addnumbers", "AddNumbersException");
this.assertFault(operation, "http://fault2/toobignumbers", "TooBigNumbersException");
// addNumbersFault3
operation = this.getOperation(port, "addNumbersFault3");
this.assertInput(operation, "finput3");
this.assertOutput(operation, "foutput3");
this.assertFault(operation, "http://fault3/addnumbers", "AddNumbersException");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersFault3/Fault/TooBigNumbersException", "TooBigNumbersException");
// addNumbersFault4
operation = this.getOperation(port, "addNumbersFault4");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersFault4Request");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersFault4Response");
this.assertFault(operation, "http://fault4/addnumbers", "AddNumbersException");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersFault4/Fault/TooBigNumbersException", "TooBigNumbersException");
// addNumbersFault5
operation = this.getOperation(port, "addNumbersFault5");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersFault5Request");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersFault5Response");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersFault5/Fault/AddNumbersException", "AddNumbersException");
this.assertFault(operation, "http://fault5/toobignumbers", "TooBigNumbersException");
// addNumbersFault6
operation = this.getOperation(port, "addNumbersFault6");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersFault6Request");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersFault6Response");
this.assertFault(operation, "http://fault6/addnumbers", "AddNumbersException");
this.assertFault(operation, "http://fault6/toobignumbers", "TooBigNumbersException");
// addNumbersFault7
operation = this.getOperation(port, "addNumbersFault7");
this.assertInput(operation, "http://foobar.org/AddNumbers/addNumbersFault7Request");
this.assertOutput(operation, "http://foobar.org/AddNumbers/addNumbersFault7Response");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersFault7/Fault/AddNumbersException", "AddNumbersException");
this.assertFault(operation, "http://foobar.org/AddNumbers/addNumbersFault7/Fault/TooBigNumbersException", "TooBigNumbersException");
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class EarTestCase method testEJB3Endpoint.
@Test
@RunAsClient
public void testEJB3Endpoint() throws Exception {
String soapAddress = "http://" + baseURL.getHost() + ":" + baseURL.getPort() + "/jaxws-samples-eardeployment-ejb3/EndpointService/Endpoint";
QName serviceName = new QName("http://eardeployment.jaxws/", "EndpointService");
Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);
Endpoint port = service.getPort(Endpoint.class);
Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
String nsURI = wsdl.getNamespace("jbws1616");
assertEquals("http://jira.jboss.org/jira/browse/JBWS-1616", nsURI);
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class JBossWebServicesEarTestCase method getWSDLDefinition.
private Definition getWSDLDefinition(String wsdlLocation) throws Exception {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class JBossWebServicesEarTestCase method testJSEEndpoint.
@Test
@RunAsClient
public void testJSEEndpoint() throws Exception {
String soapAddress = baseURL + "JSEBean";
QName serviceName = new QName("http://eardeployment.jaxws/", "EndpointService");
Service service = Service.create(new URL(soapAddress + "?wsdl"), serviceName);
Endpoint port = service.getPort(Endpoint.class);
// check soap address rewrite to verify jboss-webservices.xml override
Definition wsdl = getWSDLDefinition(soapAddress + "?wsdl");
SOAPAddress sa = (SOAPAddress) wsdl.getService(serviceName).getPort("EndpointPort").getExtensibilityElements().iterator().next();
assertEquals("https://foo-test:" + JBossWSTestHelper.getSecureServerPort(null, null) + "/earjse2/JSEBean", sa.getLocationURI());
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, soapAddress);
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
use of javax.wsdl.Definition in project jbossws-cxf by jbossws.
the class SOAPBindingTestCase method testWSDLAccess.
// [JBWS-1761] - WSProvide ignores SOAPBinding declaration
@Test
@RunAsClient
public void testWSDLAccess() throws Exception {
URL wsdlURL = new URL(baseURL + "?wsdl");
WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
Definition wsdl = wsdlReader.readWSDL(wsdlURL.toString());
String port = "SOAPEndpointPort";
QName serviceQName = new QName("http://org.jboss.ws/jaxws/binding", "SOAPEndpointService");
Binding wsdlBinding = wsdl.getService(serviceQName).getPort(port).getBinding();
assertNotNull("Cannot find binding for port: " + port, wsdlBinding);
String transport = null;
@SuppressWarnings("unchecked") List<ExtensibilityElement> extList = wsdlBinding.getExtensibilityElements();
for (ExtensibilityElement ext : extList) {
if (ext instanceof SOAPBinding) {
fail("Expected SOAP-1.2 binding");
} else if (ext instanceof SOAP12Binding) {
SOAP12Binding soapBinding = (SOAP12Binding) ext;
transport = soapBinding.getTransportURI();
}
}
if (isIntegrationCXF()) {
System.out.println("FIXME: [CXF-2531] Wrong \"transport\" attribute in soap12:binding");
} else {
assertEquals("Invalid transport uri", "http://schemas.xmlsoap.org/soap/http", transport);
}
}
Aggregations