Invoking with non-primitive data parameters

This topic use a WSDL example to illustrate how to invoke a Web Service method.

This WSDL has only one operation called login of which the input parameter is a Java Bean-User and output parameter is a primitive type-boolean. When call the login operation, you must create the user instance and set its correct value. If the user id and password are correct, you will receive true, otherwise you will receive false.

The code snippet for invocation login operation is as follows:
InvokerFactory factory = new InvokerFactory("jar:///btt/invoker.xml");
Invoker invoker = factory.createInvoker("login");
User user=new User();
user.setUserID("user01");
user.setPassword("xxxxx"); 
Object result =  inv.execute(new Object[]{user});
System.out.println(result ? "Login successfully!" : "Login Failed!");
The WSDII invoker definition is as follows:
<WSDII id="login" 
	       wsdlURL="http://localhost:8080/Service/wsdl/UserService.wsdl" 
	         operation="login"/>

If you have a network connection active, this program can be run as follows: Login successfully! or Login Failed!

You may notice that invocation a web service with non-primitive data type is similar with the primitive data type. However, in BTT, data being organized into Context, we cannot get Java Bean instance. The problem is how to map data between Context and WSDL data.