Build.xml
Config.xml
Webservices.xml
Hello.java* * *
@author Roson * * 2005-10-10 * *
package helloservice;
Import Java.rmi.Remote;
Import java.rmi.RemoteException;
Public interface Hello extends Remote {public
string SayHello (String name) throws RemoteException;
}
|
Helloimpl.java
* * *
@author Roson * * 2005-10-10 * *
package helloservice;
Import java.rmi.RemoteException;
public class Helloimpl implements Hello {public
String message= "Hello:";
Public String SayHello (string name) throws RemoteException {return
message+name;
}
}
|
Client.java
* * *
@author roson
* *
2005-10-11
/package client;
Import HelloService. Hello;
Import Javax.xml.rpc.Service;
Import javax.xml.rpc.ServiceFactory;
Import Javax.xml.namespace.QName;
Import java.net.*;
public class Client {public
static void Main (string[] args) throws Exception {
url url=new url ("Http://netone:8 080/webservice/hello?wsdl ");
QName qname=new QName ("Http://netone.com/Hello", "HelloService");
Servicefactory factory=servicefactory.newinstance ();
Service Service=factory.createservice (url,qname);
Hello hello= (Hello) service.getport (hello.class);
System.out.println (Hello.sayhello ("Rosonsandy"));
}
|
First you have to configure path and jboss_home yourself
Generate Mapping.xml
Run Ant generate-mapping
Generate HELLOSERVICE.WSDL
Run Ant Wscompile
The files are then placed in pictures.
Deploying the Ant War
To view the HelloService in JBoss:
http://localhost:8080/ws4ee/
Http://localhost:8080/ws4ee/services
You can run the client. -->run As-->java application in eclipse
Description
With regard to the latest EJB3.0 and WebService collaboration, JBoss will be completed in JBoss5.0.
The ant settings for Wscompile and Wsdeploy can be referenced
Http://java.sun.com/webservices/docs/1.3/jaxrpc/jaxrpc-tools.html
Https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html