You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by adrian rutle <ad...@rutle.no> on 2006/11/14 18:55:29 UTC

Re: PLEASE HELP client-side Axis2SampleDocLit

I am getting many emails on this list, but nobody answers my simple 
question. I am supposed to give a talk tomorrow about Axis2 and have 
used more than one week working with this "technology". I am getting 
nowhere... If a release doesn't work, why do they release it?? Very bad 
documentation that says nothing about running clients and problems that 
one may run into ...

I don't knwo how a class can compile, but can't run because 
org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar 
that contains this class is. Anybody knows? I have added all the jars 
from axis2\lib to the jar directory of java, but it doesn't help...

Please, I need help, desparately ;-)

D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
-
cp .;org\apache\axis2\userguide;..\..\..\lib  
org.apache.axis2.userguide.TestCli
ent
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/axis2/clie
nt/Stub
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>

adrian rutle skrev:
> Hi
>
> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
> -
> cp 
> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph 
>
> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit 
>
> Client\build\classes\org\apache\axis2\userguide 
> org.apache.axis2.userguide.TestClient
>
>
> Gives:
>
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/axis2/user
> guide/TestClient
>
>
>
> I am sure that the class file TestClient exists in that folder.
>
> package org.apache.axis2.userguide;
> import org.apache.axis2.userguide.*;
> import org.apache.axis2.userguide.axis2sampledoclit.*;
> import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>
> public class TestClient
> {
>    public static void main(String []args){
>        System.out.println("\t=== we try to run our TestClient");
>              try
>        {
>            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
>                = new 
> org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>                
> "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>            //Create the request document to be sent.
>            
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
>                
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>
>                      
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString 
> es = reqDoc.getEchoString();
>            es.setEchoStringParam("Axis2 Echo");
>            //invokes the Web service.
>            
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
> resDoc =
>                stub.echoString(reqDoc);
>            
> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
>        }
>        catch (java.rmi.RemoteException e)
>        {
>            e.printStackTrace();
>        }
>          }
>
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>


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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by adrian rutle <ad...@rutle.no>.
The implementaion that is given in the docs here 
http://ws.apache.org/axis2/1_1/src/Axis2SampleDocLitServiceCode.html
gives me some incompatibility problems. Here is the code that wsdl2java 
generates with my changes to make it "work"

SERVER:

    /**
     * Axis2SampleDocLitServiceSkeleton.java
     *
     * This file was auto-generated from WSDL
     * by the Apache Axis2 version: 1.1 Nov 13, 2006 (07:31:44 LKT)
     */
    package org.apache.axis2.userguide;
    import org.apache.axis2.userguide.*;
    import org.apache.axis2.userguide.axis2sampledoclit.*;

    /**
     *  Axis2SampleDocLitServiceSkeleton java skeleton for the axisService
     */
    public class Axis2SampleDocLitServiceSkeleton
    {
    
        
        /**
         * Auto generated method signature
        
          * @param param0
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayResponseDocument 
echoStringArray
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayDocument param0
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoStringArray");
            System.out.println("\t=== EchoStringArray====");
            return null;
        }
    
        
        /**
         * Auto generated method signature
        
          * @param param2
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStructResponseDocument 
echoStruct
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStructDocument param2
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoStruct");
            System.out.println("\t=== EchoStruct====");
            return null;

        }
    
        
        /**
         * Auto generated method signature
        
          * @param param4
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
echoString
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument param4
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoString");
            System.out.println("\t=== EchoString====");
            //Use the factory to create the output document.
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
retDoc =
                
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument.Factory.newInstance();
            //send the string back.
            //retDoc.setEchoStringReturn("hihhhahahahahah");
            return retDoc;
        }
    
    }
   


CLIENT:

package org.apache.axis2.userguide;
import org.apache.axis2.userguide.*;
import org.apache.axis2.userguide.axis2sampledoclit.*;
import org.apache.axis2.userguide.axis2sampledoclit.impl.*;

public class TestClient
{
    public static void main(String []args){
        System.out.println("\t=== we try to run our TestClient");
       
        try
        {
            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
                = new 
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
                
"http://localhost:8080/axis2/services/Axis2SampleDocLitService");
            //Create the request document to be sent.
       
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
                
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();

            System.out.println("The Stub is created, hurra!");

            reqDoc.getEchoString().setEchoStringParam("Axis2 Echo");
            //invokes the Web service.
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
resDoc =
                stub.echoString(reqDoc);
            
System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
       
        }
        catch (java.rmi.RemoteException e)
        {
            e.printStackTrace();
        }
       
    }

}


adrian rutle skrev:
> Paul Fremantle skrev:
>> Adrian
>>
>> As far as I can see you are trying to persuade java to include every
>> class in the lib directory by specifying -cp c:\axis2-1.1\lib
>>
> Thanks, I have now solved this issue. I have to say that it's been a 
> while since the last time I progammed in Java...
> Now it's this code whic makes me crazy:
>
> try
>        {
>            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
>                = new 
> org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>                
> "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>            //Create the request document to be sent.
>                  
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
>                
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>
>
>            System.out.println("The Stub is created, hurra!");
>
>            reqDoc.getEchoString().setEchoStringParam("Axis2 Echo");
>            //invokes the Web service.
>            
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
> resDoc =
>                stub.echoString(reqDoc);
>            
> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
>              }
>        catch (java.rmi.RemoteException e)
>        {
>            e.printStackTrace();
>        }
>
>> Java's classpath doesn't work that way. You need to specify all the
>> jars individually, or use this syntax:
>>
>> -Djava.ext.dirs=c:\axis2-1.1\lib
>> which automatically adds all the JARs in that directory to the 
>> classpath.
>>
>> Paul
>>
>> On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
>>> Paul Fremantle skrev:
>>> > Adrian
>>> >
>>> > What version are you using?
>>> >
>>> version 2, release 1.1
>>> http://ws.apache.org/axis2/1_1/contents.html
>>> > Paul
>>> >
>>> > On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
>>> >> I am getting many emails on this list, but nobody answers my simple
>>> >> question. I am supposed to give a talk tomorrow about Axis2 and have
>>> >> used more than one week working with this "technology". I am getting
>>> >> nowhere... If a release doesn't work, why do they release it?? 
>>> Very bad
>>> >> documentation that says nothing about running clients and 
>>> problems that
>>> >> one may run into ...
>>> >>
>>> >> I don't knwo how a class can compile, but can't run because
>>> >> org.apache.axis2.client.Stub doesn't exit? I can't find where the 
>>> Jar
>>> >> that contains this class is. Anybody knows? I have added all the 
>>> jars
>>> >> from axis2\lib to the jar directory of java, but it doesn't help...
>>> >>
>>> >> Please, I need help, desparately ;-)
>>> >>
>>> >> 
>>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>>
>>> >>
>>> >> -
>>> >> cp .;org\apache\axis2\userguide;..\..\..\lib
>>> >> org.apache.axis2.userguide.TestCli
>>> >> ent
>>> >> Exception in thread "main" java.lang.NoClassDefFoundError:
>>> >> org/apache/axis2/clie
>>> >> nt/Stub
>>> >>         at java.lang.ClassLoader.defineClass1(Native Method)
>>> >>         at java.lang.ClassLoader.defineClass(Unknown Source)
>>> >>         at java.security.SecureClassLoader.defineClass(Unknown 
>>> Source)
>>> >>         at java.net.URLClassLoader.defineClass(Unknown Source)
>>> >>         at java.net.URLClassLoader.access$100(Unknown Source)
>>> >>         at java.net.URLClassLoader$1.run(Unknown Source)
>>> >>         at java.security.AccessController.doPrivileged(Native 
>>> Method)
>>> >>         at java.net.URLClassLoader.findClass(Unknown Source)
>>> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>> >>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown 
>>> Source)
>>> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>> >>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>> >>
>>> >> 
>>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes> 
>>>
>>> >>
>>> >>
>>> >> adrian rutle skrev:
>>> >> > Hi
>>> >> >
>>> >> >
>>> >> 
>>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>>
>>> >>
>>> >> > -
>>> >> > cp
>>> >> >
>>> >> 
>>> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph 
>>>
>>> >>
>>> >> >
>>> >> >
>>> >> 
>>> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit 
>>>
>>> >>
>>> >> >
>>> >> > Client\build\classes\org\apache\axis2\userguide
>>> >> > org.apache.axis2.userguide.TestClient
>>> >> >
>>> >> >
>>> >> > Gives:
>>> >> >
>>> >> > Exception in thread "main" java.lang.NoClassDefFoundError:
>>> >> > org/apache/axis2/user
>>> >> > guide/TestClient
>>> >> >
>>> >> >
>>> >> >
>>> >> > I am sure that the class file TestClient exists in that folder.
>>> >> >
>>> >> > package org.apache.axis2.userguide;
>>> >> > import org.apache.axis2.userguide.*;
>>> >> > import org.apache.axis2.userguide.axis2sampledoclit.*;
>>> >> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>>> >> >
>>> >> > public class TestClient
>>> >> > {
>>> >> >    public static void main(String []args){
>>> >> >        System.out.println("\t=== we try to run our TestClient");
>>> >> >              try
>>> >> >        {
>>> >> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub
>>> >> stub
>>> >> >                = new
>>> >> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>>> >> >
>>> >> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>>> >> >            //Create the request document to be sent.
>>> >> >
>>> >> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument
>>> >> reqDoc =
>>> >> >
>>> >> >
>>> >> 
>>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>>>
>>> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> 
>>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString 
>>>
>>> >>
>>> >> > es = reqDoc.getEchoString();
>>> >> >            es.setEchoStringParam("Axis2 Echo");
>>> >> >            //invokes the Web service.
>>> >> >
>>> >> >
>>> >> 
>>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
>>> >> > resDoc =
>>> >> >                stub.echoString(reqDoc);
>>> >> >
>>> >> >
>>> >> 
>>> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn()); 
>>>
>>> >>
>>> >> >        }
>>> >> >        catch (java.rmi.RemoteException e)
>>> >> >        {
>>> >> >            e.printStackTrace();
>>> >> >        }
>>> >> >          }
>>> >> >
>>> >> > }
>>> >> >
>>> >> > 
>>> ---------------------------------------------------------------------
>>> >> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> >> > For additional commands, e-mail: axis-user-help@ws.apache.org
>>> >> >
>>> >>
>>> >>
>>> >> 
>>> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> >> For additional commands, e-mail: axis-user-help@ws.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>


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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by adrian rutle <ad...@rutle.no>.
Paul Fremantle skrev:
> Adrian
>
> As far as I can see you are trying to persuade java to include every
> class in the lib directory by specifying -cp c:\axis2-1.1\lib
>
Thanks, I have now solved this issue. I have to say that it's been a 
while since the last time I progammed in Java...
Now it's this code whic makes me crazy:

try
        {
            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
                = new 
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
                
"http://localhost:8080/axis2/services/Axis2SampleDocLitService");
            //Create the request document to be sent.
       
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
                
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();

            System.out.println("The Stub is created, hurra!");

            reqDoc.getEchoString().setEchoStringParam("Axis2 Echo");
            //invokes the Web service.
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
resDoc =
                stub.echoString(reqDoc);
            
System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
       
        }
        catch (java.rmi.RemoteException e)
        {
            e.printStackTrace();
        }

> Java's classpath doesn't work that way. You need to specify all the
> jars individually, or use this syntax:
>
> -Djava.ext.dirs=c:\axis2-1.1\lib
> which automatically adds all the JARs in that directory to the classpath.
>
> Paul
>
> On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
>> Paul Fremantle skrev:
>> > Adrian
>> >
>> > What version are you using?
>> >
>> version 2, release 1.1
>> http://ws.apache.org/axis2/1_1/contents.html
>> > Paul
>> >
>> > On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
>> >> I am getting many emails on this list, but nobody answers my simple
>> >> question. I am supposed to give a talk tomorrow about Axis2 and have
>> >> used more than one week working with this "technology". I am getting
>> >> nowhere... If a release doesn't work, why do they release it?? 
>> Very bad
>> >> documentation that says nothing about running clients and problems 
>> that
>> >> one may run into ...
>> >>
>> >> I don't knwo how a class can compile, but can't run because
>> >> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
>> >> that contains this class is. Anybody knows? I have added all the jars
>> >> from axis2\lib to the jar directory of java, but it doesn't help...
>> >>
>> >> Please, I need help, desparately ;-)
>> >>
>> >> 
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> >>
>> >> -
>> >> cp .;org\apache\axis2\userguide;..\..\..\lib
>> >> org.apache.axis2.userguide.TestCli
>> >> ent
>> >> Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> org/apache/axis2/clie
>> >> nt/Stub
>> >>         at java.lang.ClassLoader.defineClass1(Native Method)
>> >>         at java.lang.ClassLoader.defineClass(Unknown Source)
>> >>         at java.security.SecureClassLoader.defineClass(Unknown 
>> Source)
>> >>         at java.net.URLClassLoader.defineClass(Unknown Source)
>> >>         at java.net.URLClassLoader.access$100(Unknown Source)
>> >>         at java.net.URLClassLoader$1.run(Unknown Source)
>> >>         at java.security.AccessController.doPrivileged(Native Method)
>> >>         at java.net.URLClassLoader.findClass(Unknown Source)
>> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
>> >>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
>> >>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> >>
>> >> 
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes> 
>>
>> >>
>> >>
>> >> adrian rutle skrev:
>> >> > Hi
>> >> >
>> >> >
>> >> 
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> >>
>> >> > -
>> >> > cp
>> >> >
>> >> 
>> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph 
>>
>> >>
>> >> >
>> >> >
>> >> 
>> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit 
>>
>> >>
>> >> >
>> >> > Client\build\classes\org\apache\axis2\userguide
>> >> > org.apache.axis2.userguide.TestClient
>> >> >
>> >> >
>> >> > Gives:
>> >> >
>> >> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> > org/apache/axis2/user
>> >> > guide/TestClient
>> >> >
>> >> >
>> >> >
>> >> > I am sure that the class file TestClient exists in that folder.
>> >> >
>> >> > package org.apache.axis2.userguide;
>> >> > import org.apache.axis2.userguide.*;
>> >> > import org.apache.axis2.userguide.axis2sampledoclit.*;
>> >> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>> >> >
>> >> > public class TestClient
>> >> > {
>> >> >    public static void main(String []args){
>> >> >        System.out.println("\t=== we try to run our TestClient");
>> >> >              try
>> >> >        {
>> >> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub
>> >> stub
>> >> >                = new
>> >> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>> >> >
>> >> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>> >> >            //Create the request document to be sent.
>> >> >
>> >> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument
>> >> reqDoc =
>> >> >
>> >> >
>> >> 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>>
>> >>
>> >> >
>> >> >
>> >> >
>> >> 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString 
>>
>> >>
>> >> > es = reqDoc.getEchoString();
>> >> >            es.setEchoStringParam("Axis2 Echo");
>> >> >            //invokes the Web service.
>> >> >
>> >> >
>> >> 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
>> >> > resDoc =
>> >> >                stub.echoString(reqDoc);
>> >> >
>> >> >
>> >> 
>> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn()); 
>>
>> >>
>> >> >        }
>> >> >        catch (java.rmi.RemoteException e)
>> >> >        {
>> >> >            e.printStackTrace();
>> >> >        }
>> >> >          }
>> >> >
>> >> > }
>> >> >
>> >> > 
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> >> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >> >
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> >> For additional commands, e-mail: axis-user-help@ws.apache.org
>> >>
>> >>
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>


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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by Paul Fremantle <pz...@gmail.com>.
Adrian

As far as I can see you are trying to persuade java to include every
class in the lib directory by specifying -cp c:\axis2-1.1\lib

Java's classpath doesn't work that way. You need to specify all the
jars individually, or use this syntax:

-Djava.ext.dirs=c:\axis2-1.1\lib
which automatically adds all the JARs in that directory to the classpath.

Paul

On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
> Paul Fremantle skrev:
> > Adrian
> >
> > What version are you using?
> >
> version 2, release 1.1
> http://ws.apache.org/axis2/1_1/contents.html
> > Paul
> >
> > On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
> >> I am getting many emails on this list, but nobody answers my simple
> >> question. I am supposed to give a talk tomorrow about Axis2 and have
> >> used more than one week working with this "technology". I am getting
> >> nowhere... If a release doesn't work, why do they release it?? Very bad
> >> documentation that says nothing about running clients and problems that
> >> one may run into ...
> >>
> >> I don't knwo how a class can compile, but can't run because
> >> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
> >> that contains this class is. Anybody knows? I have added all the jars
> >> from axis2\lib to the jar directory of java, but it doesn't help...
> >>
> >> Please, I need help, desparately ;-)
> >>
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> >>
> >> -
> >> cp .;org\apache\axis2\userguide;..\..\..\lib
> >> org.apache.axis2.userguide.TestCli
> >> ent
> >> Exception in thread "main" java.lang.NoClassDefFoundError:
> >> org/apache/axis2/clie
> >> nt/Stub
> >>         at java.lang.ClassLoader.defineClass1(Native Method)
> >>         at java.lang.ClassLoader.defineClass(Unknown Source)
> >>         at java.security.SecureClassLoader.defineClass(Unknown Source)
> >>         at java.net.URLClassLoader.defineClass(Unknown Source)
> >>         at java.net.URLClassLoader.access$100(Unknown Source)
> >>         at java.net.URLClassLoader$1.run(Unknown Source)
> >>         at java.security.AccessController.doPrivileged(Native Method)
> >>         at java.net.URLClassLoader.findClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
> >>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> >>
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>
> >>
> >>
> >> adrian rutle skrev:
> >> > Hi
> >> >
> >> >
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> >>
> >> > -
> >> > cp
> >> >
> >> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph
> >>
> >> >
> >> >
> >> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit
> >>
> >> >
> >> > Client\build\classes\org\apache\axis2\userguide
> >> > org.apache.axis2.userguide.TestClient
> >> >
> >> >
> >> > Gives:
> >> >
> >> > Exception in thread "main" java.lang.NoClassDefFoundError:
> >> > org/apache/axis2/user
> >> > guide/TestClient
> >> >
> >> >
> >> >
> >> > I am sure that the class file TestClient exists in that folder.
> >> >
> >> > package org.apache.axis2.userguide;
> >> > import org.apache.axis2.userguide.*;
> >> > import org.apache.axis2.userguide.axis2sampledoclit.*;
> >> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
> >> >
> >> > public class TestClient
> >> > {
> >> >    public static void main(String []args){
> >> >        System.out.println("\t=== we try to run our TestClient");
> >> >              try
> >> >        {
> >> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub
> >> stub
> >> >                = new
> >> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
> >> >
> >> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
> >> >            //Create the request document to be sent.
> >> >
> >> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument
> >> reqDoc =
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();
> >>
> >> >
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString
> >>
> >> > es = reqDoc.getEchoString();
> >> >            es.setEchoStringParam("Axis2 Echo");
> >> >            //invokes the Web service.
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> >> > resDoc =
> >> >                stub.echoString(reqDoc);
> >> >
> >> >
> >> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
> >>
> >> >        }
> >> >        catch (java.rmi.RemoteException e)
> >> >        {
> >> >            e.printStackTrace();
> >> >        }
> >> >          }
> >> >
> >> > }
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by adrian rutle <ad...@rutle.no>.
Paul Fremantle skrev:
> Adrian
>
> What version are you using?
>
version 2, release 1.1
http://ws.apache.org/axis2/1_1/contents.html
> Paul
>
> On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
>> I am getting many emails on this list, but nobody answers my simple
>> question. I am supposed to give a talk tomorrow about Axis2 and have
>> used more than one week working with this "technology". I am getting
>> nowhere... If a release doesn't work, why do they release it?? Very bad
>> documentation that says nothing about running clients and problems that
>> one may run into ...
>>
>> I don't knwo how a class can compile, but can't run because
>> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
>> that contains this class is. Anybody knows? I have added all the jars
>> from axis2\lib to the jar directory of java, but it doesn't help...
>>
>> Please, I need help, desparately ;-)
>>
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> -
>> cp .;org\apache\axis2\userguide;..\..\..\lib
>> org.apache.axis2.userguide.TestCli
>> ent
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/axis2/clie
>> nt/Stub
>>         at java.lang.ClassLoader.defineClass1(Native Method)
>>         at java.lang.ClassLoader.defineClass(Unknown Source)
>>         at java.security.SecureClassLoader.defineClass(Unknown Source)
>>         at java.net.URLClassLoader.defineClass(Unknown Source)
>>         at java.net.URLClassLoader.access$100(Unknown Source)
>>         at java.net.URLClassLoader$1.run(Unknown Source)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes> 
>>
>>
>> adrian rutle skrev:
>> > Hi
>> >
>> > 
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> > -
>> > cp
>> > 
>> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph 
>>
>> >
>> > 
>> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit 
>>
>> >
>> > Client\build\classes\org\apache\axis2\userguide
>> > org.apache.axis2.userguide.TestClient
>> >
>> >
>> > Gives:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > org/apache/axis2/user
>> > guide/TestClient
>> >
>> >
>> >
>> > I am sure that the class file TestClient exists in that folder.
>> >
>> > package org.apache.axis2.userguide;
>> > import org.apache.axis2.userguide.*;
>> > import org.apache.axis2.userguide.axis2sampledoclit.*;
>> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>> >
>> > public class TestClient
>> > {
>> >    public static void main(String []args){
>> >        System.out.println("\t=== we try to run our TestClient");
>> >              try
>> >        {
>> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub 
>> stub
>> >                = new
>> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>> >
>> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>> >            //Create the request document to be sent.
>> >
>> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument 
>> reqDoc =
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>>
>> >
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString 
>>
>> > es = reqDoc.getEchoString();
>> >            es.setEchoStringParam("Axis2 Echo");
>> >            //invokes the Web service.
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
>> > resDoc =
>> >                stub.echoString(reqDoc);
>> >
>> > 
>> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn()); 
>>
>> >        }
>> >        catch (java.rmi.RemoteException e)
>> >        {
>> >            e.printStackTrace();
>> >        }
>> >          }
>> >
>> > }
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>


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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by Paul Fremantle <pz...@gmail.com>.
Adrian

What version are you using?

Paul

On 11/14/06, adrian rutle <ad...@rutle.no> wrote:
> I am getting many emails on this list, but nobody answers my simple
> question. I am supposed to give a talk tomorrow about Axis2 and have
> used more than one week working with this "technology". I am getting
> nowhere... If a release doesn't work, why do they release it?? Very bad
> documentation that says nothing about running clients and problems that
> one may run into ...
>
> I don't knwo how a class can compile, but can't run because
> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
> that contains this class is. Anybody knows? I have added all the jars
> from axis2\lib to the jar directory of java, but it doesn't help...
>
> Please, I need help, desparately ;-)
>
> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> -
> cp .;org\apache\axis2\userguide;..\..\..\lib
> org.apache.axis2.userguide.TestCli
> ent
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/axis2/clie
> nt/Stub
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(Unknown Source)
>         at java.security.SecureClassLoader.defineClass(Unknown Source)
>         at java.net.URLClassLoader.defineClass(Unknown Source)
>         at java.net.URLClassLoader.access$100(Unknown Source)
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>
>
> adrian rutle skrev:
> > Hi
> >
> > D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> > -
> > cp
> > .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph
> >
> > D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit
> >
> > Client\build\classes\org\apache\axis2\userguide
> > org.apache.axis2.userguide.TestClient
> >
> >
> > Gives:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > org/apache/axis2/user
> > guide/TestClient
> >
> >
> >
> > I am sure that the class file TestClient exists in that folder.
> >
> > package org.apache.axis2.userguide;
> > import org.apache.axis2.userguide.*;
> > import org.apache.axis2.userguide.axis2sampledoclit.*;
> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
> >
> > public class TestClient
> > {
> >    public static void main(String []args){
> >        System.out.println("\t=== we try to run our TestClient");
> >              try
> >        {
> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
> >                = new
> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
> >
> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
> >            //Create the request document to be sent.
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();
> >
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString
> > es = reqDoc.getEchoString();
> >            es.setEchoStringParam("Axis2 Echo");
> >            //invokes the Web service.
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> > resDoc =
> >                stub.echoString(reqDoc);
> >
> > System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
> >        }
> >        catch (java.rmi.RemoteException e)
> >        {
> >            e.printStackTrace();
> >        }
> >          }
> >
> > }
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi Adrian,
I just tried code generating for the WSDL accoridng to the commands
given in the user guide.. It did not generate any classes belonging to
a package named org.apache.axis2.userguide.axis2sampledoclit.

What is the full command (options given to the code generator) you are
using for code generation.

~Thilina

On 11/15/06, adrian rutle <ad...@rutle.no> wrote:
> Thilina Gunarathne skrev:
> >> nowhere... If a release doesn't work, why do they release it?? Very ba
> >> documentation that says nothing about running clients and problems that
> >> one may run into ...
> > Thanx for volunteering to write that doc ;-)...
> >
> Yea ofcourse, I was so badly desparate...
> > Problem seems to e with the way you set the classpath...
> >
> Yes, that is right...
> > Seems you are using the 1.1 release which we did today morning ..
> > You can have a look inside the ANT build files of the samples(ex:mtom,
> > pojo..) which comes with the axis2 1.1 binary distro to get an idea
> > about how to set the classpath and how to run the clients...
> >
> I want to explain to my students how they build a web service from
> scratch (or from a WSDL file) and I have used too much time to write ppt
> slides about the example Axis2SampleDocLit.wsdl (from 1.0) --> so I
> didn't want to change most of my slides and the example that I use to
> explain Axis2.
>
> Anyway, the problem is that in  release 1.1 I get a new package inside
> org.apache.axis2.userguide, which is called axis2sampledoclit and it
> contains other Java files than what's explained in the docs. Any idea
> how to fix that such that it will work for the example?
> Bytheway: I had to change the code that is given to implement the
> methods in the Skeleton code also...
>
> Here is both client and server sides of my service
>
> package org.apache.axis2.userguide;
> import org.apache.axis2.userguide.*;
> import org.apache.axis2.userguide.axis2sampledoclit.*;
> import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>
> public class TestClient
> {
>     public static void main(String []args){
>         System.out.println("\t=== we try to run our TestClient");
>
>         try
>         {
>             org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
>                 = new
> org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>
> "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>             //Create the request document to be sent.
>
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();
>
>             System.out.println("The Stub is created, hurra!");
>
>             reqDoc.getEchoString().setEchoStringParam("Axis2 Echo");
>             //invokes the Web service.
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> resDoc =
>                 stub.echoString(reqDoc);
>
> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
>
>         }
>         catch (java.rmi.RemoteException e)
>         {
>             e.printStackTrace();
>         }
>
>     }
>
> }
>
> Server:
>
>
>
>     /**
>      * Axis2SampleDocLitServiceSkeleton.java
>      *
>      * This file was auto-generated from WSDL
>      * by the Apache Axis2 version: 1.1 Nov 13, 2006 (07:31:44 LKT)
>      */
>     package org.apache.axis2.userguide;
>     import org.apache.axis2.userguide.*;
>     import org.apache.axis2.userguide.axis2sampledoclit.*;
>
>     /**
>      *  Axis2SampleDocLitServiceSkeleton java skeleton for the axisService
>      */
>     public class Axis2SampleDocLitServiceSkeleton
>     {
>
>
>         /**
>          * Auto generated method signature
>
>           * @param param0
>
>          */
>         public
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayResponseDocument
> echoStringArray
>                   (
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayDocument param0
>           )
>
>            {
>                 //Todo fill this with the necessary business logic
>                 //throw new
> java.lang.UnsupportedOperationException("Please implement " +
> this.getClass().getName() + "#echoStringArray");
>             System.out.println("\t=== EchoStringArray====");
>             return null;
>         }
>
>
>         /**
>          * Auto generated method signature
>
>           * @param param2
>
>          */
>         public
> org.apache.axis2.userguide.axis2sampledoclit.EchoStructResponseDocument
> echoStruct
>                   (
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStructDocument param2
>           )
>
>            {
>                 //Todo fill this with the necessary business logic
>                 //throw new
> java.lang.UnsupportedOperationException("Please implement " +
> this.getClass().getName() + "#echoStruct");
>             System.out.println("\t=== EchoStruct====");
>             return null;
>
>         }
>
>
>         /**
>          * Auto generated method signature
>
>           * @param param4
>
>          */
>         public
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> echoString
>                   (
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument param4
>           )
>
>            {
>                 //Todo fill this with the necessary business logic
>                 //throw new
> java.lang.UnsupportedOperationException("Please implement " +
> this.getClass().getName() + "#echoString");
>             System.out.println("\t=== EchoString====");
>             //Use the factory to create the output document.
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> retDoc =
>
> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument.Factory.newInstance();
>             //send the string back.
>             //retDoc.setEchoStringReturn("hihhhahahahahah");
>             return retDoc;
>         }
>
>     }
>
>
>
> > Thilina
> >
> >>
> >> I don't knwo how a class can compile, but can't run because
> >> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
> >> that contains this class is. Anybody knows? I have added all the jars
> >> from axis2\lib to the jar directory of java, but it doesn't help...
> >>
> >> Please, I need help, desparately ;-)
> >>
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> >>
> >> -
> >> cp .;org\apache\axis2\userguide;..\..\..\lib
> >> org.apache.axis2.userguide.TestCli
> >> ent
> >> Exception in thread "main" java.lang.NoClassDefFoundError:
> >> org/apache/axis2/clie
> >> nt/Stub
> >>         at java.lang.ClassLoader.defineClass1(Native Method)
> >>         at java.lang.ClassLoader.defineClass(Unknown Source)
> >>         at java.security.SecureClassLoader.defineClass(Unknown Source)
> >>         at java.net.URLClassLoader.defineClass(Unknown Source)
> >>         at java.net.URLClassLoader.access$100(Unknown Source)
> >>         at java.net.URLClassLoader$1.run(Unknown Source)
> >>         at java.security.AccessController.doPrivileged(Native Method)
> >>         at java.net.URLClassLoader.findClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
> >>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClass(Unknown Source)
> >>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> >>
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>
> >>
> >>
> >> adrian rutle skrev:
> >> > Hi
> >> >
> >> >
> >> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> >>
> >> > -
> >> > cp
> >> >
> >> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph
> >>
> >> >
> >> >
> >> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit
> >>
> >> >
> >> > Client\build\classes\org\apache\axis2\userguide
> >> > org.apache.axis2.userguide.TestClient
> >> >
> >> >
> >> > Gives:
> >> >
> >> > Exception in thread "main" java.lang.NoClassDefFoundError:
> >> > org/apache/axis2/user
> >> > guide/TestClient
> >> >
> >> >
> >> >
> >> > I am sure that the class file TestClient exists in that folder.
> >> >
> >> > package org.apache.axis2.userguide;
> >> > import org.apache.axis2.userguide.*;
> >> > import org.apache.axis2.userguide.axis2sampledoclit.*;
> >> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
> >> >
> >> > public class TestClient
> >> > {
> >> >    public static void main(String []args){
> >> >        System.out.println("\t=== we try to run our TestClient");
> >> >              try
> >> >        {
> >> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub
> >> stub
> >> >                = new
> >> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
> >> >
> >> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
> >> >            //Create the request document to be sent.
> >> >
> >> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument
> >> reqDoc =
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();
> >>
> >> >
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString
> >>
> >> > es = reqDoc.getEchoString();
> >> >            es.setEchoStringParam("Axis2 Echo");
> >> >            //invokes the Web service.
> >> >
> >> >
> >> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> >> > resDoc =
> >> >                stub.echoString(reqDoc);
> >> >
> >> >
> >> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
> >>
> >> >        }
> >> >        catch (java.rmi.RemoteException e)
> >> >        {
> >> >            e.printStackTrace();
> >> >        }
> >> >          }
> >> >
> >> > }
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/

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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by adrian rutle <ad...@rutle.no>.
Thilina Gunarathne skrev:
>> nowhere... If a release doesn't work, why do they release it?? Very ba
>> documentation that says nothing about running clients and problems that
>> one may run into ...
> Thanx for volunteering to write that doc ;-)...
>
Yea ofcourse, I was so badly desparate...
> Problem seems to e with the way you set the classpath...
>
Yes, that is right...
> Seems you are using the 1.1 release which we did today morning ..
> You can have a look inside the ANT build files of the samples(ex:mtom,
> pojo..) which comes with the axis2 1.1 binary distro to get an idea
> about how to set the classpath and how to run the clients...
>
I want to explain to my students how they build a web service from 
scratch (or from a WSDL file) and I have used too much time to write ppt 
slides about the example Axis2SampleDocLit.wsdl (from 1.0) --> so I 
didn't want to change most of my slides and the example that I use to 
explain Axis2.

