在 Visual Studio 中,我添加了一个 WSDL Web 参考,它加载了各种用于调用 SOAP api 的“方法”。我有一个空白的 aspx 页面。如何调用 Web 引用加载的这些方法?我已将网络参考称为 mywsdl。
到目前为止,这是我的代码:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %>
<%@ Import Namespace="WebApplication1" %>
<%
End Sub
Private Sub Call_Web_Service_Method()
Dim output
Dim CallWebService As New ServerName.mywsdl()
Dim sGetValue As String = CallWebService.GetSomeValue()
output = sGetValue
End Sub
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%=output%>
</div>
</form>
</body>
</html>