将VB6 SOAP客户端应用程序迁移到.NET 4.0 [英] Migrating VB6 SOAP client application to .NET 4.0

查看:174
本文介绍了将VB6 SOAP客户端应用程序迁移到.NET 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要将vb6 soap客户端应用程序迁移到.net(C#),但我在headerhandler上遇到了
问题:


在VB6中,我使用以下代码连接到Web服务:


设置mySoapClient = New SoapClient

设置mySoapHeader =新soapHeader

....
$
'设置标题

mYSoapHeader.SoapURN = SoapURN

mYSoapHeader.data = myClientData

....


'将标题附加到SoapClient

设置mySoapClient.HeaderHandler = m_SoapHeader


'运行web服务

result = mySoapClient.Runsomething(abc,def ...)


在.Net中,我在项目中添加了Web引用,可以访问

函数/ webservice的成员,但是,我找不到一个适当的调用

" headerhandler"在webservice中。


我通读了文档"使用SOAP标头"。在MSDN上,但似乎我要
必须首先在服务器端的webservice中定义一个头(比如MyHeader),但是在我的情况下,该服务是创建的通过其他公司,我无法改变它。

如何使用旧方法(如soapclient.headerhandler = something)来
将标题传递给webservice? Thx。

解决方案

您好,


您在错误的论坛中提出此问题,这个论坛是关于论坛重新设计的讨论。您可以等待主持人移动此主题,也可以在C#论坛中发帖:


http://social.msdn.microsoft.com/Forums/en-us/home?forum=csharpgeneral&filter=alltypes&sort = lastpostdesc


I'm going to migrate a vb6 soap client application to .net (C#) but I have a
problem on headerhandler:

In VB6, I employ the following code to connect to a webservice:

Set mySoapClient = New SoapClient
Set mySoapHeader = New soapHeader
....
'Set the header
mYSoapHeader.SoapURN = SoapURN
mYSoapHeader.data = myClientData
....

'Attache the header to the SoapClient
Set mySoapClient.HeaderHandler = m_SoapHeader

'Run the webservice
result = mySoapClient.Runsomething(abc,def...)

In .Net, I added the web reference in my project and can access the
functions/members of the webservice, but, I cannot found a properity call
"headerhandler" in the webservice.

I read through the doc "Using SOAP Headers" on MSDN, but it seems that I
have to define a header (like MyHeader) in the server-side webservice first,
but in my case, the service is create by other company, I cannot change it.
how can use the old method (like soapclient.headerhandler = something) to
pass the header to the webservice? Thx.

解决方案

Hi,

You're asking this question in the wrong forum, this forum is for discussions on the forums redesign. You can either wait for a moderator to move this thread or you can post in the C# forum here:

http://social.msdn.microsoft.com/Forums/en-us/home?forum=csharpgeneral&filter=alltypes&sort=lastpostdesc


这篇关于将VB6 SOAP客户端应用程序迁移到.NET 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