You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Thilo Frotscher <th...@web.de> on 2006/12/11 04:05:51 UTC

[Axis2] More questions on WSDL2Java options

Hi!

I have some more questions on some of the WSDL2Java options as I
can't find sufficient documentation for them.

-r: specifies the repository against which the code is generated...
What effect does this have on the result? When would this be
useful or what's the use case?

-em: this is to specify an external mapping file. For what kind
of mapping?

- uw: switches on unwrapping. Of What? Does this refer to wrapped
SOAP message style? Where can I find an example?

-b: I can see what this option is doing, but what is the actual
purpose of it??

I also found that the official User Guide documents different sets
of options for the command-line tool and the Ant task. Both sets
are again different from the set of options that is diplayed in
the usage information when invoking WSDL2Java at the command-line.
This should be consolidated.


Thanks,
Thilo

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Amila Suriarachchi <am...@gmail.com>.
On 12/12/06, Thilo Frotscher <th...@web.de> wrote:
>
>
> > Think of it as this. The skeleton is not dependant on any Axis2
> > Specific libraries (unless you use either ADB or no databinding - even
> > in the ADB case the helper mode will cause plain java beans to be
> > generated with no traces of Axis2 specifics).
>
> How can you use the Helper Mode with WSDL2Java?  The relevant section in
> the documentation is empty (or white characters on white background :-))
> -> http://ws.apache.org/axis2/1_1/adb/adb-advanced.html#helper


use -Eh option

> If you do have a Axis1
> > skeleton already written then you can actually just place that class
> > and make it work in this case (perhaps with minor modifications but no
> > big changes that span the whole set of generated classes)
>
> If I don't use ADB or AXIOM,


AXIOM is not a  data binding framwork.

the remaining options would be XML Beans,
> JiBX, JaxMe or JAXB-RI. However these were not exactly the most popular
> options for XML data binding with Axis 1.x :-)




you can't use the xml beans. but you can use the JAXB-RI. I am not sure
about the jibx and JaxMe.
the idea here is to generate a java file with the same name and method
signatures as in axis 1.x.
I will describe this later.


Sorry, I still don't see how I could easily re-use an Axis 1.x skeleton.
> If I use the normal RPCProvider or MsgProvider with Axis 1.x, these would
> pass either POJOs into my service methods or DOM objects. So this is how
> my method signatures would look like in an Axis 1.x skeleton. I don't
> understandhow I should use/configure the WSDL2Java that comes with Axis2,
> so that it generates a MessageReceiver which either passes POJOs or DOM
> objects into a skeleton.


the backword compatibility feature is not complete in 1.1. please  take a
build from the trunk.
Here axis 1.x skelton means the generated skelton with the Axis 1.x  code
generation tool ( with a wsdl). This generated skelton is similar to normal
axis2 generated code but have two differences.

1. have a different file name
2. Lets say we have an element as follows as an input element for an axis
operation
<xs:element name="AddDisputeRequest" type="ns:AddDisputeRequestType"/>

the axis2 method signature is some thing like this
methodName(AddDisputeRequest addDisputeRequest);
and for axis 1.x
methodName(AddDisputeRequestType addDisputeRequestType);

As you can see axis1.x parameters are always unwraped.

So when you enable the -b (backword compatibility) option it generates a
same code as axis 1.x for axis 2 skelton class.

So you can replace this generated file with your existing axis 1.x skelton
(since they have same method signature and the file name) without doing any
change to generated axis2 code.

Amila


-- 
Amila Suriarachchi,
Software Engineer,
WSO2 Inc.

RE: [Axis2] More questions on WSDL2Java options

Posted by Ernie Ho <er...@oracle.com>.
Hi Axis folks,

   I'm new to Axis.  And I have the following questions:

1) what version of Axis does Jboss (particulary 4.0) support?

2) I used Axis 1.4 to generate Java classes from my WSDLs.  I re-peated the process using Axis 1.1 (since Jboss doesn't seem to support some of the libraries my classes need),  however,  I observe the intersting behavior that the classes generated by Axis 1.1 seem to make refernces to libaries existing only in Axis 1.2 +.   Any ideas?


Thanks,

Ernie 

-----Original Message-----
From: Thilo Frotscher [mailto:thilo.frotscher@web.de] 
Sent: Monday, December 11, 2006 6:58 PM
To: axis-dev@ws.apache.org
Subject: Re: [Axis2] More questions on WSDL2Java options


> Think of it as this. The skeleton is not dependant on any Axis2 
> Specific libraries (unless you use either ADB or no databinding - even 
> in the ADB case the helper mode will cause plain java beans to be 
> generated with no traces of Axis2 specifics).

How can you use the Helper Mode with WSDL2Java?  The relevant section in the documentation is empty (or white characters on white background :-))
-> http://ws.apache.org/axis2/1_1/adb/adb-advanced.html#helper

