axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject 3rd repost. Schema-Validation with Axis
Date Tue, 02 Mar 2004 19:46:37 GMT
Hi there,

  I tried with the castor approach, but failed for a couple of reasons. One
reason is that we don't have a fix WSDL, but one which is evolving a lot and so
we need to be able to generate most of the stuff around it. With castor seems to
 be much more manual altering needed.
Another reason is that Castor doesn't seem to like it at all that I call a
parameterName the same as the Type, except for the first letter which is a lower
 or upper letter, e.g. customerName is the variable Name and CustomerName is the
 type. Castor seems to be case insensitv.

  Anyway I tried the other approach, to write a custom handler to do the
validation. What bothers me here is two things

     a) Validating the message with  homegrown handler doesn't work too well as
the schema doesn't contain the request itself. This is not needed for generating
 the classes etc., as the messages are defined in the messages section.
Unfortunately they I can't put them into the schema wihout duplicating them,
which is really awful as the whole wsdl thing is a mess in terms of redundancy
     b) Multi-Refs give me a hard time:

   I am trying to validate the Schema with JDOM. Problem is that the validation
fails, because a "href" attribute is not allowed in the schema. I turned off
Multi-Refs in the global section of server-config.wsdd:   <parameter name=
"sendMultiRefs" value="false"/>.
Unfortunately this doesn't seem to change anything at all. Still everything is
sent with hrefs.

  I digged up these two bug-reports:
It basically says it should work now, as of 2002.
It says a client-side parameter should be set. This is not a viable way for us
to go. We don't have control over the clients and can't rely on them turning
multi-refs off. Not sure how interoperable this would be anyway.

Any thoughts?

Any way to teach a parser to resolve multi-refs before validating the schema?
I am happy to switch parser implementations if that would help.

---------------------- Weitergeleitet von Mariano Kamp/FEA_EXT/Essen/Arcor on
02.03.2004 20:34 ---------------------------

Absender: Mariano Kamp, FEA_EXT
02.03.2004, 11:08
Telefon: 5314, Extern: 5314, Mobil: +49 177 6274266

Thema:  3rd repost. Schema-Validation with Axis
Einstufung:    Arcor-intern


  sorry for bothering you again, but as of the moment I haven't got any
information I can work on.

  If it is not possible to validate SOAP messages against the Schema from the
WSDL out of the box, or not even with a homegrown handler, I really like to
know. I'll stfu then.

  The problem once again. Here are my steps:

  1) Building a WSDL by hand.
  2) Generating classes and deploy.wsdd with WSDL2Java.
  3) copying the service element from deploy.wsdd to server-config.wsdd.
Changing the name of the implementation class by hand.
  4) deploying generated classes plus server-config.wsdd.
  5) restarting axis.

  When I now write a test client, which sends a message violating the schema,
like sending a String with 18 characters instead of 12, which is the constraint
from the WSDL, it doesn't fail, which it should.

  Anyway, I believe the reason for that is, WSDL2Java ignores the restrictions
from the Schema and the generated classes and deploy.wsdd don't contain this
information anymore.
When accessing the ?wsdl from axis it returns a WSDL without the constraints and
also turned all defined simple types to complex types.

  Somebody on the list, Luciano, mentioned to use the wsdlFile-tag in
server-config.wsdd to use the original wsdl (the one with all the constraints in
place etc.). That I did... Now ?wsdl returns the original WSDL, but this seems
to be about the only thing Axis does with my WSDL (serving it). It still doesn't
reject messages not obeying the defined constraints.  I left everything else in
place in the server-config.wsdd. Was that ok?

  What else can I do?

  How do other people use Axis with validation? Do I miss something? This seems
to be a very basic and neccessary task, doesn't it?

  I am using Axis 1.1 with Tomcat 5.0.x. And I can only use Axis 1.1 for the

 On a sidebar...  When I restrict a simple type, like a String, Axis always
makes it a complex type, which bloats the generated code seriously. Any way
around this?


View raw message