Skip to main content

Enable SOAP schema-validation on client-side?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
rop
Offline
Joined: 2010-05-24

How do I enable SOAP schema-validation on the client-side (before sending the SOAP-request to the server)?

I'm calling a SOAP web-service from JEE6-client (running inside Tomcat-app), like:

	import javax.xml.ws.Service;
...
Class<T> serviceClass;
...
Service service = Service.create(url, new QName(namespaceURI, serviceName));
boolean inbound = true;
boolean outbound = true;
T servicePort = (T) service.getPort(serviceClass, new SchemaValidationFeature(inbound, outbound));

But doesn't seem to work... error is still thrown on the server-side if, for example, a mandatory value is missing.

Anything else I need to do to catch the error on client-side?