在VB.NET中使用Web服务 [英] Consuming web services in VB.NET

查看:618
本文介绍了在VB.NET中使用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET中的第一次测试Web服务。我几乎没有,但我似乎无法使用的Web服务。我知道这个帖子是类似本网站约5-6其他职位,但我已审查他们,仍然不能得到正确的语法。

到目前为止,我有: - 创建,创建一个目录一个简单的Web服务 -Worked开发环境,但采取了一些故障排除去工作现场服务器 - 我可以拉起来了自动地生成.NET我们的服务页面。 - 增加了Web服务引用 - 现在可以看到我的解决方案资源管理器和智能感知参考

更新: 这里是一个链接到Web服务本身: http://67.78.188.50/Jservices/Service1.asmx

Web服务接受字符串(目录如/测试/目录的名称)。然而,当我进入Web引用(ServiceReference1)的名字 - 我没有得到我预期的方法...

下面是我的选择与ServiceReference1对象...

  ServiceReference1.makeDirRequest
ServiceReference1.makeDirRequestBody
ServiceReference1.makeDirResponse
ServiceReference1.makeDirResponseBody
ServiceReference1.Service1Soap
ServiceReference1.Service1SoapChannel
ServiceReference1.Service1SoapClient
 

解决方案

通票,你还没有公布足够的code,看看你做了什么

我会强烈建议您使用WCF

鉴于你的样品名称证明,需要

 昏暗的服务作为新ServiceReference1.Service1SoapClient
service.makeDir(有些VAL)
 

下载的许多样品中的一个网站(大量在 $ C $的CProject 上),并得到了样品的工作第一。如果你不能让那去然后还有其他事情是错的,你的Windows安装

I am testing web services in .NET for the first time. I am almost there, but I can't seem to consume the web service. I know this post is similar to about 5-6 other posts on this site, but I have reviewed them, and still can't get the syntax correct.

So far, I have: -Create a simple web service that creates a directory -Worked in development environment, but took some trouble shooting to get to work on live server -I can pull up the "automagically" generated .NET we service page. -Added web service reference - can now see the reference in my solution explorer and in intellisense.

Update: Here is a link to the webservice itself: http://67.78.188.50/Jservices/Service1.asmx

The web service accepts a string (name of directory e.g /test/directory). However, when I enter the name of the Web Reference (ServiceReference1) - I don't get the methods I expect...

Here are my options with the ServiceReference1 Object...

ServiceReference1.makeDirRequest
ServiceReference1.makeDirRequestBody
ServiceReference1.makeDirResponse
ServiceReference1.makeDirResponseBody
ServiceReference1.Service1Soap
ServiceReference1.Service1SoapChannel
ServiceReference1.Service1SoapClient

解决方案

Pass, you haven't posted enough code to see what you have done

I would strongly recommend that your use WCF

Given your sample names proved, you need

Dim service As New ServiceReference1.Service1SoapClient
service.makeDir("some val")

Download one of the many samples on the web (plenty on codeproject) and get the sample working first. If you cant get that to go then something else is wrong with you Windows installation

这篇关于在VB.NET中使用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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