The current JAX-WS code doesn't support services packaged with a services.xml file. See AXIS2-4611.
Andreas On Wed, Apr 28, 2010 at 03:18, Ramakrishnan Srinivasan <[email protected]> wrote: > Hello, > > I just started learning JAX-WS with Axis 1.5.1, and developing in Eclipse. > So please help me. Its a very simple scenario, but not working as I > expected. Here is a simple class I created using JAX-WS annotations: > > *******class Stuff********* > import javax.jws.WebMethod; > import javax.jws.WebParam; > import javax.jws.WebService; > // NOTE: I have specified both portName and serviceName > @WebService(name="StuffName", portName="StuffPort", > serviceName"StuffService", targetNamespace="http://stufftarget/stuff"> > public class Stuff { > @WebMethodpublic String getSomething(@WebParam(name="whatName") String > whatParam) {return "something " + whatParam;} > } > > **************** > > And this is the other class I have - without JAX-WS annotations > > *******class MyRandomNumber********* > public class MyRandomNumber > { > // http://localhost:8080/Axis2WSTest/axis2-web/index.jsp > public long getNumber() {return new Random(1000).nextLong();} > // > http://localhost:8080/Axis2WSTest/services/MyRandomNumber/addNumbers?x=32&y=42 > public long addNumbers(int x, int y) {return x + y;} > } > **************** > > My services.xml has two entries: > ********* services.xml ********** > <parameter name="ServiceClass" > locked="false">com.stuff.webservice.soap.axis2.MyRandomNumber</parameter> > <parameter name="ServiceClass" > locked="false">com.stuff.webservice.soap.axis2.Stuff</parameter> > ********************************* > > So my intention is to create two services: one using JAX-WS annotation=s, > and the other without annotations - and have them exposed as web services > using Axis. All of the bindings - SOAP11, SOAP12 and HTTP - are enabled (the > default). > > Observations: > > a) When they are in services.xml separately, they both show up in the > services list, and work fine. > b) When both JAX-WS annotated and non-annotated services are put in > services.xml: > b.1. I do not see the non-annotated services. MyRandomNumber is missing from > the list, but I was expecting it to be listed. > b.2. Since my JAX-WS WebService annotation specifies the portName > (StuffPort), this seems to be confusing Axis (or listServices.jsp I guess). > The list of services in > http://localhost:8080/Axis2WSTest/services/listServices shows the following > services: > - StuffService.StuffPort - when I click this, I get an error (If you wish > Axis2 to automatically generate the WSDL 1.1, then please set > useOriginalwsdl as false in your services.xml)instead of the wsdl > - StuffService - works as expected > c) When I comment out the Stuff service (that uses JAX-WS annotations) in > services.xml, I was expecting that only the MyRandomNumber service will be > exposed; and I do not see Stuff listed in the services. However, since the > Stuff class is still in the code, I still see StuffService.StuffPort (which > gives the same error) listed as a service, even though I removed it from > services.xml > > All of the above is minor since I am intentionally messing around with > different possibilities. But I do have two questions: > > - Are the above problems occurring because Eclipse tooling is not yet > supported for 1.5.1? > - Is it possible in Axis 2 to have JAX-WS annotated services exist with > services that are not JAX-WS annotated? > > Thank you for your patience! > > Srini --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
