JBoss Community

Cannot find ServiceFactory implementation Problem

created by Dipak Patel in JBoss Web Services Development - View the full discussion

Hello All,

 

I have created one web service and hosted it in JBoss. Now i want to use that web service in another class using following code.

 

-------------------------------------------------------------------

public static void main(String[] args) throws Exception

{

  try

  {

   String urlstr = "http://localhost:8080/SimpleWebServiceAnnotationProject?wsdl";

   System.out.println("Contacting webservice at " + urlstr);

 

   URL url = new URL(urlstr);

  

 

   String ns = "http://simple.ws.jboss.org/";

   QName qname = new QName(ns, "SimpleServiceAnnotation");

   QName port = new QName(ns, "SimpleAnnotationPort");

   QName operation = new QName(ns, "getMessage");

 

  

   ServiceFactory factory = ServiceFactory.newInstance(); 

   Service service = factory.createService(url, qname);

   Call call = service.createCall(port, operation);

 

   System.out.println("output:" + call.invoke(null));

  }

  catch (Exception e)

  {

   e.printStackTrace();

  }

}

-------------------------------------------------------------------

If i run this code then it alwasys shows me following error.





Contacting webservice at http://localhost:8080/SimpleWebServiceAnnotationProject?wsdl
javax.xml.rpc.ServiceException: Cannot find ServiceFactory implementation
at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:115)
at applications.JaxRpcDIIClient.main(JaxRpcDIIClient.java:28)

 

I am using JBoss 7.1.1 Final version.

I can Browse the web service http://localhost:8080/SimpleWebServiceAnnotationProject?wsdl in internet explorer.



Can any one help me  what i missing here?



Thanks

Dipak

Reply to this message by going to Community

Start a new discussion in JBoss Web Services Development at Community