Hi John, You have mentioned you will be getting the message using RawXMLINOutMessageReceiver and then passing that to JiBX. Do you know that we have in-built support for JiBX.
Just get the wsdl, code generate using that giving -d jibx. Not ony you
will get the code to pass your xml to jibx, it will do the validation of
the xml against the schema.
HTH.
Chinthaka
John Pfeifer wrote:
>
>
> I have created a test web service (see below). This service uses the
> RawXMLINOutMessageReceiver and by default does not have a wsdl. I
> created a WSDL (where I defined the schema of the xml document) and
> placed it in the META-INF directory. When I test the web service with
> xml that doesn't adhere to the schema, the request is still processed.
> Does axis2 ignore the WSDL? If so, how can I validate the schema before
> it is passed to my web service? I would prefer to have all of the field
> level validations performed before I pass the XML off to JiBX. I
> understand that schema validation can be expensive, but I am dealing
> with small XML documents and am willing to take the hit for the benefit
> of the field level validations. I would think that this is a common
> issue that someone else has solved, so any help you can provide would be
> greatly appreciated.
>
> public class TestWebService {
>
> private MessageContext inMessageContext = null;
>
> public void setOperationContext(OperationContext opContext) throws
> AxisFault {
> this.inMessageContext =
> opContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
> }
>
> public OMElement SendEmail(OMElement element) throws AxisFault,
> XMLStreamException {
> System.out.println("test start");
>
> JP4
>
signature.asc
Description: OpenPGP digital signature
