Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore XML Validation for JAX-WS clients

Tags:

java

xml

jax-ws

I've got a few JAX-WS services I'm trying to consume, but the XML being returned from the service (of which I cannot change) has an invalid DTD (producing the XMLStreamReaderException as there are no white spaces between publicId and systemId). How do I make the clients ignore poorly-formed DTDs?

like image 743
CassOnMars Avatar asked Dec 21 '12 19:12

CassOnMars


People also ask

How do I disable schema validation?

​Open the web service for which you wish to disable the XML Schema validation. Open the corresponding Operation Mapping. Click on the mapping properties->Advanced tab. Update the 'XML Schema Validation' property value to 'No Validation' (As stated below).

What is JAX-WS how it is useful for describing SOAP Web services?

JAX-WS is a fundamental technology for developing SOAP (Simple Object Access Protocol) and RESTful (Web services that use representational state transfer, or REST, tools) Java Web services, where JAX-WS is designed to take the place of the JAVA-RPC (Remote Procedure Call) interface in Web services and Web-based ...

What is JAX-WS RI?

Java API for XML Web Services (JAX-WS) is a standardized API for creating and consuming SOAP (Simple Object Access Protocol) web services.

Which is the data mapping model of JAX-WS?

The JAX-WS specification describes the mapping between Web Services Description Language (WSDL) files and the Java language. The supported mappings include WSDL-to-Java mappings and Java-to-WSDL mappings. WSDL 1.1 is required by the JAX-WS 2.0 specification.


1 Answers

Is the invalid DTD part of a WSDL? if yes, you could use JAXWS catalog to read the XML locally and then just invoke the service.

You need to download the WSDL, fix it and store it locally. Then, when creating a Service instance read the WSDL from your local store. Update the endpoint property and invoke the service.

like image 196
Aleš Avatar answered Oct 04 '22 18:10

Aleš