당신이 정말로 기존 클래스를 재사용 할 경우, WSDL2Java의를 사용하여 클라이언트를 생성하지 않고 직접 Axis2는 API를 호출 할 수 있습니다. 다음은 웹 서비스를 호출하는 비교적 간단한 코드입니다. 웹 서비스 끝점, 메서드 QName, 기대되는 반환 클래스 (들) 및 서비스에 대한 인수를 채워 넣기 만하면됩니다. 기존 클래스를 반환 값 또는 인수로 다시 사용할 수 있습니다.
웹 서비스가 꽤 복잡한 경우이 접근 방식을 사용하려면 API에 대해 자세히 알아야 할 수도 있습니다.
serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference("http://myservice");
options.setTo(targetEPR);
QName methodName = new QName("ns","methodName");
Class<?>[] returnTypes = new Class[] { String.class };
Object[] args = new Object[] { "parameter" };
Object[] response = serviceClient.invokeBlocking(methodName, args,
returnTypes);