⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainweathertest.java

📁 j2ee web service for java j2ee & web service
💻 JAVA
字号:
package com.test;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;

import javax.xml.rpc.ServiceException;


import cn.com.WebXml.WeatherWebService;
import cn.com.WebXml.WeatherWebServiceLocator;

/**
 * Mar 30, 2009
 *@author shdxiahui@163.com
 */
public class MainWeatherTest {

	public static void main(String[] args) throws RemoteException, ServiceException {
		WeatherWebServiceLocator weather = new WeatherWebServiceLocator();
		WeatherWebService service = (WeatherWebService) weather;
		//String[] provice = service.getWeatherWebServiceSoap().getSupportProvince();
		//String[] provice = service.getWeatherWebServiceSoap().getSupportCity("all");
		//GetSupportDataSetResponseGetSupportDataSetResult dataSet = service.getWeatherWebServiceSoap().getSupportDataSet();
		
		String[] citys = service.getWeatherWebServiceSoap().getWeatherbyCityName("信阳");
		List<String> provices = new ArrayList<String>();
		//StringBuffer buffer = new StringBuffer();
		/*System.out.println(citys.length+"========="+citys);
		
		for(int i=0; i<citys.length; i++){
			provices.add(citys[i]);
		}*/
		System.out.println(citys[5]);
		System.out.println(citys[6]);
		System.out.println(citys[7]);
		System.out.println(citys[8]);
		System.out.println(citys[9]);
		System.out.println(citys[10]);
		System.out.println(citys[11]);
		
		System.out.println(provices.toString());
		/*Map<String,String> provide = new HashMap<String, String>();
		System.out.println(citys[5]);
		System.out.println(citys[6]);
		System.out.println(citys[7]);
		System.out.println(citys[8]);
		System.out.println(citys[9]);
		System.out.println(citys[10]);
		System.out.println(citys[11]);
		
		
		for(int i=0; i<citys.length; i++){
			provices.add(citys[i]);
		}
		//System.out.println(provices.toString());
		String abc = "北京 (54511), 上海 (58367), 天津 (54517), 重庆 (57516), 香港 (45005), 澳门 (45011)";
		String[] a = abc.split(",");
		System.out.println(a.length);
		for(int i=0; i<a.length; i++){
			System.out.println(a[i]);
		}
		System.out.println("=================================");
		String ac = "上海 (58367)";
		int aa = ac.indexOf("(");
		int bb = ac.indexOf(")");
		System.out.println(aa+","+bb);
		System.out.println(ac.substring(aa+1, bb));*/
		/*for(int i=0; i<weather2.length; i++){
			buffer.append(weather2[i]).append(",");
		}
		buffer.deleteCharAt(buffer.length()-1);
		System.out.println(provices.toString());
		System.out.println(buffer.toString());
		
		TypeDesc type = dataSet.getTypeDesc();
		//type.
		MessageElement[] element = dataSet.get_any();
		if(element[0].getAllAttributes().hasNext()){
			System.out.println(element[0].getValue());
		}
		System.out.println(element.length);
		String a = "北京 (54511)";
		System.out.println(dataSet.toString());*/
		
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -