Similar to
the samples previously listed in this chapter, here our aim is to generate a JBI proxy
for an externally bound web service. We are doing this using the following classes:
ITarget.java: This interface is synonymous to the BI IHello, having a single
business method hello. We want to auto-route request-response through the
JBI proxy. In order to facilitate this we have retained the method signature in
the interfaces the same.
public interface ITarget
{
String hello(String input);
}
TargetService.java: In TargetService, we auto-wire the web service stub.
So, the helloWeb instance field in TargetService will hold a reference
to the stub to the web service. When the hello method is invoked in
TargetService, the call is delegated to the stub which will invoke the
remote web service.
public class TargetService implements ITarget
{
private com.binildas.apache.axis.AxisEndToEnd.
IHelloWeb helloWeb;
public TargetService(){}
public TargetService(com.binildas.apache.axis.
AxisEndToEnd.IHelloWeb helloWeb)
{
this.helloWeb = helloWeb;
}
public String hello(String input)
{
System.
Pages:
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351