国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

webservice系列教學(17)-例程用到的wsdl文件等

2024-07-21 02:25:09
字體:
來源:轉載
供稿:網友

《service1.asmx》
<%@ webservice language="vb" codebehind="service1.asmx.vb" class="yundan.service1" %>
《service1.asmx.vb》
imports system.web.services
<webservice(namespace := "http://tempuri.org/")> _
public class service1
    inherits system.web.services.webservice
#region " web 服務設計器生成的代碼 "

    public sub new()
        mybase.new()

        '該調用是 web 服務設計器所必需的。
        initializecomponent()

        '在 initializecomponent() 調用之后添加您自己的初始化代碼

    end sub

    'web 服務設計器所必需的
    private components as system.componentmodel.icontainer

    '注意:以下過程是 web 服務設計器所必需的
    '可以使用 web 服務設計器修改此過程。
    '不要使用代碼編輯器修改它。
    <system.diagnostics.debuggerstepthrough()> private sub initializecomponent()
        components = new system.componentmodel.container()
    end sub

    protected overloads overrides sub dispose(byval disposing as boolean)
        'codegen: 此過程是 web 服務設計器所必需的
        '不要使用代碼編輯器修改它。
        if disposing then
            if not (components is nothing) then
                components.dispose()
            end if
        end if
        mybase.dispose(disposing)
    end sub

#end region
<webmethod()> public function test(byval a as integer, byval b as integer) as integer
        return a + b
    end function
end class
《service1.wsdl》
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/xmlschema" xmlns:s0="http://tempuri.org/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textmatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetnamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <s:schema elementformdefault="qualified" targetnamespace="http://tempuri.org/">
      <s:element name="test">
        <s:complextype>
          <s:sequence>
            <s:element minoccurs="1" maxoccurs="1" name="a" type="s:int" />
            <s:element minoccurs="1" maxoccurs="1" name="b" type="s:int" />
          </s:sequence>
        </s:complextype>
      <s:element name="string" nillable="true" type="s:string" />
      <s:element name="arrayofstring" nillable="true" type="s0:arrayofstring" />
      <s:element name="boolean" type="s:boolean" />
      <s:element name="int" type="s:int" />
  <message name="testsoapin">
    <part name="parameters" element="s0:test" />
  </message>
  <message name="testsoapout">
    <part name="parameters" element="s0:testresponse" />
  </message>
  <message name="testhttpgetin">
    <part name="a" type="s:string" />
    <part name="b" type="s:string" />
  </message>
  <message name="testhttpgetout">
    <part name="body" element="s0:int" />
  </message>
  <message name="testhttppostin">
    <part name="a" type="s:string" />
    <part name="b" type="s:string" />
  </message>
  <message name="testhttppostout">
    <part name="body" element="s0:int" />
  </message>
    <operation name="test">
      <input message="s0:testsoapin" />
      <output message="s0:testsoapout" />
    </operation>
<porttype name="service1httpget">
    <operation name="test">
      <input message="s0:testhttpgetin" />
      <output message="s0:testhttpgetout" />
    </operation>
</porttype>
<porttype name="service1httppost">
    <operation name="test">
      <input message="s0:testhttppostin" />
      <output message="s0:testhttppostout" />
    </operation>
  </porttype>
<binding name="service1soap" type="s0:service1soap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <operation name="test">
      <soap:operation soapaction="http://tempuri.org/test" style="document" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>
  <binding name="service1httpget" type="s0:service1httpget">
    <http:binding verb="get" />
  <operation name="test">
      <http:operation location="/test" />
      <input>
        <http:urlencoded />
      </input>
      <output>
        <mime:mimexml part="body" />
      </output>
    </operation>
  </binding>
<binding name="service1httppost" type="s0:service1httppost">
    <http:binding verb="post" />
    <operation name="test">
      <http:operation location="/test" />
      <input>
        <mime:content type="application/x-www-form-urlencoded" />
      </input>
      <output>
        <mime:mimexml part="body" />
      </output>
    </operation>
  </binding>
  <service name="service1">
    <port name="service1soap" binding="s0:service1soap">
      <soap:address location="http://192.168.0.4/yundan/service1.asmx" />
    </port>
    <port name="service1httpget" binding="s0:service1httpget">
      <http:address location="http://192.168.0.4/yundan/service1.asmx" />
    </port>
    <port name="service1httppost" binding="s0:service1httppost">
      <http:address location="http://192.168.0.4/yundan/service1.asmx" />
    </port>
  </service>
</definitions>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 鸡西市| 垦利县| 上林县| 华阴市| 孝感市| 石渠县| 太仓市| 台湾省| 铅山县| 孟津县| 永城市| 盐池县| 阿克| 庆云县| 十堰市| 吴桥县| 鄂尔多斯市| 贵定县| 安庆市| 纳雍县| 建平县| 富锦市| 武穴市| 永兴县| 万宁市| 藁城市| 昌平区| 邳州市| 绥化市| 常德市| 响水县| 孝义市| 无锡市| 阿合奇县| 浦北县| 焉耆| 卢龙县| 五台县| 临安市| 南开区| 环江|