RequestSoapContext-转换为VB2010 [英] RequestSoapContext - converting to VB2010
本文介绍了RequestSoapContext-转换为VB2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面的代码在VB2003中,用于将文件发送到Web服务以下载到我们的服务器.
The code below is in VB2003 to send a file to a webservice to download to our server.
proxy = Web Service class
proxy.RequestSoapContext.Attachments.Add(attachment)
proxy.UploadFile(FileName
在转换为VB2010时,RequestSoapContext
收到错误"RequestSoapContext is not a member of the Web Service class
"
问题是:用什么代码代替VB2010中的proxy.RequestSoapContext
?
in converting to VB2010 the RequestSoapContext
gets an error "RequestSoapContext is not a member of the Web Service class
"
The question is: What code takes the place of the proxy.RequestSoapContext
in VB2010?
推荐答案
尝试以下步骤:
1.使用wsdl.exe工具生成代理类
2.编辑生成的vb或cs文件并更改行
Try the following steps:
1. generate the proxy class using wsdl.exe tool
2. edit the resulting vb or cs file and change the line
Inherits System.Web.Services.Protocols.SoapHttpClientProtoc ol
到
to
Inherits Microsoft.Web.Services2.WebServicesClientProtocol
3.编译代理类
添加引用,如
3. to compile the proxy class
add the reference like
<pre lang="vb">vbc /out:Auction.dll /t:library<br />
/r:System.dll,System.XML.dll,Microsoft.Web.Services 2.dll,System.Web.Services.dll Auction.vb</pre>
将文件复制到客户bin目录中,并在
中引用它
项目.
Copy the file into the clients bin directory and refernce it in the
project.
这篇关于RequestSoapContext-转换为VB2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文