Following is the code for accessing the servlet-web service.
public class WebServiceStandaloneClient {
  | 
  |     /**
  |      * @param args
  |      */
  |     public static void main(String[] args) {
  |             
  |             try {
  |                     String endPoint = "http://localhost:8080/age/Age?wsdl";;
  |                     URL url = new URL(endPoint);
  |                     ServiceFactory sf = ServiceFactory.newInstance();
  |                     QName serviceQname = new 
QName("http://age.webservices.javasrc.com/","AgeService";);
  |                     Service s = sf.createService(url,serviceQname);
  |                     Age age = (Age) s.getPort(Age.class);
  |                     System.out.println("got output " + age.age("name",new 
Integer(26)));
  |             } catch (MalformedURLException e) {
  |                     e.printStackTrace();
  |             } catch (ServiceException e) {
  |                     e.printStackTrace();
  |             } catch (RemoteException e) {
  |                     e.printStackTrace();
  |             }
  | 
  |     }
  | 
  | }

You need to create following classes :  I generated it using the Eclipse Web 
Service Client.
package com.javasrc.webservices.age;
  | 
  | public interface AgeService extends javax.xml.rpc.Service {
  |     public java.lang.String getAgePortAddress();
  | 
  |     public com.javasrc.webservices.age.Age getAgePort() throws 
javax.xml.rpc.ServiceException;
  | 
  |     public com.javasrc.webservices.age.Age getAgePort(java.net.URL 
portAddress) throws javax.xml.rpc.ServiceException;
  | }
  | 

There are jaxr,jaxrp,saaj,xml-api.jar, axis.jar, 
commons-loggin,commons-discovery,log4j and wsdl4j.jar  files in the class path 
of the client.



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3952259#3952259

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3952259


_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to