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 Ali Sadik Kumlali <as...@yahoo.com> on 2006/02/26 18:19:38 UTC

[axis2] User guide sample application inconsistency(?)

Dear all,
  
  I'm a new axis2 user and want to learn it by following the instructions in it's user guide. 
  
  First of all, i tried to generate a web service from a given WSDL as  introduced in "Writing Web Services by Code Generating Skeleton".  Therefore, i generated Java files from Axis2SampleDocLit.wsdl found in  samples\wsdl directory. I also passed "-d xmlbeans" parameter to  WSDL2Java.bat to make it use XMLBeans databinding. When i looked at the  generated files, i found two directory created: src and resources.  Under resources folder there was an interesting directory called  "schemaorg_apache_xmlbeans" which i could not found any reference in  user guide. I thought it must be "schema" directory mentioned in the  guide. Anyway, i filled the empty methods in  Axis2SampleDocLitPortTypeSkeleton.java file with the codes given in the  user guide. Created services.xml file and filled with the code given in  the guide. And created a package called Axis2SampleDocLitPortType.aar  by following the instuctions. After all, i put the  file under the  \webapps\axis2\WEB-INF\services dir
 ectory.
 Then after started Tomcat  5.5, clicked the "services" link listed in  http://localhost:8080/axis2/index.jsp. Since i did not see the  Axis2SampleDocLitPortType service listed in the page, looked at the log  files of Tomcat resides under logs directory. Then i saw a line says  "NullPointerException" without any further information. I also tried to  change the name of schemaorg_apache_xmlbeans directory to schema. It  did not work either.
  
  Am i missing something?
  
  Thans in advance,
  
  Ali Sadik Kumlali

		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

Configuring an axis service

Posted by SoftwareEngineering Hauschel <e-...@hauschel.de>.
Hy all,

i'll pass my configuration from the axis engine to my service. The
Service (Java Implementation) will have an Interface for the config
object. This config object should be setup on AxisEngine startup. Like
Servlet-loadOnStartup. 

 

Now I've defined an axis handler ,initialize my config object in the
invoke method an put it in the application session. The Service Impl get
it out of this application session and pass it to my Service (Java
Implementation).

 

Does anybody have another idea? I don't want that the service get's his
configuration! IOC!

 

Thanks Fredy


Re: [axis2] User guide sample application inconsistency(?)

Posted by Ali Sadik Kumlali <as...@yahoo.com>.
Thank you very very much Chamikara! By following your instructions i finally got it worked. It seems that the documentation should be improved in user guide.

For those who are newbie too, i want to share my experinces:

1) I wanted to create a web service from a WSDL. And followed the instructions given in the user guide.

2)  Instead of directly using the WSDL2Java command given in http://ws.apache.org/axis2/0_94/userguide2.html#Writing_Web_Services_by_Code_Generating_Skeleton, i used the following command: 

 c:\axis2\bin>WSDL2Java -uri ..\samples\wsdl\Axis2SampleDocLit.wsdl -ss -sd -d xmlbeans -o ..\samples\mysample -p org.apache.axis2.userguide

As you may easily notice, i added "-d xmlbeans" parameter to make it use XMLBeans databinding. I also directed the output to samples\mysample to easily differentiate all the generated files and folders.

3) All the generated files and folders were put under c:\axis2\samples\mysample folder. I noticed that there was a build.xml file generated as well.

4) I entered the c:\axis2\samples\mysample directory and run the ant with the  following command:

c:\axis2\samples\mysample>ant

It gave me following error:

BUILD FAILED
file:c:/axis2/samples/mysample/build.xml:32: c:\axis2\samples\mysample
\${env.AXIS2_HOME} not found.

Then i set the AXIS2_HOME environment variable with the following command:

c:\axis2\samples\mysample>set AXIS2_HOME=c:\axis2

This may be set once as Environment Variable in Windows to prevent this process to be made for every code generation.

Then i again run the ant command. This time it gave me following error:

BUILD FAILED
file:c:/axis2/samples/mysample/build.xml:54: srcdir "c:\axis2\samples\
mysample\test" does not exist!

I created a directory named "test" under c:\axis2\samples and rerun the ant.

At last, everything worked well!

5) I saw deployment-ready Axis2SampleDocLitService.aar file generated under c:\axis2\samples\mysample\build\lib\

6) I copyied the file under ...\webapps\axis2\WEB-INF\services directory of Tomcat and started it.

7) When i browse the link http://localhost:8080/axis2/listServices.jsp, my service called Axis2SampleDocLitService was there at last!

