王牌网提供的几个实用Web Service文档

来源:互联网 发布:lr软件怎么缩小 编辑:程序博客网 时间:2024/06/11 23:47
 

天气预报
地址:http://www.wopos.com/webservice/weather.asmx
介绍:使用 getWeather(city)方法:city-直接输入全国大中小城市及国外中城市中文名
例:
  Public sub GetWopWeather(ByVal city As String)
  Dim s As String
        Try
     Dim weat As New localhost.Weather
            s = weat.getWeather(city)
     If s.IndexOf("没有查到相关结果") > -1 Then
     Else
            s = s.Replace("图1==", "<img src=")
            s = s.Replace(",图2==", "></img><img src=")
            s = s.Replace(",天气", "></img>,天气")
                s = s.Replace(",", "<br/>").Replace("==", ":")
     End If
        Catch ex As Exception
            s = "提供天气数据的网络不通,请稍后再试"
        End Try
          response.write(s)
        End sub

手机归属地
地址:http://www.wopos.com/webservice/Mobile.asmx
介绍:使用 getMobileArea(mobileCode) mobileCode-手机号码或前7位

股票走势图
地址:http://www.wopos.com/webservice/Stock.asmx
介绍:使用 getStockChart(StockCode) StockCode-股票代码,返回值为图片的HTTP地址.

IP地址查询
地址:http://www.wopos.com/webservice/ips.asmx
介绍:使用 getIParea(ip)方法返回IP所在地,使用AddIPRange(startIP,EndIP,AreaInfo)增加新的IP地址信息,使用 IpToInt 和 IntToIp可对IP地址从字符串到整型的互相转换.

成语典故
地址:http://www.wopos.com/webservice/chengyu.asmx
介绍:
使用 ChengYuDianGu(chengyu)方法,参数为成语或成语的拼音缩写。如返回多个成语以*_*分隔

生成验证码图像
地址:http://www.wopos.com/webservice/vimg.asmx
介绍:使用 GetVerifyImg(str4,Lenght,Width,Style)生成一张字符图像,用于注册、发贴等场合做图像验证。后面三个参数为保留参数,暂时无效,用于以后扩充。 目前的很简单,仅供测试。

RSS种子生成
地址:http://www.wopos.com/webservice/Rss.asmx
介绍:使用 OutPutRss()方法:Rss Item数据项以DataTable 方式提供。数据项数不能超过100调用后直接输出RSS2.0 XML。
例:
Imports System.Data

    Partial Class Test : Inherits System.Web.UI.Page

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim tb As New DataTable
            Dim rw As DataRow
            tb.Columns.Add(New DataColumn("title", System.Type.GetType("System.String")))
            tb.Columns.Add(New DataColumn("link", System.Type.GetType("System.String")))
            tb.Columns.Add(New DataColumn("author", System.Type.GetType("System.String")))
            tb.Columns.Add(New DataColumn("pubdate", System.Type.GetType("System.String")))
            tb.Columns.Add(New DataColumn("category", System.Type.GetType("System.String")))
            tb.Columns.Add(New DataColumn("description", System.Type.GetType("System.String")))

            For i As Int16 = 0 To 10
                rw = tb.NewRow
                rw.Item("title") = "title" & i
                rw.Item("link") = "http://www.wopos.com/test.htm"
                rw.Item("author") = "author " & i
                rw.Item("pubdate") = Date.Now.ToString
                rw.Item("category") = "category " & i
                rw.Item("description") = "description " & i
                tb.Rows.Add(rw)

            Next
            Dim rss As New Rss
            rss.OutPutRss(tb, "中国新闻", "中新", "http://www.wopos.com/", "wopos.com", "新闻", "图片", "http://www.wopos.com/", "http://www.wopos.com/image/wopos.gif")

        End Sub
End Class

原创粉丝点击