On 3/7/07, Jess Fisher <[EMAIL PROTECTED]> wrote:

I'm trying to understand what's happening here, so bear with me...
Using Axis 1.4, I run the WSDL2Java like this:
java org.apache.axis.wsdl.WSDL2Java -s -o C:\temp\generated_source
C:\temp\wsrp_service.wsdl

This created all the java interfaces for the defined wsdl:portType. See
attached java_interfaces.zip

This also automatically generated all the binding classes for the
<wsdl:binding> defined in wsrp_v1_bindings.wsdl (see my previous post where
I attached this file there)
These were all defined in wsrp_v1_bindings.wsdl:
<wsdl:binding name="WSRP_v1_Markup_Binding_SOAP"
type="intf:WSRP_v1_Markup_PortType">
<wsdl:binding name="WSRP_v1_ServiceDescription_Binding_SOAP"
type="intf:WSRP_v1_ServiceDescription_PortType">
<wsdl:binding name="WSRP_v1_Registration_Binding_SOAP"
type="intf:WSRP_v1_Registration_PortType">
<wsdl:binding name="WSRP_v1_PortletManagement_Binding_SOAP"
type="intf:WSRP_v1_PortletManagement_PortType">

The way I run Axis2's wsdl2java is as follows:
wsdl2java.bat -uri C:\temp\wsrp_service.wsdl -o C:\temp\generated_source
-ss -d adb -g -ns2p urn:oasis:names:tc:wsrp:v1:types=
oasis.names.tc.wsrp.v1.types,urn:oasis:names:tc:wsrp:v1:intf=
oasis.names.tc.wsrp.v1.intf,urn:oasis:names:tc:wsrp:v1:bind
=oasis.names.tc.wsrp.v1.bind,urn:oasis:names:tc:wsrp:v1:wsdl=
oasis.names.tc.wsrp.v1.wsdl -ssi
However when I used Axis2's wsdl2java I did not get the java interfaces
for <wsdl:portType>. Why does the axis 1.x generate the java interfaces
but axis 2 doesn't?


well Axis2 generates the interface if you have specified the -ssi parameter.
But the difference is it has the service name instead of the porttype name.
I am not familiar with the axis 1.x but actually this interface method
signatures are depends on the binding.

Also, I had to run wsdl2java seperately on wsrp_v1_bindings.wsdl before it
would read my <wsdl:binding> defined there to create my java classes for my
wsdl bindings. Note that wsrp_service.wsdl already imports
wsrp_v1_bindings.wsdl.  It also does not generate the java classes for all
my wsdl:binding (I guess due to multiple defined wsdl:binding in my wsdl
file). I get this message when I run the wsdl2java on wsrp_v1_bindings.wsdl:
org.apache.axis2.description.WSDL11ToAxisServiceBuilder findBinding
INFO: A service element was not found - picking a random binding!


In Axis2 it generates the code for only one binding in one service. So if
there is no service it creates a random service.Actually this is an axis2
limitation.

What I did to workaround this is to manually run wsdl2java on each of my
wsdl:binding, so I can get the java classes for all of my bindings. Axis
1.x wsdl2java automatically generated java classes for all my wsdl:binding
defined in wsrp_v1_bindings.wsdl.

Any thoughts?

Thanks again!

*Amila Suriarachchi <[EMAIL PROTECTED]>* wrote:



On 3/7/07, Jess Fisher <[EMAIL PROTECTED]> wrote:
>
> From the attached wsdl file:wsrp_v1_interfaces.wsdl, the following are
> defined:
> <wsdl:portType name="WSRP_v1_Markup_PortType">
> <wsdl:portType name="WSRP_v1_ServiceDescription_PortType">
> <wsdl:portType name="WSRP_v1_Registration_PortType">
> <wsdl:portType name="WSRP_v1_PortletManagement_PortType">
>
> But, when running Axis2's WSDL2Java, the corresponding java classes (for
> the wsdl:portType) are not created.
> Using Axis 1.4's WSDL2Java, the corresposing java classes were
> generated.
>

using axis2 you can not generate the code for portTypes. The reason for
this is the skelton and  and stub interfaces depends on the binding. Why you
need to generate the code for a port type?

 I run the WSDL2Java against wsrp_service.wsdl first which imports
> wsrp_v1_bindings.wsdl which then imports wsrp_v1_interfaces.wsdl.
>
> Is this a bug?
>

no I  believe.

 If yes, does anybody know of the bug ID ? I cannot find it in JIRA.
> Or is there a WSDL2Java option I need to set to generate java classes
> for the portType, specifically?
>

if you do not have specified any parts or namespace ( in rpc) in soap:body
(in your binding)  and generate the code with parameters -ss -sd -ssi  and
with any binding (-d adb, -d jibx, -d xmlbeans, -d jaxbri) I think you can
get what you need. It simply generates the skelton, skelton interface and
the service.xml.

 (I've used -ss, -g, -d adb, -ssi)
>
> Thanks.
>
>  ------------------------------
> Need Mail bonding?
> Go to the Yahoo! Mail 
Q&A<http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091>for
 great
> tips from Yahoo! 
Answers<http://answers.yahoo.com/dir/index;_ylc=X3oDMTFvbGNhMGE3BF9TAzM5NjU0NTEwOARfcwMzOTY1NDUxMDMEc2VjA21haWxfdGFnbGluZQRzbGsDbWFpbF90YWcx?link=ask&sid=396546091>users.
 --0-1424838073-1173226094=:65510--
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Amila Suriarachchi,
WSO2 Inc.


------------------------------
It's here! Your new message!
Get new email 
alerts<http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/>with
 the free Yahoo!
Toolbar. --0-1402565997-1173253433=:40062--


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




--
Amila Suriarachchi,
WSO2 Inc.

Reply via email to