Anyway, the problem is that in  release 1.1 I get a new package inside 
org.apache.axis2.userguide, which is called axis2sampledoclit and it 
contains other Java files than what's explained in the docs. Any idea 
how to fix that such that it will work for the example?
Bytheway: I had to change the code that is given to implement the 
methods in the Skeleton code also...

Here is both client and server sides of my service

package org.apache.axis2.userguide;
import org.apache.axis2.userguide.*;
import org.apache.axis2.userguide.axis2sampledoclit.*;
import org.apache.axis2.userguide.axis2sampledoclit.impl.*;

public class TestClient
{
    public static void main(String []args){
        System.out.println("\t=== we try to run our TestClient");
       
        try
        {
            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
                = new 
org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
                
"http://localhost:8080/axis2/services/Axis2SampleDocLitService");
            //Create the request document to be sent.
       
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
                
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();

            System.out.println("The Stub is created, hurra!");

            reqDoc.getEchoString().setEchoStringParam("Axis2 Echo");
            //invokes the Web service.
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
resDoc =
                stub.echoString(reqDoc);
            
System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
       
        }
        catch (java.rmi.RemoteException e)
        {
            e.printStackTrace();
        }
       
    }

}

Server:



    /**
     * Axis2SampleDocLitServiceSkeleton.java
     *
     * This file was auto-generated from WSDL
     * by the Apache Axis2 version: 1.1 Nov 13, 2006 (07:31:44 LKT)
     */
    package org.apache.axis2.userguide;
    import org.apache.axis2.userguide.*;
    import org.apache.axis2.userguide.axis2sampledoclit.*;

    /**
     *  Axis2SampleDocLitServiceSkeleton java skeleton for the axisService
     */
    public class Axis2SampleDocLitServiceSkeleton
    {
    
        
        /**
         * Auto generated method signature
        
          * @param param0
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayResponseDocument 
echoStringArray
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStringArrayDocument param0
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoStringArray");
            System.out.println("\t=== EchoStringArray====");
            return null;
        }
    
        
        /**
         * Auto generated method signature
        
          * @param param2
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStructResponseDocument 
echoStruct
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStructDocument param2
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoStruct");
            System.out.println("\t=== EchoStruct====");
            return null;

        }
    
        
        /**
         * Auto generated method signature
        
          * @param param4
        
         */
        public  
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
echoString
                  (
          
org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument param4
          )
        
           {
                //Todo fill this with the necessary business logic
                //throw new  
java.lang.UnsupportedOperationException("Please implement " + 
this.getClass().getName() + "#echoString");
            System.out.println("\t=== EchoString====");
            //Use the factory to create the output document.
            
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument 
retDoc =
                
org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument.Factory.newInstance();
            //send the string back.
            //retDoc.setEchoStringReturn("hihhhahahahahah");
            return retDoc;
        }
    
    }
   


