读书人

请教怎么通过浏览器查看wcf方法

发布时间: 2013-01-23 10:44:50 作者: rapoo

请问如何通过浏览器查看wcf方法?
WCF怎么样才能弄成像webservice一样,打开浏览器,输入参数,然后返回数据呢?

webservice发布以后打开有个文本框让你输入数据并返回,但是wcf打开后就是这个东西


You have created a service.

To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:



svcutil.exe http://localhost:3800/WCFHost/Service.svc?wsdl

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:


C#

class Test
{
static void Main()
{
ServiceClient client = new ServiceClient();

// Use the 'client' variable to call operations on the service.

// Always close the client.
client.Close();
}
}



Visual Basic

Class Test
Shared Sub Main()
Dim client As ServiceClient = New ServiceClient()
' Use the 'client' variable to call operations on the service.

' Always close the client.
client.Close()
End Sub
End Class

c#
[解决办法]
右键你要你要浏览的web页,选择浏览即可,或运行起来在桌面右下角有虚拟服务,点开,然后点击浏览

读书人网 >C#

热点推荐