WebService series Teaching (17)-Routines used WSDL files, etc.

Source: Internet
Author: User
Tags integer soap xmlns wsdl
Web "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 the code generated by the WEB service designer

Public Sub New ()
MyBase.New ()

' This call is required by the Web service designer.
InitializeComponent ()

' Add your own initialization code after the InitializeComponent () call

End Sub

' Required by the WEB service designer
Private Components as System.ComponentModel.IContainer

' NOTE: The following procedure is required by the WEB service designer
' You can use the Web service designer to modify this procedure.
' Do not modify it using the Code Editor.
<system.diagnostics.debuggerstepthrough () > Private Sub InitializeComponent ()
components = New System.ComponentModel.Container ()
End Sub

Protected Overloads Overrides Sub Dispose (ByVal disposing as Boolean)
' CodeGen: This procedure is required by the WEB service designer
' Do not modify it using the Code Editor.
If disposing Then
If not (components are 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" >
<operation name= "Test" >
<input>
</input>
<output>
<mime:mimexml part= "Body"/>
</output>
</operation>
</binding>
<binding name= "Service1httppost" type= "S0:service1httppost" >
<operation name= "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" >
</port>
<port name= "Service1httppost" binding= "S0:service1httppost" >
</port>
</service>
</definitions>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.