Hello,

I've just altered the test to move the problem into the SOAP body:

    <xs:simpleType name="TestType">
        <xs:restriction base="xs:string">
            <xs:minLength value="2" />
            <xs:pattern value="[0-9a-zA-Z]+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="RequestBodyType">
        <xs:sequence>
        <xs:element name="Test" type="tns:TestType" />
     ...

If I set the value of Test to null on the stub, I see the relevant exception, 
but I don't think it's coming from the same place:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid 
content was found starting with element 'ns2:XX. One of '{"xxx":Test}' is 
expected.
        at 
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 
Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
        at 
org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown
 Source)
        at 
org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
        at 
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
        at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown 
Source)
        at 
org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown 
Source)

Yet , if I set "" on the value for Test, no exception is thrown. I'll do some 
more investigation before embarking on a test case.


John

-----Original Message-----
From: Andrei Shakirin [mailto:[email protected]] 
Sent: 31 October 2012 10:27
To: [email protected]
Cc: John Baker
Subject: RE: Schema validation of SOAP headers

Xerces definitely validates such patterns.
From the first view I do not see any problems in your configuration. 

Could you distil the use in a small test case (including WSDL, configuration, 
code)?

Cheers,
Andrei.




<FONT size=1> <P><FONT 
size=2>****************************************************************************************</FONT></P><P><FONT
 size=2>The information contained in this email may be confidential. It is 
intended</FONT></P><P><FONT size=2>only for the use of the named recipient. If 
you are not the named recipient</FONT></P><P><FONT size=2>please delete this 
email and notify the sender of the delivery error. If you</FONT></P><P><FONT 
size=2>have received this email and are not the named recipient, any 
disclosure,</FONT></P><P><FONT size=2>reproduction, distribution or other 
dissemination or use of the information</FONT></P><P><FONT size=2>contained in 
this email is strictly prohibited.</FONT></P><P><FONT size=2> 
</FONT></P><P><FONT size=2>The transmission of email cannot be guaranteed to be 
secure or error free as</FONT></P><P><FONT size=2>information could be 
intercepted, corrupted, lost, destroyed, arrive late or</FONT></P><P><FONT 
size=2>incomplete, or contain viruses. The sender therefore does not 
accept</FONT></P><P><FONT size=2>liability for any errors or omissions in the 
contents of this message which</FONT></P><P><FONT size=2>arise as a result of 
email transmission. If verification is required please</FONT></P><P><FONT 
size=2>request a hard copy version.</FONT></P><P><FONT size=2> 
</FONT></P><P><FONT size=2>The Camelot group of companies 
includes:</FONT></P><P><FONT size=2>Camelot UK Lotteries Limited (reg. no 
2822203), Camelot Business Solutions</FONT></P><P><FONT size=2>Limited (reg. no 
07553982), Camelot Strategic Solutions Limited (reg. no</FONT></P><P><FONT 
size=2>07553980), Camelot Global Services Limited (reg. no 02822300) and 
Camelot</FONT></P><P><FONT size=2>Commercial Services Limited (reg. no 
06911097), all of which are registered</FONT></P><P><FONT size=2>in England and 
Wales and have their registered office at:</FONT></P><P><FONT size=2>Tolpits 
Lane</FONT></P><P><FONT size=2>Watford</FONT></P><P><FONT size=2>WD18 
9RN</FONT></P><P><FONT size=2>Tel : 01923 425000</FONT></P><P><FONT 
size=2>***************************************************************************************</FONT></P></FONT>

Reply via email to