package cn.net.test;

import java.io.IOException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;

import cn.net.cpzslibs.prot.Prot02Logout;
import cn.net.cpzslibs.prot.SocketCreate;
import cn.net.cpzslibs.prot.handset.bean.req.Prot20052ReqBean;
import cn.net.cpzslibs.prot.handset.newProt.Prot20052GetYunCarNo;

public class NewYunCar {
	
	public static void main(String[] args) {
		String ip = "218.245.0.109";// 218.245.0.109 192.168.0.46 
		int port = 8890;
		SocketCreate create = new SocketCreate(ip, port, "");
		try {
			create.createLoginCpzsHandset(358000052L);
			/*Prot20050GetYunCarNo   p50 = new Prot20050GetYunCarNo();
			p50.reqDealerInfo(create);
			System.out.println(p50.getResBean());*/
			Prot20052GetYunCarNo p52 = new Prot20052GetYunCarNo();
			p52.dealCarNo(create, new Prot20052ReqBean("京12345"));
			System.out.println(p52.getResBean());
	
		} catch (BindException e) {
			e.printStackTrace();
		} catch (ConnectException e) {
			e.printStackTrace();
		} catch (SocketTimeoutException e) {
			e.printStackTrace();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			new Prot02Logout().dealLogout(create);
		}
	}
}
