3月8日
Java Client using Axis - Part 1
Here is the source code for the Java client using Axis.
/**
*
*/
import service.emp.*;
import data.emp.*;
/**
* @author
*
*/
public class SimpleAsmxAxisClient
{
/**
* @param args
*/
public static void main(String[] args)
{
GetPerson();
GetAddress();
GetWorkAddress();
}
/**
*
*/
public static void GetPerson()
{
Person person;
Person newPerson;
try
{
// Create Proxy Class
SimpleAsmxServiceSoapProxy service = new SimpleAsmxServiceSoapProxy();
// Create Person
person = new Person();
person.setName( "Bob the Builder" );
//
// DO NOT SEND THE ADDRESS
//
System.out.println( "\nDo NOT send Address to Service..." );
newPerson = service.getPerson( person );
Print( newPerson );
//
// SEND THE ADDRESS
//
System.out.println( "\nSend Address to Service..." );
HomeAddress homeAddress = new HomeAddress();
homeAddress.setHouseNumber("456 Long and Winding Road ");
person.setAddress(homeAddress);
newPerson = service.getPerson( person );
Print( newPerson );
}
catch ( Exception ex )
{
System.err.println(ex);
}
}