wcf

WCF and passing windows credentials

不羁的心 提交于 2021-01-27 13:01:31
问题 I have a website hosted on ServerA which runs using an App Pool using a special user accout with domain privilages to access our database. In the config file of the website I specify: <identity impersonate="true" /> I then have a service which is also on ServerA and hosted in a console app programmatically (i.e. no config file) like below. Uri uri = new Uri("net.tcp://ServerA:9900/Service/"); ServiceHost host = new ServiceHost(typeof(Service1), uri); NetTcpBinding binding = new NetTcpBinding(

WCF and passing windows credentials

旧城冷巷雨未停 提交于 2021-01-27 12:56:08
问题 I have a website hosted on ServerA which runs using an App Pool using a special user accout with domain privilages to access our database. In the config file of the website I specify: <identity impersonate="true" /> I then have a service which is also on ServerA and hosted in a console app programmatically (i.e. no config file) like below. Uri uri = new Uri("net.tcp://ServerA:9900/Service/"); ServiceHost host = new ServiceHost(typeof(Service1), uri); NetTcpBinding binding = new NetTcpBinding(

Receiving an error using URL Routing with built-in WCF Router Service

那年仲夏 提交于 2021-01-27 12:23:48
问题 I wanted to create an extension less (file-less if possible) router endpoint via WCF Router Service that has customer user/password security policy. I am getting the following Fault Exception when attempting to route SOAP messages through it: <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">An unexpected failure occurred. Applications should not attempt to handle

While updating service reference i get error HRESULT E_FAIL has been returned from a call to a COM component

喜夏-厌秋 提交于 2021-01-27 12:18:34
问题 I have created a restful wcf service there are GET methods already exist. But when in interface I created post method like [OperationContract] [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "createDemo")] int createDemo(ObjectInfo obj); I consumed this service in another asp.net website project, while updating service over there i get the " HRESULT E_FAIL has been returned from a

Error while reading body of request message

落花浮王杯 提交于 2021-01-27 11:34:43
问题 I need to read content of message in WCF project like var messageContent = Encoding.UTF8.GetString(OperationContext.Current.RequestContext.RequestMessage.GetBody<byte[]>()); But in result I got an error: Expecting element 'base64Binary' from namespace 'http://schemas.microsoft.com/2003/10/Serialization/'.. Encountered 'Element' with name 'Human', namespace 'http://numans.hr-xml.org/2007-04-15'. Can you please suggest me what Im doing wrong? Content that I'm sending are: <Human xmlns:xsd="http

Error while reading body of request message

女生的网名这么多〃 提交于 2021-01-27 11:33:33
问题 I need to read content of message in WCF project like var messageContent = Encoding.UTF8.GetString(OperationContext.Current.RequestContext.RequestMessage.GetBody<byte[]>()); But in result I got an error: Expecting element 'base64Binary' from namespace 'http://schemas.microsoft.com/2003/10/Serialization/'.. Encountered 'Element' with name 'Human', namespace 'http://numans.hr-xml.org/2007-04-15'. Can you please suggest me what Im doing wrong? Content that I'm sending are: <Human xmlns:xsd="http

Error while reading body of request message

自作多情 提交于 2021-01-27 11:31:37
问题 I need to read content of message in WCF project like var messageContent = Encoding.UTF8.GetString(OperationContext.Current.RequestContext.RequestMessage.GetBody<byte[]>()); But in result I got an error: Expecting element 'base64Binary' from namespace 'http://schemas.microsoft.com/2003/10/Serialization/'.. Encountered 'Element' with name 'Human', namespace 'http://numans.hr-xml.org/2007-04-15'. Can you please suggest me what Im doing wrong? Content that I'm sending are: <Human xmlns:xsd="http

WCF reference.cs suddenly not including classes

为君一笑 提交于 2021-01-27 07:40:25
问题 I have developed a WCF service that has been working fine for a few weeks now. I publish this service to IIS directly from the development server. I have a dev test app that includes this WCF service as a Service Reference in its own project. My WCF class library also references another project within the Visual Studio solution, and many classes are in the referenced project that are used by the service and calling applications. Today, after publishing some changes to the service (I did not

WCF reference.cs suddenly not including classes

微笑、不失礼 提交于 2021-01-27 07:40:14
问题 I have developed a WCF service that has been working fine for a few weeks now. I publish this service to IIS directly from the development server. I have a dev test app that includes this WCF service as a Service Reference in its own project. My WCF class library also references another project within the Visual Studio solution, and many classes are in the referenced project that are used by the service and calling applications. Today, after publishing some changes to the service (I did not

Configuring WCF client binding to use X509 certificate in dotnet core 2.2

蹲街弑〆低调 提交于 2021-01-27 07:39:09
问题 I'm trying to convert an old WCF client to dotnet core. I successfully generated my proxies from the wsdl and have been trying to configure them so I can successfully call the endpoint. It appears, based on some googling, that under dotnet core I need to configure my WCF client from code. Here's the WCF configuration section from the web.config of the old application: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> <behaviors> <endpointBehaviors>