The Client java
class can be written against these generated files as follows:
public class Client
{
private static String wsdlUrl = "http://localhost:8192/
Services/HelloWebService/main.wsdl";
private static String namespaceURI = "http://binildas.com/
esb/bindejb";
private static String localPart = "HelloServiceBIService";
protected void executeClient(String[] args)throws Exception
{
HelloServiceBIService helloServiceBIService = null;
JsrEjbEPPortType jsrEjbEPPortType = null;
if(args.length == 3)
{
helloServiceBIService = new HelloServiceBIServiceLocator(
args[0], new QName(args[1], args[2]));
}
else
{
helloServiceBIService = new HelloServiceBIServiceLocator(
wsdlUrl, new QName(namespaceURI, localPart));
}
jsrEjbEPPortType = helloServiceBIService.getHelloServiceBI();
log("Response From Server : " + jsrEjbEPPortType.hello(
"Binil"));
}
public static void main(String[] args)throws Exception
{
Client client = new Client();
client.executeClient(args);
}
}
Binding EJB in a JBI Container
[ 160 ]
To build the entire Axis client codebase, assuming that both the EJB server and
the ServiceMix container is up and running, change directory to ch08\BindEjb\
03_AxisClient, which contains a top-level build.
Pages:
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233