Frank-

It's an interesting idea, I don't know, I've been "lucky" enough that
I've had WSDL to work with. It might be possible to use the same
methods that wsdl2java uses, but there's probably a lot of complexity
in there because SOAP can be quite complex.

I've found that one disadvantage of the code it generates is that it
doesn't degrade gracefully when the WSDL doesn't match the actual API
or the server returns malformed XML or there's a bad type conversion.
(Actually, it throws an exception with little explanation of why it
failed, just that there was a "parse error in XML for 123.45_67" or
somesuch.) Luckily Axis includes a tool that will intercept calls to
and responses from the server to inspect what the XML looks like.

Also, it doesn't tolerate WSDL that isn't formatted properly, e.g., if
a call refers to a missing object or if an object is incompletely
specified, it stops and refuses to process any more nor generate any
code. On some (badly!) hand-generated WSDL I had to edit the source so
errors weren't fatal so I could get something generated and running.

Apologies for making this even more OT, but it's Friday :-)

-ed


On 7/15/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Nice, thanks Ed!  I'd absolutely agree, assuming you have WSDL, this is
> the way to go.
> 
> Can it generate anything if it doesn't have WSDL though?  I have
> experiences where the services I needed to consume didn't supply any, for
> various reasons, but maybe it can still generate some generic stub code??
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> On Fri, July 15, 2005 11:41 am, Ed Griebel said:
> > FYI, I've used Axis to generate client java stubs by parsing the
> > service's WSDL file. It will generate the stub classes to call the WS
> > and the POJOs to communicate with the WS.
> >
> > You don't actually need to "install" the Axis package and there's no
> > daemon to run to do this, you'll just need to extract the distribution
> > and then run wsdl2java, which is well-documented on the Axis homepage.
> > It's a good idea to generate the "unit test" class too as it's a good
> > example of how to call the stubs.
> >
> > I'm pretty sure that this will be a lot quicker than rolling your own
> > XML serialization and HTTP code.
> >
> > -ed
> >
> > On 7/15/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> >> Hi Richard,
> >>
> >> Axis is the server-side of the WS equation (although maybe it can
> >> perform some client duties, I'm not certain), so more than likely it
> >> wouldn't come into play anyway.
> >>
> >> The simple answer is yes, a simple Java app can access a web service.
> >>
> >> There are classes that will specifically help you do so, but you can
> >> also "fake it", at least if it is a SOAP-based service (I'm not as
> >> familiar with RCP-type services).  For SOAP-based services, all you
> >> really need to do is construct an XML message and use the usual HTTP
> >> methods in the standard JDK to send it.
> >>
> >> You might be interested to look at my StrutsWS project because there is
> >> exactly what your asking for included: a simple Java app that accesses
> >> the services the example project provides (in short, StrutsWS is an
> >> extension to Struts that allows Actions to be exposed as services).  You
> >> can find it at http://sourceforge.net/projects/strutsws/
> >>
> >> Frank
> >>
> >> Richard Reyes wrote:
> >> > Hi Guys,
> >> >
> >> > Can a simple java app access a web service? Or do I need to install
> >> axis?
> >> >
> >> > Thanks
> >> > Richard
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> > For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >> >
> >> >
> >> >
> >> > .
> >> >
> >>
> >> --
> >> Frank W. Zammetti
> >> Founder and Chief Software Architect
> >> Omnytex Technologies
> >> http://www.omnytex.com
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to