axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Dean" <>
Subject RE: [axis2] dynamic client invocation w/o intermediate classgeneration
Date Thu, 15 Jun 2006 15:49:56 GMT

Can you speak to what Dims eluded to... how to use complexTypes w/o generating helper classes
to perform serialization/deserialization.  I want to do what WSIF and JROM started out to

Also, with the current ServiceClient API, I don't see a way distinquish between the style
of service that you want to invoke.  Basically, you just pass in an OMElement as the payload.
 I used WSDL2Java to see what kind of code would be generated from a simple RPC stockquote
wsdl.  The wsdl is as follows:

<?xml version='1.0' encoding='UTF-8'?>
<definitions name='' 



   <message name='getQuoteResponse1'>
      <part name='Result' type='xsd:float'/>

   <message name='getQuoteRequest1'>
      <part name='symbol' type='xsd:string'/>

   <portType name=''>
      <operation name='getQuote' parameterOrder='symbol'>
         <input message='tns:getQuoteRequest1'/>
         <output message='tns:getQuoteResponse1'/>

   <binding name='' 
      <soap:binding style='rpc' transport=''/>
      <operation name='getQuote'>
         <soap:operation soapAction='urn:xmethods-delayed-quotes#getQuote'/>
            <soap:body use='encoded' 
            <soap:body use='encoded' 

   <service name=''>
      <documentation> web service</documentation>
      <port name='' 
         <soap:address location=''/>
         <!-- <soap:address location='http://localhost:9999/soap'/> -->

Axis2 ADB generated coded that produces the following client invocation stream:

<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="">
 <soapenv:Header />
  <ns1:getQuote xmlns:ns1="">

This is wrong.  First, for rpc style services, the namespace of the wrapper element (operation)
must be specified with the binding soap:body extension namespace attribute.  In the wsdl above,
this namespace is 
"urn:xmethods-delayed-quotes".  Second, since use is encoded, don't you have to encode the
data that you send?  A correct stream would look something like this:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd=""
  <ns1:getQuote soapenv:encodingStyle="" xmlns:ns1="urn:xmethods-delayed-quotes">
   <ns1:symbol xsi:type="xsd:string">IBM</ns1:symbol>

It seems that with Axis2 everything is treated as a document with literal encoding.  That
is, both input/output of ServiceClient invocation is OMElement.  And is it the user's responsibility
to encode the data if necessary (use="encoded") within the payload?  Hopefully, not.  In the
old Axis 1.x codebase, you could pass in input data (along with type) and set the operation
style that you wanted to use. How do you do this in Axis2?  What is the new paradigm here
for client invocation such that I can code a client with a given set of data and work with
services that are designed as rpc/literal, rpc/encoded, doc/literal, or doc/literal/wrapped?

And my initial question was... if I have custom complexTypes, can I get Axis2 to interact
with them some way without generating the helper classes.  I want to perform dynamic generation.

Please, help to clear this up a bit for me.

Much appreciated!!!


-----Original Message-----
From: Sanjiva Weerawarana [] 
Sent: Wednesday, June 14, 2006 11:44 PM
Subject: Re: [axis2] dynamic client invocation w/o intermediate classgeneration

Hi Tony,

Have you looked at the ServiceClient API? That's precisely what that's for .. sorry for not
noticing your question earlier. 


On Wed, 2006-06-14 at 18:42 -0400, Tony Dean wrote:
> Hi,
> I had previously sent a request to determine the best way to perform  
> dynamic client invocation with axis2 or with any client framework for  
> that matter, but received no replies.  So, I will send this request  
> once again. :-)
> I know that invoking a web service on the fly without performing any  
> intermediate step (wsdl2java) is needed by more than just me.  Can  
> anyone speak to this subject?
> I have briefly looked at WSIF and JROM.  They do not seem to be  
> actively updated at this time so they may be woefully out of date.
>  Although, it seems as though I could add an axis2 provider to WSIF 
> and  use JROM to handle complexType serialization/deserialization, is 
> this  the way to go?  Has anyone crossed this bridge recently?
> Thanks for any insight on this issue.  It is greatly appreciated.
> -Tony Dean
> Tony Dean
> SAS Institute Inc.
> 919.531.6704
> SAS... The Power to Know
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message