> Thilina
>
>>
>> I don't knwo how a class can compile, but can't run because
>> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
>> that contains this class is. Anybody knows? I have added all the jars
>> from axis2\lib to the jar directory of java, but it doesn't help...
>>
>> Please, I need help, desparately ;-)
>>
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> -
>> cp .;org\apache\axis2\userguide;..\..\..\lib
>> org.apache.axis2.userguide.TestCli
>> ent
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/axis2/clie
>> nt/Stub
>>         at java.lang.ClassLoader.defineClass1(Native Method)
>>         at java.lang.ClassLoader.defineClass(Unknown Source)
>>         at java.security.SecureClassLoader.defineClass(Unknown Source)
>>         at java.net.URLClassLoader.defineClass(Unknown Source)
>>         at java.net.URLClassLoader.access$100(Unknown Source)
>>         at java.net.URLClassLoader$1.run(Unknown Source)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClass(Unknown Source)
>>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes> 
>>
>>
>> adrian rutle skrev:
>> > Hi
>> >
>> > 
>> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java 
>>
>> > -
>> > cp
>> > 
>> .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph 
>>
>> >
>> > 
>> D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit 
>>
>> >
>> > Client\build\classes\org\apache\axis2\userguide
>> > org.apache.axis2.userguide.TestClient
>> >
>> >
>> > Gives:
>> >
>> > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > org/apache/axis2/user
>> > guide/TestClient
>> >
>> >
>> >
>> > I am sure that the class file TestClient exists in that folder.
>> >
>> > package org.apache.axis2.userguide;
>> > import org.apache.axis2.userguide.*;
>> > import org.apache.axis2.userguide.axis2sampledoclit.*;
>> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
>> >
>> > public class TestClient
>> > {
>> >    public static void main(String []args){
>> >        System.out.println("\t=== we try to run our TestClient");
>> >              try
>> >        {
>> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub 
>> stub
>> >                = new
>> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
>> >
>> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
>> >            //Create the request document to be sent.
>> >
>> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument 
>> reqDoc =
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance(); 
>>
>> >
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString 
>>
>> > es = reqDoc.getEchoString();
>> >            es.setEchoStringParam("Axis2 Echo");
>> >            //invokes the Web service.
>> >
>> > 
>> org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
>> > resDoc =
>> >                stub.echoString(reqDoc);
>> >
>> > 
>> System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn()); 
>>
>> >        }
>> >        catch (java.rmi.RemoteException e)
>> >        {
>> >            e.printStackTrace();
>> >        }
>> >          }
>> >
>> > }
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>


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


