프로그래머의 삶 Programmer's Life/Web&WAS

ConverterClient - axis2 TestCode

Oliver's World 2009. 9. 7. 01:28
728x90

package wtp;

import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;

import wtp.ConverterConverterSOAP11Port_httpStub.CelsiusToFarenheit;
import wtp.ConverterConverterSOAP11Port_httpStub.CelsiusToFarenheitResponse;

public class ConverterClient {

        public static void main(String[] args) {
                try {
                        float celsiusValue = 100;
                        ConverterConverterSOAP11Port_httpStub stub = new ConverterConverterSOAP11Port_httpStub();
                        CelsiusToFarenheit c2f = new CelsiusToFarenheit();
                        c2f.setCelsius(celsiusValue);
                        CelsiusToFarenheitResponse res = stub.celsiusToFarenheit(c2f);
                        System.out.println("Celsius : "+celsiusValue+" = "+"Farenheit : "+res.get_return());
                } catch (AxisFault e) {
                        e.printStackTrace();
                } catch (RemoteException e) {
                        e.printStackTrace();
                }

        }
}

728x90