You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sudhakar <su...@gmail.com> on 2011/06/27 17:19:49 UTC

Register my web service with the jaxws on fly.

Hi,

I am creating a service HelloWorld.java (interface which has method
sayHello(), class having @webservice )
an implementation class HelloWorldImpl.java ( @webservice (endpointInterface
= HelloWorld.java)

These above two classes i am creating on fly.

Now i need to publish these service into server (using tomcat with spring )
and want to access the sayHello() method.

I am trying like this 
HelloWorldImpl helloworldImpl = new HelloWorldImpl(); 
JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean(); 
svrFactory.setServiceClass(NewService.class); 
svrFactory.setAddress("http://localhost:8080/MyWebservice/NewService"); 
svrFactory.setServiceBean(helloworldImpl); 
svrFactory.create();

By doing so, i am able to see end point is coming in the Available SOAP
services: by accessing application context
-->http://localhost:8080/MyWebservice

Now when i am trying to access the wdsl by clicking on the wsdl link, i am
getting the 404 error.

To check back, i have manually created wsdl file by running java2WSDL
service for HelloWorld.java, when i am tried to access the service, getting
NO_SERV found exception.

Can some one please help me to resolve this issue.

--
View this message in context: http://cxf.547215.n5.nabble.com/Register-my-web-service-with-the-jaxws-on-fly-tp4528792p4528792.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Register my web service with the jaxws on fly.

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, June 29, 2011 9:58:15 PM Glen Mazza wrote:
> You're not using Tomcat below, the pure CXF API code below results in
> embedded Jetty.  Perhaps some of the embedded Jetty/Tomcat/standalone
> services I created for JUnit tests here:
> http://www.jroller.com/gmazza/entry/junit_web_service_testing would
> provide some useful code for you.
> 
> I'm not sure how/if you can create web services "on the fly" with
> standalone Tomcat hosting a CXF WAR-based web service provider.  AFAIK
> when you deploy the WAR, the web services endpoints available in that
> WAR are static.  Hopefully others can point out a solution for you here.

Roughly the same way.   The address would just be something like "/blah" and 
the war context and servlet path would be prepended onto that.   

Dan



> Glen
> 
> On 06/27/2011 11:19 AM, sudhakar wrote:
> > Hi,
> > 
> > I am creating a service HelloWorld.java (interface which has method
> > sayHello(), class having @webservice )
> > an implementation class HelloWorldImpl.java ( @webservice
> > (endpointInterface = HelloWorld.java)
> > 
> > These above two classes i am creating on fly.
> > 
> > Now i need to publish these service into server (using tomcat with
> > spring ) and want to access the sayHello() method.
> > 
> > I am trying like this
> > HelloWorldImpl helloworldImpl = new HelloWorldImpl();
> > JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> > svrFactory.setServiceClass(NewService.class);
> > svrFactory.setAddress("http://localhost:8080/MyWebservice/NewService");
> > svrFactory.setServiceBean(helloworldImpl);
> > svrFactory.create();
> > 
> > By doing so, i am able to see end point is coming in the Available SOAP
> > services: by accessing application context
> > -->http://localhost:8080/MyWebservice
> > 
> > Now when i am trying to access the wdsl by clicking on the wsdl link, i
> > am getting the 404 error.
> > 
> > To check back, i have manually created wsdl file by running java2WSDL
> > service for HelloWorld.java, when i am tried to access the service,
> > getting NO_SERV found exception.
> > 
> > Can some one please help me to resolve this issue.
> > 
> > --
> > View this message in context:
> > http://cxf.547215.n5.nabble.com/Register-my-web-service-with-the-jaxws-
> > on-fly-tp4528792p4528792.html Sent from the cxf-user mailing list
> > archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Register my web service with the jaxws on fly.

Posted by Glen Mazza <gm...@talend.com>.
You're not using Tomcat below, the pure CXF API code below results in 
embedded Jetty.  Perhaps some of the embedded Jetty/Tomcat/standalone 
services I created for JUnit tests here: 
http://www.jroller.com/gmazza/entry/junit_web_service_testing would 
provide some useful code for you.

I'm not sure how/if you can create web services "on the fly" with 
standalone Tomcat hosting a CXF WAR-based web service provider.  AFAIK 
when you deploy the WAR, the web services endpoints available in that 
WAR are static.  Hopefully others can point out a solution for you here.

Glen

On 06/27/2011 11:19 AM, sudhakar wrote:
> Hi,
>
> I am creating a service HelloWorld.java (interface which has method
> sayHello(), class having @webservice )
> an implementation class HelloWorldImpl.java ( @webservice (endpointInterface
> = HelloWorld.java)
>
> These above two classes i am creating on fly.
>
> Now i need to publish these service into server (using tomcat with spring )
> and want to access the sayHello() method.
>
> I am trying like this
> HelloWorldImpl helloworldImpl = new HelloWorldImpl();
> JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> svrFactory.setServiceClass(NewService.class);
> svrFactory.setAddress("http://localhost:8080/MyWebservice/NewService");
> svrFactory.setServiceBean(helloworldImpl);
> svrFactory.create();
>
> By doing so, i am able to see end point is coming in the Available SOAP
> services: by accessing application context
> -->http://localhost:8080/MyWebservice
>
> Now when i am trying to access the wdsl by clicking on the wsdl link, i am
> getting the 404 error.
>
> To check back, i have manually created wsdl file by running java2WSDL
> service for HelloWorld.java, when i am tried to access the service, getting
> NO_SERV found exception.
>
> Can some one please help me to resolve this issue.
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Register-my-web-service-with-the-jaxws-on-fly-tp4528792p4528792.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Application Integration Division
Talend (http://www.talend.com/ai)
blog: http://www.jroller.com/gmazza