Tag: wcf binding

以编程方式获取命名管道的系统名称

我正在使用WCF NetNamedPipeBinding编写进程间通信。 我的目标是让服务在“net.pipe:// localhost / service”运行,所以我运行最简单的主机: host = new ServiceHost(contract, new Uri[] { “net.pipe://localhost” }); host.AddServiceEndpoint(typeof (IContract), new NetNamedPipeBinding(), “service”); host.Open(); 根据http://blogs.msdn.com/b/rodneyviana/archive/2011/03/22/named-pipes-in-wcf-are-named-but-not-by-you-and-how-to- find-the-actual-windows-object-name.aspx该名称隐藏在系统生成的guid后面。 这就是问题所在。 是否有任何可能的方法来获取系统(guid)在我的程序中生成的名称,所以我可以获得像“\ Device \ NamedPipe \ GUID”这样的路径,就像在procexp中一样,所以它会更容易嗅探它? (除了在单独的进程中运行sys internals可执行文件并解析其输出?)

自主WCF服务无法通过WCFTestClient进行测试

我正在尝试使用WCFTestClient测试我自己托管的wcf服务。 我得到一个错误: 错误:无法从http:// localhost:2303 / MyService获取元数据如果这是您有权访问的Windows(R)Communication Foundation服务,请检查您是否已在指定地址启用元数据发布。 有关启用元数据发布的帮助,请参阅http://go.microsoft.com/fwlink/?LinkId=65455上的MSDN文档.WS- Metadata Exchange错误URI: http:// localhost:2303 / MyService元数据包含参考无法解决:’http:// localhost:2303 / MyService’。 内容类型application / soap + xml; 服务http:// localhost:2303 / MyService不支持charset = utf-8。 客户端和服务绑定可能不匹配。 远程服务器返回错误:(415)无法处理消息,因为内容类型为’application / soap + xml; charset = utf-8’不是预期的类型’text / xml; charset = utf-8′.. HTTP GET错误URI: http:// localhost:2303 / MyService下载’http:// localhost:2303 / MyService’时出错。 请求失败,HTTP状态为400:错误请求。 我的项目结构如下 作为主机的控制台应用程序 服务合约 […]

REST服务上的错误请求错误使用POST(json数据)调用方法?

嗨,我是RESTful WCF的新手,我正在尝试使用POST对webservice方法进行简单的调用,这是我的代码 Service Interface code [ServiceContract] public interface IJsonSave { [OperationContract] [WebInvoke(UriTemplate = “/SaveJason”, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = “POST”, BodyStyle = WebMessageBodyStyle.WrappedRequest)] string SaveJason(string value); } web.config文件代码 我尝试使用提琴手她是我的标题 POST http://localhost:50267/JsonSave.svc/Rest/SaveJason User-Agent: Fiddler Content-Type: application/json Data-Type: json Host: localhost:50267 申请机构: ({“value”:”asdfasd”}) 它给出了HTTP/1.1 400 Bad Request错误,当启用调试细节时,它会给出以下堆栈跟踪 The server encountered an error processing the […]

在app.config中增加后运行WCF测试客户端并接收MaxReceivedMessageSize错误

我正在尝试在VS 2013中设置我的第一个WCF服务。我正忙着通过一个教程,但是遇到了麻烦…… 运行一个简单的服务(DataViewerService),它调用数据库以返回记录集。 我已将绑定更改为: 在system.serviceModel中,我直接在下面包含了 谷歌搜索,我读到的是客户端和服务器都需要设置…但是,我在localhost上运行,我在wcf测试客户端中消耗。 我似乎无法弄清楚我需要在哪里做出这些改变……我错过了什么?

WCF多个绑定

当我尝试多个终点时,我收到以下错误.. System.ServiceModel.AddressAlreadyInUseException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: the service failed to listen. at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register() at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting) at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting) at System.ServiceModel.Channels.SharedConnectionListener..ctor(BaseUriWithWildcard baseAddress, Int32 queueId, Guid token, OnDuplicatedViaDelegate onDuplicatedViaCallback) at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token) at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpen() at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan […]

IIS上的WCF服务。 如何摆脱URL路径中的“Service.svc”组件?

我在IIS上托管了WCF服务。 出于商业原因,我不能发布此实例的公共URL,但我相信你会得到我的意思: 问题是,为了到达我的端点,似乎我已将Service.svc作为路径段的一部分包含在内 ,即我必须使用这样的URL: http:////Service.svc/ 我怎么能避免这个? 我的意思是,我想通过以下方式访问我的服务: http://// 当我在开发过程中自我托管服务时,我完全能够做到这一点。 最后,但这不是那么超然,浏览到http:////Service.svc URL会显示标准服务信息页面: 有没有办法可以防止这种情况发生?

从webHttpBinding端点获取元数据

在参考我之前的问题时 ,我想知道如何从客户端应用程序中提取WCF服务的信息,以了解如果服务只公开一个使用webHttpBinding的端点,那么会暴露哪些方法/类型? 总而言之,在我之前的问题中,我开始知道使用webHttpBinding的端点不会在生成的WSDL中暴露,因为它将是一个JSON端点并且只是不兼容。

WCF – 无法获取元数据

它使用IIS 7在Intranet中运行,只要我在IIS管理器中启用匿名身份validation,它就可以正常工作。 如果我禁用它并尝试使用wcftestclient运行它然后我收到以下错误, Error: Cannot obtain Metadata from http://myserver/testing/eval.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://myserver/testing/eval.svc Metadata contains a […]

如何在没有ServiceHost类的情况下使用WCF创建简单的Web服务器?

我已经开始学习WCF并希望通过直接使用通道堆栈创建一个简单的Web服务器来了解它的内部结构。 我在网上找到了很多理论,但是我希望看到一个接收和响应httprequest的工作示例代码,我可以使用任何浏览器进行测试。 我希望通过将绑定元素组装到响应请求的方式来显示自定义绑定的设置。

WCF服务,无法找到作为服务属性值…提供的类型

当我在Visual Studio 2012中右键单击Eval.svc并在浏览器中查看时,我得到以下内容 – 无法找到类型’EvalServiceLibary.Eval’,作为ServiceHost指令中的Service属性值提供,或者在配置元素system.serviceModel / serviceHostingEnvironment / serviceActivations中提供。 当我从测试客户端运行WCF服务时,一切正常。 评估服务: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] public class EvalService : IEvalService { Dictionary jobTimers = new Dictionary(); public void SubmitEntry(ENBO.Jobs.Job job, ENBO.Jobs.JobDetail jobDetail, ENBO.TimeLogs.TimeLog timeLog, ENBO.Users.User user, ENBO.Utilities.EntryType entryType, JobPhase jobPhase) { if (entryType == EntryType.Active) { JobPhaseTimer timer = new JobPhaseTimer(); timer.UID = job.ID + “_” […]