[jboss-dev-forums] [JBoss Web Services Development] - Cannot find ServiceFactory implementation Problem

Dipak Patel do-not-reply at jboss.com
Mon Oct 1 05:37:06 EDT 2012


Dipak Patel [https://community.jboss.org/people/dipak.nit] created the discussion

"Cannot find ServiceFactory implementation Problem"

To view the discussion, visit: https://community.jboss.org/message/762454#762454

--------------------------------------------------------------
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 http://localhost:8080/SimpleWebServiceAnnotationProject?wsdl";
   System.out.println("Contacting webservice at " + urlstr);

   URL url = new URL(urlstr);


   String ns = " http://simple.ws.jboss.org/ 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
[https://community.jboss.org/message/762454#762454]

Start a new discussion in JBoss Web Services Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121001/3ea31df7/attachment.html 


More information about the jboss-dev-forums mailing list