Hi,

We use a validator mediator to check the incoming messages.
Our wsdl files on the interface include xsd files, and we use those xsd
files also as source for a validation mediator.
This works pretty OK.
Several type of clients work ok (eg: soapUI).

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.


*example of a working SOAP call*

?xml version='1.0' encoding='utf-8'?>

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
<http://schemas.xmlsoap.org/soap/envelope/>

xmlns:rfid="http://hostname/rfid_1_0/";
<http://service.boosttechhouse.com/rfid_1_0/>>

<soapenv:Body>

      <rfid:issue>

         <rfid:token>01000000-00</rfid:token>

         <rfid:rfid>A5B53B29</rfid:rfid>

         <rfid:eventId>12</rfid:eventId>

         <rfid:locationId>529</rfid:locationId>

         <rfid:accessStart>200932151432</rfid:accessStart>

      </rfid:issue>

   </soapenv:Body>
</soapenv:Envelope>


This is validated as OK.


*failing message:* (this is what nusoap php generates when reading the
wsdl).

<?xml version='1.0' encoding='utf-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/

 xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/

 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

 xmlns:xsd="http://www.w3.org/2001/XMLSchema"; <http://www.w3.org/2001/XMLSchema>
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
<http://schemas.xmlsoap.org/soap/encoding/>>
<SOAP-ENV:Body><ns6216:issue
xmlns:ns6216="http://hostname/rfid_1_0/";
<http://service.boosttechhouse.com/rfid_1_0/>>
<nu4900:token xmlns:nu4900="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xsi:type="xsd:string">00000000-00</nu4900:token>
<nu4712:rfid xmlns:nu4712="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xsi:type="xsd:string">4C46688D</nu4712:rfid>
<nu9698:eventId xmlns:nu9698="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xsi:type="xsd:string">0</nu9698:eventId>
<nu5118:locationId
xmlns:nu5118="http://hostname/rfid_1_0/";
<http://service.boosttechhouse.com/rfid_1_0/>
xsi:type="xsd:long">534</nu5118:locationId>
<nu4242:accessStart
xmlns:nu4242="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xsi:type="xsd:string">test0.8</nu4242:accessStart>
</ns6216:issue>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


>From the message above the ESB passes the following into the validator (from
ESB logging)

<ns6216:issue
xmlns:ns6216="http://hostname/rfid_1_0/";
<http://service.boosttechhouse.com/rfid_1_0/>><nu4900:token
xmlns:nu4900="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>
xsi:type="xsd:string">00000000-00</nu4900:token><nu4712:rfid
xmlns:nu4712="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>
xsi:type="xsd:string">4C46688D</nu4712:rfid><nu9698:eventId
xmlns:nu9698="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>
xsi:type="xsd:string">0</nu9698:eventId><nu5118:locationId
xmlns:nu5118="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>
xsi:type="xsd:long">534</nu5118:locationId><nu4242:accessStart
xmlns:nu4242="http://
<http://service.boosttechhouse.com/rfid_1_0/>hostname
<http://service.boosttechhouse.com/rfid_1_0/>/rfid_1_0/"
<http://service.boosttechhouse.com/rfid_1_0/>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
<http://www.w3.org/2001/XMLSchema-instance>
xsi:type="xsd:string">test0.8</nu4242:accessStart></ns6216:issue>


*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?
We really like the idea of a validation step on the ESB inputs, but
rejecting valid messages, kind of beats the purpose :)



Regards,
Harm
_______________________________________________
Esb-java-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to