[英]To test this service using svcutil.exe
I want to test a service with svcutil.exe. 我想用svcutil.exe测试服务。 The step is
这一步是
svcutil.exe http://11.55.99.341/MessagingServices/MessageData.svc?wsdl
I found that there is a cs file was generated in C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin. 我发现在C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v7.0A \\ Bin中生成了一个cs文件。
Some of code is likely as: 一些代码很可能是:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5466
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MessagingAPI.Objects
{
using System.Runtime.Serialization;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]
[System.Runtime.Serialization.DataContractAttribute(Name="InboxDTO", Namespace="http://schemas.datacontract.org/2004/07/MessagingAPI.Objects")]
public partial class InboxDTO : object, System.Runtime.Serialization.IExtensibleDataObject
{
private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
private System.Guid[] FullInboxField;
private System.Guid InmateIdField;
private int MessagesInWaitField;
private int ReadMessagesField;
private System.Guid[] UnreadInboxField;
private int UnreadMessagesField;
public System.Runtime.Serialization.ExtensionDataObject ExtensionData
{
get
{
return this.extensionDataField;
}
set
{
this.extensionDataField = value;
}
}
[System.Runtime.Serialization.DataMemberAttribute()]
public System.Guid[] FullInbox
{
get
{
return this.FullInboxField;
}
set
{
this.FullInboxField = value;
}
}
I am not sure how to test it with this service with the code then? 我不知道如何用代码测试它的代码呢?
You would either need to create an application that consumes this generated class -or- use the WcfTestClient application included with Visual Studio (which can be opened with the Visual Studio Command Prompt or can typically be found under C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE [depending on your version of Visual Studio]). 您可能需要创建一个使用此生成的类的应用程序 - 或者 - 使用Visual Studio附带的WcfTestClient应用程序(可以使用Visual Studio命令提示符打开,或者通常可以在C:\\ Program Files(x86)下找到它) Microsoft Visual Studio 10.0 \\ Common7 \\ IDE [取决于您的Visual Studio版本])。
See: http://msdn.microsoft.com/en-us/library/bb552364.aspx 请参阅: http : //msdn.microsoft.com/en-us/library/bb552364.aspx
wgraham,'s answer is correct. wgraham,的答案是对的。 To use the WcfTestClient
要使用WcfTestClient
http://11.55.99.341/MessagingServices/MessageData.svc
http://11.55.99.341/MessagingServices/MessageData.svc
当您使用服务URL运行svcutil.exe时,它将为您提供代理类和配置文件,您可以在Windows / Web应用程序中添加类和配置文件,并创建代理类的对象并开始使用公开的方法作为服务的一部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.