Hi Srinath,

        thanks for your help. I tried to use wsdl2java to generate the
skleton and deploy it successfully. But as usual, I cannot see the
generated wsdl file because of the same error. then I continued to
generate the stub and then call the service throught stub.
Unfortunately, it throws exceptions. What I did is exactly following the
steps in the user guide on the section "Writing Web Service Clients
using Code Generation with Data Binding Support". Don't know why it
cannot work.

The source code is as follows:
try {
            //Create the stub by passing the AXIS_HOME and target EPR.
            //We pass null to the AXIS_HOME and hence the stub will use
the current directory as the AXIS_HOME 
            Axis2SampleDocLitServiceStub stub= new
Axis2SampleDocLitServiceStub(null,
 
"http://localhost:9080/axis2/services/Axis2SampleDocLitService";);
            
            
            //Create the request document to be sent.
            EchoStringParam  reqDoc= new EchoStringParam();
            reqDoc.setEchoStringParam("Axis2 Echo");
            //invokes the Web service.
            EchoStringReturn resDoc= stub.echoString(reqDoc);
            System.out.println(resDoc.getEchoStringReturn());

           } catch (Exception e) {
               e.printStackTrace();
           }
}

The error:
java.lang.RuntimeException: java.lang.NullPointerException
        at
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.fromOM(Axis2Samp
leDocLitServiceStub.java:2196)
        at
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.echoString(Axis2
SampleDocLitServiceStub.java:489)
        at
org.apache.axis2.userguide.client.SampleDocLitServiceClient.main(SampleD
ocLitServiceClient.java:34)
Caused by: java.lang.NullPointerException
        at
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub.fromOM(Axis2Samp
leDocLitServiceStub.java:2180)
        ... 2 more



Btw, as for the wsdl generation, I find out a link on it:
http://www.developer.com/open/article.php/3589126
It is said there are some rules on how to show the original wsdl instead
of generated one in case we want.
However, it still failed to work though I changed the configuration
based on the rules.

Now I am a bit frustrated with Axis2 as I am stucked with it for a
while. I think I will use back 1.4 at this moment.
Hopefully there are someone can come in and help on these areas asap.
Then I can switch back to Axis2, which provides a lot more exciting new
features. Thanks,

Regards,
Yabing

-----Original Message-----
From: Srinath Perera [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 07, 2006 7:32 PM
To: [email protected]
Subject: Re: weird wsdl generation in axis2


May be this is interesting .. view it as html

http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/xdocs/Axis2
-rpc-support.html


Try code generate from the wsdl and deploying it .. (see userguide)? Let
me know how it goes

I am not really familiar with what happens at the wsdl generation ..
lets wait for somebody from that area

Thanks
Srinath


On 10/7/06, Ya Bing, Chen <[EMAIL PROTECTED]> wrote:
> I c.. I will check the wsdl file again. thanks a lot!
>
> Btw, in some cases Axis2 generated error info when I try to look at 
> the generated wsdl. the error is as follows: <error>
>    <description>Unable to generate WSDL for this service</description>
>    <reason>
>       Either user has not dropped the wsdl into META-INF or operations
use message receivers  other than RPC.
>    </reason>
> </error>
>
> does it mean I have to use rawxml message receiver if I want Axis2 to 
> generate the wsdl? but I am wondering what is the difference between 
> RPC receiver and rawxml one? actually even after I changed to use RPC 
> receiver in services.xml 
> (org.apache.axis2.rpc.receivers.RPCMessageReceiver), the error remains

> there.
>
>
> -----Original Message-----
> From: Srinath Perera [mailto:[EMAIL PROTECTED]
> Sent: Fri 10/6/2006 7:02 PM
> To: [email protected]
> Subject: Re: weird wsdl generation in axis2
>
> Reason is diffent default styles in Axis2 and Axis1.x
>
> Axis1.x have rpc-encoding as default style .. so it have something 
> like <part type="MyType"> on the otherhand Axis2 does doc-literal 
> where you will have
>
> <part element = "addElement"> and
>  in your schema
>
> <elemement name="addElement" type="xsd:int"/>
>
> 1) This is not a bug
> 2) doc-literal style is preferred over rpc-encoding
>
>
>
> On 10/6/06, Ya Bing, Chen <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I started to use axis2 recently. But find out it is very strange 
> > with the generated wsdl. When I deploy my ws (*.aar), then try to 
> > take a look at the generated wsdl from the admin console.
> > Axis2 seems always generated weird and wrong wsdl for my service.
> > For example, I deploy an calculator ws. The input and output
method's
> > arguments are int.
> > But when I look at the wsdl, the generated ones become like the
> > following:
> >
> > <wsdl:message name="addMessage"/>
> > <wsdl:message name="addResponse"/>
> > <wsdl:message name="substractMessage"/>
> > <wsdl:message name="substractResponse"/>
> >
> > There supposed to be some parts elements such as: <wsdl:part 
> > name="in0" type="xsd:int"/> in the generated wsdl.
> >
> > Then I tried to drop my own wsdl inside the aar. Unfortunately, the 
> > axis2 seems cannot recognize it.
> >
> > I was using Axis1.x before, never encounter such errors. Don't know 
> > if it is bugs or some configuration errors.
> >
> > Anyone encounter the same issues as me? Pls help!
> >
> > Regards,
> > Yabing
> >
> >
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> ============================
> Srinath Perera:
>    http://www.cs.indiana.edu/~hperera/
>    http://www.bloglines.com/blog/hemapani
>
> ---------------------------------------------------------------------
> 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]
>
>


-- 
============================
Srinath Perera:
   http://www.cs.indiana.edu/~hperera/
   http://www.bloglines.com/blog/hemapani

---------------------------------------------------------------------
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