This is the xsd file
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:tns="http://hostname/rfid_1_0/"
targetNamespace="http://hostname/rfid_1_0/" >
<!-- ISSUE -->
<xs:element name="issue" type="tns:issue"/>
<xs:complexType name="issue">
<xs:sequence>
<xs:element name="token" type="xs:string"/>
<xs:element name="rfid" type="xs:string"/>
<xs:element name="eventId" type="xs:string"/>
<xs:element name="locationId" type="xs:long"/>
<xs:element name="accessStart" type="xs:string" />
<xs:element minOccurs="0" name="accessEnd"
type="xs:string"/>
<xs:element minOccurs="0" name="reentry" type="xs:boolean"/>
<xs:element minOccurs="0" name="count" type="xs:int"/>
<xs:element minOccurs="0" name="customerId"
type="xs:string"/>
<xs:element minOccurs="0" name="customerName"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
<!-- ISSUE RESPONSE -->
<xs:element name="issueResponse" type="tns:issueResponse" />
<xs:complexType name="issueResponse">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="resultCode"
type="xs:int"/>
<xs:element minOccurs="1" maxOccurs="1"
name="resultDescription" type="xs:string"/>
<xs:element minOccurs="0" maxOccurs="1" name="transactionId"
type="xs:long"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This is the synapse.xml (snippets)
<syn:localEntry key="rfid_xsd" src="file:registry/Schema/rfid.xsd"/>
...
<syn:sequence name="rfid_in" onError="fault" trace="disable">
<syn:log level="full" separator=","/>
<syn:validate xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
source="s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1]">
<syn:schema key="rfid_xsd"/>
<syn:on-fail>
<syn:sequence key="schema_validation_fault"/>
</syn:on-fail>
</syn:validate>
...
....
</syn:sequence>
Regards,
Harm
2009/1/21 Asankha C. Perera <[email protected]>
> Hi Harm
>
> However using nusoap php as client code we found that the validator is
> rejecting some type of perfectly valid messages.
>
> It seems the validation mediator strips one namespace to many from the
> message when passing the body into the validator.
> .....
> *Error in ESB logs*
>
> DEBUG ValidateMediator Validation of element returned by XPath
> :s11:Body/child::*[position()=1] | s12:Body/child::*[position()=1] failed
> against the given schema(s) [rfid_xsd]with error : cvc-attribute.3: The value
> 'xsd:string' of attribute 'xsi:type' on element 'nu2702:accessStart'
>
> is not valid with respect to its type, 'QName'. Executing 'on-fail' sequence
>
>
> The validator itself seems to be right... it doesn't know the *xsd
> *namespace
> (see message "xsd:string") so it gives an error.
> The xsd namespace was in the original message, but got stripped by the ESB
> before passing into the actual validator library.
>
> Adding
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"<http://www.w3.org/2001/XMLSchema>
> to the validator configuraion (synapse.xml) didn't work.
>
>
> Any idea how to fix this problem?
>
> Can you share the XSD and the synapse.xml to investigate into this issue?
>
> We really like the idea of a validation step on the ESB inputs, but
> rejecting valid messages, kind of beats the purpose :)
>
> Sure, but lets understand what went wrong.. :)
>
> cheers
> asankha
>
> --
> Asankha C. Pererahttp://adroitlogic.org
> http://esbmagic.blogspot.com
>
>
> _______________________________________________
> Esb-java-user mailing list
> [email protected]
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>
>
_______________________________________________
Esb-java-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user