Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java. Validate SOAP message against a WSDL

I need to validate a SOAP message against a WSDL? (in the same way that an XML file can be validated against a XSD schema).

I am not calling any webservice; I just have a SOAP message and a WSDL, and I need to verify that the SOAP message is correct. without calling the webservice or whatsoever afterwards.

I need to make this validate within a Java program. Do you know of a small Java library to do this?

ps: I am aware that several JAX-WS libraries can validate the request/response when you call a webservice. But again, I am not calling any webservice; I have a simple SOAP message, and a WSDL, and I a need a function that validates the SOAP message against the WSDL.

ps: I am also aware that there tools that can do this, such as SOAPUI and XMLSpy. Again, I need to do this validation within my Java program.

ps: I am aware that I could extract the body part of the SOAP message, and validate it against the XSD. However, I'd like to validate the entire SOAP message against the WSDL.

like image 343
David Portabella Avatar asked Sep 07 '25 10:09

David Portabella


1 Answers

You might look at the source code for the WsdlValidator class in the open-source soapUI project.

https://github.com/SmartBear/soapui

http://www.soapui.org/apidocs/com/eviware/soapui/impl/wsdl/support/wsdl/WsdlValidator.html

like image 156
BPS Avatar answered Sep 09 '25 06:09

BPS