Vending complex web services with WO/Axis?
Vending complex web services with WO/Axis?
- Subject: Vending complex web services with WO/Axis?
- From: Allen Cronce <email@hidden>
- Date: Fri, 30 Sep 2005 06:54:33 -0700
Hi all,
As per an earlier post, I'm exploring modernizing and extending a legacy
WO web services implementation. Since we have to vend complex types
using document-style encoding (not RPC), our implementation needs to go
beyond the simplicity of the Calculator example. Unfortunately there
doesn't seem to be any good documentation or examples that demonstrate
how to do this in WO, so it's been a busy couple of days researching how
to approach this problem.
So far what I've done is use Victor Tsang's WSDL2JavaWO to generate the
required Axis code and stubs from our WSDL and schema, then I added
those classes to a test Web Services application. Unfortunately
WSDL2JavaWO is geared towards the client side, so the auto-generated
WOHelper.java code that registers the serializer factories does so only
for a client instance. There is no corresponding helper object that
implements the WO code that need to be made for vending services.
Victor, if you're reading this, you might want to consider extending
WSDL2JavaWO to generate a vending helper class also.
I assume that I have to make a series of
WOWebServiceRegistrar.registerFactoriesForClassWithQName calls for each
object type that I want to serialize. This seems to be analogous to what
the WSDL2JavaWO-generated WOHelper.java class does for the client
interface. But when I look at the Axis-generated code, it looks like
there are statics that register the type descriptions and operations at
the Axis level. So are calls to registerFactoriesForClassWithQName just
be redundant?
So it just isn't clear to me what WO calls, if any, need to be made. Any
suggestions as to how to proceed would be much appreciated.
BTW, for anyone who is interested, I found what appears to be a bug in
the Axis 1.1 WSDL2Java code generation. Basically our top level method
element objects were not being generated with our WSDL as is. After
trial and error I determined that if an operation and method element
name in the WSDL are the same, then WSDL2Java just silently fails to
generate the corresponding element objects. Changing the element name to
be unique works around the problem.
For an example of a WSDL that exhibits the problem, see the following
interesting article:
http://www-128.ibm.com/developerworks/webservices/library/ws-castor/
If you change the getStockQuote element signature in the above
referenced WSDL and XSD files to something else, like
getStockQuoteRequest, then the missing code gets generated successfully.
When the dust settles from this project, I'll make sure that this is
either a known issue or I'll file a bug with the Axis project.
Of course, there's a lot to do before finishing this investigation,
including looking into the above article's assertion that Axis provides
serialization, but no validation of the schema rules. If that's still
the case, then I might have to go the extra mile and use Castor for
validation, as per the article.
Also, I need to figure out how enforce signed SOAP with our services.
But there seems to be a fair amount work that's been done in this area,
so hopefully that won't be too difficult.
Best regards,
--
Allen Cronce
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden