use of org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse in project jbossws-cxf by jbossws.
the class ValidatingHelloImpl method helloRequest.
public HelloResponse helloRequest(String input) {
System.out.println("ValidatingHello: " + input);
HelloResponse response = new HelloResponse();
response.setReturn(1);
return response;
}
use of org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse in project jbossws-cxf by jbossws.
the class DefaultSchemaValidationTestCaseForked method testDefaultServerValidation.
/**
* Verifies the default endpoint configuration can be used to always set schema validation from AS model
*
* @throws Exception
*/
@Test
@RunAsClient
public void testDefaultServerValidation() throws Exception {
final QName serviceName = new QName("http://jboss.org/schemavalidation", "HelloService");
final QName portName = new QName("http://jboss.org/schemavalidation", "HelloPort");
URL wsdlURL = getResourceURL("jaxws/samples/schemavalidation/client.wsdl");
Service service = Service.create(wsdlURL, serviceName);
Hello proxy = (Hello) service.getPort(portName, Hello.class);
((BindingProvider) proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + baseURL.getHost() + ":" + baseURL.getPort() + "/jaxws-samples-schemavalidation/hello");
HelloResponse hr;
try {
deployer.deploy(DEPLOYMENT);
hr = proxy.helloRequest("JBoss");
assertNotNull(hr);
assertEquals(2, hr.getReturn());
hr = proxy.helloRequest("number");
assertNotNull(hr);
assertEquals(2, hr.getReturn());
} finally {
deployer.undeploy(DEPLOYMENT);
}
// -- modify default conf to enable default endpoint schema validation
try {
runInContainer("enableDefaultEndpointSchemaValidation");
try {
deployer.deploy(DEPLOYMENT);
hr = proxy.helloRequest("JBoss");
assertNotNull(hr);
assertEquals(2, hr.getReturn());
try {
proxy.helloRequest("number");
fail();
} catch (Exception e) {
assertTrue(e.getMessage().contains("is not facet-valid with respect to enumeration"));
}
} finally {
deployer.undeploy(DEPLOYMENT);
}
} finally {
// -- restore default conf --
runInContainer("disableDefaultEndpointSchemaValidation");
// --
}
}
use of org.jboss.test.ws.jaxws.samples.schemavalidation.types.HelloResponse in project jbossws-cxf by jbossws.
the class HelloImpl method helloRequest.
public HelloResponse helloRequest(String input) {
System.out.println("Hello: " + input);
HelloResponse response = new HelloResponse();
response.setReturn(2);
return response;
}
Aggregations