> If you do have a Axis1
> skeleton already written then you can actually just place that class 
> and make it work in this case (perhaps with minor modifications but no 
> big changes that span the whole set of generated classes)

If I don't use ADB or AXIOM, the remaining options would be XML Beans, JiBX, JaxMe or JAXB-RI. However these were not exactly the most popular options for XML data binding with Axis 1.x :-)

Sorry, I still don't see how I could easily re-use an Axis 1.x skeleton.
If I use the normal RPCProvider or MsgProvider with Axis 1.x, these would pass either POJOs into my service methods or DOM objects. So this is how my method signatures would look like in an Axis 1.x skeleton. I don't understandhow I should use/configure the WSDL2Java that comes with Axis2, so that it generates a MessageReceiver which either passes POJOs or DOM objects into a skeleton.

Thanks,
Thilo

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Thilo Frotscher <th...@web.de>.
> Think of it as this. The skeleton is not dependant on any Axis2
> Specific libraries (unless you use either ADB or no databinding - even
> in the ADB case the helper mode will cause plain java beans to be
> generated with no traces of Axis2 specifics). 

How can you use the Helper Mode with WSDL2Java?  The relevant section in
the documentation is empty (or white characters on white background :-))
-> http://ws.apache.org/axis2/1_1/adb/adb-advanced.html#helper

> If you do have a Axis1
> skeleton already written then you can actually just place that class
> and make it work in this case (perhaps with minor modifications but no
> big changes that span the whole set of generated classes)

If I don't use ADB or AXIOM, the remaining options would be XML Beans,
JiBX, JaxMe or JAXB-RI. However these were not exactly the most popular
options for XML data binding with Axis 1.x :-)

Sorry, I still don't see how I could easily re-use an Axis 1.x skeleton.
If I use the normal RPCProvider or MsgProvider with Axis 1.x, these would
pass either POJOs into my service methods or DOM objects. So this is how
my method signatures would look like in an Axis 1.x skeleton. I don't
understandhow I should use/configure the WSDL2Java that comes with Axis2,
so that it generates a MessageReceiver which either passes POJOs or DOM
objects into a skeleton.

Thanks,
Thilo

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi,

>
> Which are the valid values for the attribute "dbf"?
> adb, xmlbeans, jaxme, jibx, jaxbri?

Yes, basically the databinding types that are registered with the
system (see the  codegen.databinding.frameworks entry in the
codegen-config.properties file) are allowed here

> What happens if the properties of the existing classes don't match
> the datatypes defined in XSD. Does the code generator check that?

Nope - usually what happens is that the extension that processes this
is at the last (or near to the last) of the extension chain so there
it overrides the whatever the populated mappings. Its upto the user to
determine whether he wants to use custom mappings or not and when he
does so it becomes his responsibility to make sure the classes are
compatible! The system just copies the entries in the file to the
internal mapping structure.


> Just to make sure that I got this right: this option is about the
> method signatures in the classes, *regardless* of the SOAP message
> style that is used. Or does this option only apply if a particular
> SOAP message style is used?

Well kind of  - The rpc/lit style is the primary style we can unwrap
but if the schema is compatible you can even unwrap a doc/lit WSDL.
However the system, when unwrapping is specified, tries to unwrap
regardless of the style.
>
> If this option is for ADB only, shouldn't it be -Euw instead?

No - even XMLBeans can be unwrapped (And jibx too) . So its a top
level option rather than a specific one.


> Yes, the classnames look more like Axis 1.x. But they are still dependent
> on Axis2 libs. So why would I want to use this option? Can you give an
> example when this is needed, please.
>

Think of it as this. The skeleton is not dependant on any Axis2
Specific libraries (unless you use either ADB or no databinding - even
in the ADB case the helper mode will cause plain java beans to be
generated with no traces of Axis2 specifics). If you do have a Axis1
skeleton already written then you can actually just place that class
and make it work in this case (perhaps with minor modifications but no
big changes that span the whole set of generated classes)

HTH

-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Thilo Frotscher <th...@web.de>.
Hi!

