csv › MavenDependency관리 › Sapient AI Test Coder Review as a Spock User - 20231015(Su) › Decision Tree Regressor Model Sample › CvsCommand › 웹서비스동적스텁생성클라이언트
동적으로 스텁을 생성해서 웹서비스를 콜할수 있는 클라이언트 예제
AXIS 패키지 사용
src
import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException { Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new URL("http://localhost:9090/axis/DiceWS.jws?wsdl")); call.setOperationName("getRandomNumber"); int[] result = (int[]) call.invoke(new Object[]{new Integer(6), new Integer(5)}); for(int i = 0; i < result.length; i++) System.out.println(result[i]); }