1

My WebService is deployed on WebLogic 10.3.3.

WSDL/XSD describes input parameter number as mandatory:

<xs:element minOccurs="1" maxOccurs="1" name="number" type="xs:int"/>

MinOccurs="1" means that XML message must contain <number> tag, isn't it?

I expect WebLogic has to validate all requests and server error response should be thrown when request is invalid.

Unfortunatelly, my SOAP client is able to send SOAP request without <number> tag and my webservice implementation receives such an invalid request.

Could you tell me please, is it correct behavior or is it defect in WebLogic?

Should my webservice perform it's own XML validation?

Erwin
  • 4,757
  • 3
  • 31
  • 41

2 Answers2

0

WebLogic does not have XSD Schema Validation enabled by default. You can enable it by adding an annotation to your webservice @SchemaValidation (make sure it com.sun.xml.ws.developer version and NOT the com.sun.xml.ws.internal.developer). However this kind of validation does not work too well if you have a complex XSD Schema (e.g. had problems with GS-1 XSD schemas). I think it has something to do with the xercex parser for xml files that weblogic uses since it can't always find all the elements, however so far I was unable to get to the bottom of it. It works fine for simple schemas.

If you need to validate complex schemas it is better to write your own validator and add it to the WS Message Handler. This is quite a bit of work but you then have full control of it and so far I have found no other solution.

Xargos
  • 633
  • 8
  • 19
0

Take a look at my answer here for a similiar situation.

As already pointed, you can use the provided @SchemaValidation annotation that tells WebLogic to validate the message for you.

Community
  • 1
  • 1
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165