>> -em: this is to specify an external mapping file. For what kind
>> of mapping?
> 
> External databinding mappings. There has been numerous cases where
> users wanted to use the classes they already have (say the XMLBeans
> classes they've already generated seperately) rather than codegen
> generating them. The mapping file is an xml file in the following
> format
> 
> <mappings dbf="adb">
>    <mapping>
>          <qname namespace="ns" prefix="p1">localName</qname>
>          <value>type</value>
>      </mapping>
> </mappings>

Which are the valid values for the attribute "dbf"?
adb, xmlbeans, jaxme, jibx, jaxbri?

What happens if the properties of the existing classes don't match
the datatypes defined in XSD. Does the code generator check that?


>> - uw: switches on unwrapping. Of What? Does this refer to wrapped
>> SOAP message style? Where can I find an example?
> 
> I guess Dennis gave a good explanation of this. ADB unwrapping indeed
> works but it may 'glitch'  in some extreme cases. Anyway the
> noticeable change for the user is the change in the method signature.

Just to make sure that I got this right: this option is about the
method signatures in the classes, *regardless* of the SOAP message
style that is used. Or does this option only apply if a particular
SOAP message style is used?

If this option is for ADB only, shouldn't it be -Euw instead?


>> -b: I can see what this option is doing, but what is the actual
>> purpose of it??
> 
> Backward compatibility flag. This basically drills down to the naming
> of the classes that are generated. When the flag is on, the generated
> class names are compatible with the Axis 1.x style ( that is why its
> called backward compatible flag :))

Yes, the classnames look more like Axis 1.x. But they are still dependent
on Axis2 libs. So why would I want to use this option? Can you give an
example when this is needed, please.

Thanks,
Thilo


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hi Thilo,
Here are some small explanations of what each option does


>
> -r: specifies the repository against which the code is generated...
> What effect does this have on the result? When would this be
> useful or what's the use case?

The usecase for this is codegenerating with a WSDL that has WS-Policy
statements. When you have policy statements the system should know
what the assertions are and how to deal with them. This is done by
using the modules in a repository and hence a repository needs to be
pointed out. This has no effect if you don't have any WSP entries in
your WSDL.

>
> -em: this is to specify an external mapping file. For what kind
> of mapping?

External databinding mappings. There has been numerous cases where
users wanted to use the classes they already have (say the XMLBeans
classes they've already generated seperately) rather than codegen
generating them. The mapping file is an xml file in the following
format

 <mappings dbf="adb">
    <mapping>
          <qname namespace="ns" prefix="p1">localName</qname>
          <value>type</value>
      </mapping>
 </mappings>

Note that the mapping element can be repeated.
So basically the system picks up classes that are specified rather
than generating them. However you can specify only the ones that you
want to replace where the system will generate the rest.

>
> - uw: switches on unwrapping. Of What? Does this refer to wrapped
> SOAP message style? Where can I find an example?

I guess Dennis gave a good explanation of this. ADB unwrapping indeed
works but it may 'glitch'  in some extreme cases. Anyway the
noticeable change for the user is the change in the method signature.

>
> -b: I can see what this option is doing, but what is the actual
> purpose of it??

Backward compatibility flag. This basically drills down to the naming
of the classes that are generated. When the flag is on, the generated
class names are compatible with the Axis 1.x style ( that is why its
called backward compatible flag :))
>
> I also found that the official User Guide documents different sets
> of options for the command-line tool and the Ant task. Both sets
> are again different from the set of options that is diplayed in
> the usage information when invoking WSDL2Java at the command-line.
> This should be consolidated.

Yes I agree. This is another classic case of documentation being slow
in synchronizing with the changes in the code. I'm tied till thursday
this week but I'll see whether I can clear things up by the weekend.
(Unless of course somebody else jumps up and finishes it before then
;))
>
> Thanks,
> Thilo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Thilo Frotscher <th...@web.de>.
Thanks Dennis.
Does anyone have any information about the other options?


Thilo Frotscher wrote:
 >
 > -r: specifies the repository against which the code is generated...
 > What effect does this have on the result? When would this be
 > useful or what's the use case?
 >
 > -em: this is to specify an external mapping file. For what kind
 > of mapping?
 >
 > - uw: switches on unwrapping. Of What? Does this refer to wrapped
 > SOAP message style? Where can I find an example?
 >
 > -b: I can see what this option is doing, but what is the actual
 > purpose of it??
 >
 > I also found that the official User Guide documents different sets
 > of options for the command-line tool and the Ant task. Both sets
 > are again different from the set of options that is diplayed in
 > the usage information when invoking WSDL2Java at the command-line.
 > This should be consolidated.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: [Axis2] More questions on WSDL2Java options

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Thilo Frotscher wrote:
>
> ...
>
> - uw: switches on unwrapping. Of What? Does this refer to wrapped
> SOAP message style? Where can I find an example?
>
Yes, this refers to wrapped message style. ADB partially implements 
unwrapped handling (though I believe it's not considered a supported 
feature in 1.1), and JiBX fully implements unwrapped handling (though 
I've found some bugs in this since 1.1 - see 
http://www.sosnoski.com/jibx-wiki/space/axis2-jibx for the latest test 
code). You can see an example of the JiBX unwrapped handling in the 
distribution documents at 
/docs/xdocs/1_1/jibx/jibx-unwrapped-example.html I'm working through 
some more test cases for the JiBX unwrapped handling this week, and will 
then submit the fixes in hopes of having them included in an official 
Axis2 1.1.1 release.

  - Dennis

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org