/*
 * Created on 2003/12/23
 *
 * To change the template for this generated file go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
package ntt.com;
import java.io.BufferedReader;
import java.io.FileReader;
import java.rmi.RemoteException;

import org.apache.wsif.WSIFException;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;
import org.apache.wsif.providers.soap.apacheaxis.WSIFDynamicProvider_ApacheAxis;
import org.apache.wsif.util.WSIFPluggableProviders;

import com.ntt.lonworks.reportalarm.ReportAlarmSoap;
import com.ntt.lonworks.reportalarm.ReportAlarmType;

//import com.ntt.lonworks.reportalarm.*;

//--------------------------------------------------
//Function:TODO
//TODO-Private/Public
//e:TODO
//  Input
//    @ : TODO : TODO
//  Output
//    @ : TODO : TODO
//--------------------------------------------------
public class NetTyp
{
	public static void main(String[] args)
	{
		int bolRetVal = 0;
		WSIFPluggableProviders.overrideDefaultProvider(
			"http://schemas.xmlsoap.org/wsdl/soap/",
			new WSIFDynamicProvider_ApacheAxis());
		WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
		try
		{
			WSIFService service =
				factory.getService(
					"http://192.168.0.35/ReportAlarm/ReportAlarm.asmx?WSDL",
					null,
					"ReportAlarm",
					"http://reportalarm.lonworks.ntt.com",
					"ReportAlarmSoap");
			service.mapType(
				new javax.xml.namespace.QName(
					"http://reportalarm.lonworks.ntt.com",
					"ReportAlarm"),
				Class.forName(
					"com.ntt.lonworks.reportalarm.ReportAlarm"));

			service.mapType(
				new javax.xml.namespace.QName(
					"http://reportalarm.lonworks.ntt.com",
					"ReportAlarmType"),
				Class.forName(
					"com.ntt.lonworks.reportalarm.ReportAlarmType"));

			// Using stubs
			ReportAlarmSoap stub =
				(ReportAlarmSoap) service.getStub(ReportAlarmSoap.class);
			ReportAlarmType typReportAlarm = new ReportAlarmType();
			bolRetVal = stub.reportAlarm(typReportAlarm);
			if (bolRetVal != 0){
				System.out.println("Success! ! ! " + bolRetVal);
			}
			else{
				System.out.println("Failure! ! !");
			}


		}
		catch (WSIFException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (ClassNotFoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (RemoteException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


}
