1 Reply Latest reply on Jun 1, 2010 6:41 AM by ropalka

    Endpoint.publish and programmatically deploy web service

    pkorros

      I am trying to dynamically (programmatically) create and deploy a new Web Service on JBoss 4.2.3. In order to do that I am using the following code:

       

      Web service implementation:

       

      @WebServiceProvider

      @ServiceMode(Mode.MESSAGE)

      public class ScoringDynamicWebService implements Provider<SOAPMessage> {

           public SOAPMessage invoke(SOAPMessage request) {...}
      }
      Web service publishing code:

       

      Source source = new StreamSource(new StringReader(wsdl));

      source.setSystemId(url+"?wsdl");

      metadata.add(source);

       

      Map<String, Object> properties = new HashMap<String, Object>();

       

      properties.put(Endpoint.WSDL_PORT, new QName(

      "http://scoring.exodussa.com/ws", webServiceName+"Port"));

      properties.put(Endpoint.WSDL_SERVICE, new QName(

      "http://scoring.exodussa.com/ws", webServiceName+"Service"));

      properties.put("CUSTOM_URL", url);

       

      Endpoint endpoint = Endpoint.create(SOAPBinding.SOAP12HTTP_BINDING, webService);

      endpoint.setMetadata(metadata);

      endpoint.setProperties(properties);

       

      endpoint.publish(url);

      This code works correctly when I am running it on a console application (using jdk 1.6) and I am able to invoke it using a web service client.

       

      When I am trying the same code under JBoss 4.2.3 I get the following exception:

       

      java.lang.IllegalStateException: Cannot obtain wsdl location for: {http://scoring.server.guvnor.drools.org/}ScoringDynamicWebServiceService
      at org.jboss.wsf.stack.jbws.WSDLFilePublisher.getPublishLocation(WSDLFilePublisher.java:315)
      at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:105)
      at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.create(PublishContractDeploymentAspect.java:52)
      at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:118)
      at org.jboss.wsf.container.jboss42.DeploymentAspectHttpServer.publish(DeploymentAspectHttpServer.java:89)
      at org.jboss.ws.core.jaxws.spi.EndpointImpl.publish(EndpointImpl.java:174)
      at org.jboss.ws.core.jaxws.spi.EndpointImpl.publish(EndpointImpl.java:131)

       

      Can anyone point me to what I should do to in order to fix this?

       

      Regards,

      Panagiotis