如何创建使用C#在Visual Studio 2010中一个简单的SOAP服务器? [英] How do I create a simple SOAP server using C# in Visual Studio 2010?

查看:463
本文介绍了如何创建使用C#在Visual Studio 2010中一个简单的SOAP服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照指示这里但他们似乎很快地变得非常具体到SharePoint,因为他们一起走得更远。我只是想创建一个非SharePoint SOAP启动项目通用教程,而谷歌是不是我的朋友,此刻。

I was trying to follow the instructions here but they seem to quickly be getting very specific to Sharepoint, as they go along further. I just want a general tutorial for creating a non-sharepoint SOAP starter projects, and Google is not my friend, at the moment.

这似乎有些上述步骤。适用

It seems that some of the above steps are applicable.

到目前为止,我有:


  1. 系统解决方案'的WebSite1与文件创建 - >新网站

  2. A'ClassLibrary1的在C#项目,System.Web.Services加入引用

  3. 一个key02。 .SNK(强名称密钥文件)的文件ClassLibrary1的节点。

  4. 无代码实现任何SOAP服务器的方法呢。

  5. 不知道如何添加代码以上,然后再建立和运行,并有肥皂的hello-world类型的方法。

  1. A solution 'WebSite1' created with File -> New Website.
  2. A 'ClassLibrary1' project in C#, with System.Web.Services added to References.
  3. a key02.snk (strongname key file) file node in the classlibrary1.
  4. No code implementing any SOAP server methods yet.
  5. No idea how to add code to the above, and then build and run, and have a soap hello-world type method.

我想实现一个简单的HelloWorld方法,它至少需要一个参数。由此产生的服务可以查询其WSDL,像这样一个网址:

I'd like to implement a simple HelloWorld method that takes at least one parameter. The resulting service could be queried for its WSDL with a url like this:

    http[s]://localhost/myfirstsoapserver/helloWorldMethod1.asmx?WSDL

如果上面我的猜测是正确的,上面的地址将是任何可用的工具可以导入W​​SDL。

If my guess above is right, the above Url would be usable by any tool that can import WSDL.

我的目标是快速原型和嘲讽起来的,我需要处理其他各种SOAP接口,并且我希望C#+ visualStudio2010 + IIS是一个相当简单的方法来做到这一点。

My goal is rapid prototyping and mocking up of various other SOAP interfaces that I need to deal with, and I'm hoping that C#+visualStudio2010+IIS is a reasonably easy way to do that.

推荐答案

首先创建一个新的项目作为一个Web应用程序:

First create a new project as a web application:

然后添加一个新项目的类型的Web服务:

Then add a new item of type web service:

这篇关于如何创建使用C#在Visual Studio 2010中一个简单的SOAP服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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