<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'weather.jsp' starting page</title> <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.5.js"></script> </head> <script type="text/javascript"> $().ready(function() { $("#text").focusout(function() { var vv = this.value; var myxml = '<?xml version="1.0" encoding="utf-8"?>' + '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">' + '<soap12:Body><getWeatherbyCityName xmlns="http://WebXml.com.cn/">' + '<theCityName>'+ vv +'</theCityName>'+'</getWeatherbyCityName></soap12:Body></soap12:Envelope>'; $.ajax({ url:'http://www.webxml.com.cn/WebServices/WeatherWebService.asmx', dateType:'xml', type:'post', contentType:'application/soap+xml;charset="UTF-8"', data:myxml, success:function(dt){ $("#weather").empty(); $(dt).find("string").each(function() { var $div = $("<div/>"); $div.text($(this).text()); $("#weather").append($div); $("#weather").append($("<br/>")); }); } },"xml"); }); }); </script> <body> 请输入城市:<input type="text" id="text"/> <div id="weather"></div> </body> </html>
详细解决方案
webservice获取天候
热度:77 发布时间:2013-07-09 09:50:47.0
相关解决方案
- java webservice 客户端调用服务器端同时发出多条请求~求高手解决思路
- webservice 赋值有关问题
- cxf webservice 返回json字符串时,数值型的字符串双引号不见了
- webservice…解决方法
- 高手~J2ME客户端,AXIS支撑的TOMCAT WEBSERVICE,两点间可以实现图片和文本数据的户传吗?特别是WEBSERVICE 端传给J2ME端
- webservice 开发方式解决办法
- 软体与其它(多)系统做接口,如何样做好些?webservice
- vc能不能调用c# webservice 的list范型,该怎么处理
- WebService QQ群:11583757 诚邀加盟,该怎么处理
- webservice The operation timed out,该怎么处理
- webservice x相关
- .net 的 webservice 的传入参数加密有关问题求解
- ASP.NET+容易三层架构+WebService+JS
- webservice 同一浏览器跨域调用session的有关问题
- ASP.NET 调用JAVA webservice,该如何处理
- Webservice 服务引用 session有关问题
- 请问下 WebService 版 API 怎么调用
- asp.net webservice asmx文件有关问题
- webservice 调用有关问题
- 请教为什么使用VS2005+WebService+AJAX在返回数据集的时候无法在客户端得到数据集字段的内容
- 大家给推荐几本学习 webservice 的好书吧 !多谢了
- 急2005 webService 的有关问题
- 2005 webService 的有关问题
- WebService 公布后工作不正常
- :xml webservice ,在调试环境是正确的,可在发布后应用里就不正确,请大侠们帮分析分析
- Webservice 缓存有关问题,
- 数据库 和 webservice 有关问题
- 请教怎么部署.net WebService
- 访问 webservice 之前 判断 webservice是否存在或能否连接上,该如何处理
- webservice,该如何解决