Re: PLEASE HELP client-side Axis2SampleDocLit

Posted by Thilina Gunarathne <cs...@gmail.com>.
> nowhere... If a release doesn't work, why do they release it?? Very ba
> documentation that says nothing about running clients and problems that
> one may run into ...
Thanx for volunteering to write that doc ;-)...

Problem seems to e with the way you set the classpath...

Seems you are using the 1.1 release which we did today morning ..
You can have a look inside the ANT build files of the samples(ex:mtom,
pojo..) which comes with the axis2 1.1 binary distro to get an idea
about how to set the classpath and how to run the clients...

Thilina

>
> I don't knwo how a class can compile, but can't run because
> org.apache.axis2.client.Stub doesn't exit? I can't find where the Jar
> that contains this class is. Anybody knows? I have added all the jars
> from axis2\lib to the jar directory of java, but it doesn't help...
>
> Please, I need help, desparately ;-)
>
> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> -
> cp .;org\apache\axis2\userguide;..\..\..\lib
> org.apache.axis2.userguide.TestCli
> ent
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/axis2/clie
> nt/Stub
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(Unknown Source)
>         at java.security.SecureClassLoader.defineClass(Unknown Source)
>         at java.net.URLClassLoader.defineClass(Unknown Source)
>         at java.net.URLClassLoader.access$100(Unknown Source)
>         at java.net.URLClassLoader$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClass(Unknown Source)
>         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>
>
> adrian rutle skrev:
> > Hi
> >
> > D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\classes>java
> > -
> > cp
> > .:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLitClient\build\lib:D:\Ph
> >
> > D\MOD250-JWS\axis2-bin\lib:D:\PhD\MOD250-JWS\axis2-bin\samples\Axis2SampleDocLit
> >
> > Client\build\classes\org\apache\axis2\userguide
> > org.apache.axis2.userguide.TestClient
> >
> >
> > Gives:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > org/apache/axis2/user
> > guide/TestClient
> >
> >
> >
> > I am sure that the class file TestClient exists in that folder.
> >
> > package org.apache.axis2.userguide;
> > import org.apache.axis2.userguide.*;
> > import org.apache.axis2.userguide.axis2sampledoclit.*;
> > import org.apache.axis2.userguide.axis2sampledoclit.impl.*;
> >
> > public class TestClient
> > {
> >    public static void main(String []args){
> >        System.out.println("\t=== we try to run our TestClient");
> >              try
> >        {
> >            org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
> >                = new
> > org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
> >
> > "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
> >            //Create the request document to be sent.
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument reqDoc =
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.Factory.newInstance();
> >
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringDocument.EchoString
> > es = reqDoc.getEchoString();
> >            es.setEchoStringParam("Axis2 Echo");
> >            //invokes the Web service.
> >
> > org.apache.axis2.userguide.axis2sampledoclit.EchoStringResponseDocument
> > resDoc =
> >                stub.echoString(reqDoc);
> >
> > System.out.println(resDoc.getEchoStringResponse().getEchoStringReturn());
> >        }
> >        catch (java.rmi.RemoteException e)
> >        {
> >            e.printStackTrace();
> >        }
> >          }
> >
> > }
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/

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