Chamikara Jayalath <ch...@gmail.com> wrote: Hi Sadik ,
 
 Actually the 'schema' directory mentioned in the userguide is the 'resources' directory that was created by the WSDL2Java tool.
 
 After generating the files you can easily create the service archieve file by running the ant task.  
 
 1. Set the AXIS2_HOME environmental variable to the directory you extracted the Axis2  distribution.
 
 2. Go to a command prompt. Move to your output folder (to which you generated the files) and run the commant 'ant'.
 This will create the  'Axis2SampleDocLitService.aar' file in the 'build\lib' subdirectory.
 
 3. Drop this to your 'webapps\axis2\WEB-INF\services' folder and start tomcat.
 
 Thanks,
 Chamikara
 
 
 

On 2/26/06, Ali Sadik Kumlali <as...@yahoo.com> wrote: Dear all,
  
  I'm a new axis2 user and want to learn it by following the instructions in it's user guide. 
  
 First of all, i tried to generate a web service from a given WSDL as introduced in "Writing Web Services by Code Generating Skeleton". Therefore, i generated Java files from Axis2SampleDocLit.wsdl found in samples\wsdl directory. I also passed "-d xmlbeans" parameter to WSDL2Java.bat to make it use XMLBeans databinding. When i looked at the generated files, i found two directory created: src and resources. Under resources folder there was an interesting directory called "schemaorg_apache_xmlbeans" which i could not found any reference in user guide. I thought it must be "schema" directory mentioned in the guide. Anyway, i filled the empty methods in Axis2SampleDocLitPortTypeSkeleton.java file with the codes given in the user guide. Created services.xml file and filled with the code given in the guide. And created a package called Axis2SampleDocLitPortType.aar by following the instuctions. After all, i put the  file under the \webapps\axis2\WEB-INF\services directory. Then af
 ter
 started Tomcat 5.5, clicked the "services" link listed in http://localhost:8080/axis2/index.jsp. Since i did not see the Axis2SampleDocLitPortType service listed in the page, looked at the log files of Tomcat resides under logs directory. Then i saw a line says "NullPointerException" without any further information. I also tried to change the name of schemaorg_apache_xmlbeans directory to schema. It did not work either.
  
  Am i missing something?
  
  Thans in advance,
  
  Ali Sadik Kumlali


		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

Re: [axis2] User guide sample application inconsistency(?)

Posted by Chamikara Jayalath <ch...@gmail.com>.
Hi Sadik ,

Actually the 'schema' directory mentioned in the userguide is the
'resources' directory that was created by the WSDL2Java tool.

After generating the files you can easily create the service archieve file
by running the ant task.

1. Set the AXIS2_HOME environmental variable to the directory you extracted
the Axis2  distribution.

2. Go to a command prompt. Move to your output folder (to which you
generated the files) and run the commant 'ant'.
This will create the  'Axis2SampleDocLitService.aar' file in the 'build\lib'
subdirectory.

3. Drop this to your 'webapps\axis2\WEB-INF\services' folder and start
tomcat.

Thanks,
Chamikara




On 2/26/06, Ali Sadik Kumlali <as...@yahoo.com> wrote:
>
> Dear all,
>
> I'm a new axis2 user and want to learn it by following the instructions in
> it's user guide.
>
> First of all, i tried to generate a web service from a given WSDL as
> introduced in "Writing Web Services by Code Generating Skeleton". Therefore,
> i generated Java files from Axis2SampleDocLit.wsdl found in samples\wsdl
> directory. I also passed "-d xmlbeans" parameter to WSDL2Java.bat to make
> it use XMLBeans databinding. When i looked at the generated files, i found
> two directory created: src and resources. Under resources folder there was
> an interesting directory called "schemaorg_apache_xmlbeans" which i could
> not found any reference in user guide. I thought it must be "schema"
> directory mentioned in the guide. Anyway, i filled the empty methods in
> Axis2SampleDocLitPortTypeSkeleton.java file with the codes given in the
> user guide. Created services.xml file and filled with the code given in
> the guide. And created a package called Axis2SampleDocLitPortType.aar by
> following the instuctions. After all, i put the  file under the
> \webapps\axis2\WEB-INF\services directory. Then after started Tomcat 5.5,
> clicked the "services" link listed in
> http://localhost:8080/axis2/index.jsp. Since i did not see the
> Axis2SampleDocLitPortType service listed in the page, looked at the log
> files of Tomcat resides under logs directory. Then i saw a line says
> "NullPointerException" without any further information. I also tried to
> change the name of schemaorg_apache_xmlbeans directory to schema. It did not
> work either.
>
> Am i missing something?
>
> Thans in advance,
>
> Ali Sadik Kumlali
>
> ------------------------------
> Yahoo! Mail
> Use Photomail<http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=38867/*http://photomail.mail.yahoo.com>to share photos without annoying attachments.
>
>