Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Axis Webservices

Thread view: 
Nick - 30 Jun 2006 12:58 GMT
Hi All,
I'm creating a number of Webservices which are all being handled by a
single Java omponent - WebserviceBroker

I've used axis to expose the WebserviceBroker.ProcessMessage method
that takes a single string parameter containing an XML fragment.

This works fine and my services work fine. The problem I have is with
making them available for a service consumer. I need to Provide a WSDL
which accurately defines what messages are acceptable as input.

I can see the axis generated WSDL for my services but it specifies
input and output of type="xsd:anyType" which isn't much use to my
consumers.

I have hand coded a WSDL which contains a much more precise definition
of the xml messages/structures and elements. I have even been able to
make Axis display my WSDL in the Services/<name>?wsld by adding in a
reference to my document in the server-config.wsdd.

What I can't do is get Axis to validate the input against the
schema!!!!! If I give my handcoded WSDL to my customers I am relying on
them to send valid messages in but its not enforced and that opens me
up to any input message.

I can write a schema validation class and chain it to the global
request response flow but I'd rather not. I think this is a common
requirement and I don't like to write code where I think a standard
configurable component might work better.

Anyone got any advice?
Chris Smith - 01 Jul 2006 20:09 GMT
> I can write a schema validation class and chain it to the global
> request response flow but I'd rather not. I think this is a common
> requirement and I don't like to write code where I think a standard
> configurable component might work better.

Since you have asked Axis to allow any XML in the world as a parameter
to your one operation, I believe Axis won't validate it.  I don't
understand why you've done that, but unless you are willing to revisit
that design decision, you will just have to validate against the
appropriate schema on your own.  It's not hard to do, really.

If you are willing to revisit that design decision, then you may
consider specifying the various operations separately, and making use of
other mechanisms for capturing common aspects of all your web service
calls... for example, you could use good old OO design techniques, or
additional handlers in Axis's chains.

Signature

Chris Smith - Lead Software Developer / Technical Trainer
MindIQ Corporation

Nick - 03 Jul 2006 09:09 GMT
> > I can write a schema validation class and chain it to the global
> > request response flow but I'd rather not. I think this is a common
[quoted text clipped - 16 lines]
> Chris Smith - Lead Software Developer / Technical Trainer
> MindIQ Corporation

Thanks for that Chris, I think I will have to validate the approriate
schema as you said.

The reason behind the single input parameter is that I am leveraging
existing middleware translation code behind my broker component. The
existing code works on plain old XML and is configurable via xml/xslt.
I can configure new services without any code compilation. Its not very
OO but it makes my development really straight forward. If possible I
wanted to retain the ability to add new services without having to
write any java code.

A handler in an Axis chain which reads and validates against service
specific schema may be my best option.

thanks again,
Nick


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.