basichttpbinding

WCF, BasicHttpBinding: Stop new connections but allow existing connections to continue

▼魔方 西西 提交于 2019-12-03 12:18:05
问题 .NET 3.5, VS2008, WCF service using BasicHttpBinding I have a WCF service hosted in a Windows service. When the Windows service shuts down, due to upgrades, scheduled maintenance, etc, I need to gracefully shut down my WCF service. The WCF service has methods that can take up to several seconds to complete, and typical volume is 2-5 method calls per second. I need to shut down the WCF service in a way that allows any previously call methods to complete, while denying any new calls. In this

WCF basicHttpBinding: Rollback when reply to client fails

旧巷老猫 提交于 2019-12-03 07:32:45
I am exposing a WCF service through a basicHttpBinding that executes several operations on a database. I want to guarantee that if the client does not receive the reply the database operations are rolled back ( without any transaction flow through WCF ). E.g. the client calls the "DoX" method which executes on the server but before it is finished the client crashes. The database operations should then be rolled back as soon as the reply can not be send to the client. Is there any way to do that? Will the [OperationBehavior(TransactionScopeRequired=true)] attribute work in such a manner? Is

Does a WCF service with basicHttpBinding create a new connection for each request?

心不动则不痛 提交于 2019-12-03 04:49:41
I have a Silverlight client calling a WCF Service on an IIS web server. It uses the default basicHttpBinding setting for the calls. My client code has the usual Visual Studio generated proxy that is generated when using the 'Update Service Reference' menu option. Does every call to the service using that proxy use the same connection? Or does it create a connection each time a call is made and then close it down once the reply is received? As the client is actually making a SOAP call over HTTP I just assumed that every service request had a new connection created but I want to check if that is

How can I programmatically create this custom binding?

这一生的挚爱 提交于 2019-12-03 02:46:33
问题 We've got to access a web service that uses soap11... no problem I'll just set the binding as: BasicHttpBinding wsBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential); Nope. No dice. So I asked the host of the service why we're having authentication issues and he said that our config needed to have this custom binding: <bindings> <customBinding> <binding name="lbinding"> <security authenticationMode="UserNameOverTransport" messageSecurityVersion=

How can I programmatically create this custom binding?

僤鯓⒐⒋嵵緔 提交于 2019-12-02 16:21:05
We've got to access a web service that uses soap11... no problem I'll just set the binding as: BasicHttpBinding wsBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential); Nope. No dice. So I asked the host of the service why we're having authentication issues and he said that our config needed to have this custom binding: <bindings> <customBinding> <binding name="lbinding"> <security authenticationMode="UserNameOverTransport" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11" securityHeaderLayout="Strict"

Programmatically set identity on WCF EndpointAddress

家住魔仙堡 提交于 2019-12-02 04:22:14
I am using the following function to create a System.ServiceModel.EndpointAddress when connecting to a WCF Service: private static EndpointAddress GetEndPointAddress(string url, EndpointIdentity identity) { Uri baseAddress = new Uri(url); EndpointAddress endpointAddress = new EndpointAddress( baseAddress, identity, new AddressHeaderCollection()); return endpointAddress; } I need to pass in an EndPointIdentity that correlates with the following excerpt from my web.config: <identity> <dns value="Some Value" /> </identity> My WCF Service uses an X509 certificate, so it seems that my identity

Problem with large requests in WCF

非 Y 不嫁゛ 提交于 2019-11-30 03:55:44
问题 I've seen this problem posted a million times, but none of the solutions have worked for me...So here I go: When calling a WCF service I get the following error: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://BlanketImportService.ServiceContracts/2011/06:request. The InnerException message was 'There was an error deserializing the object of type BlanketImport.BlanketImportRequest. The maximum array

.NET or Win32 Equivalent of “netsh http add urlacl” command

我只是一个虾纸丫 提交于 2019-11-30 03:44:53
There are several questions around how to allow a self-hosted WCF application to use BasicHttpBinding with HTTP.SYS without requiring administrative privileges. It boils down to needing to grant permission (from an admin context) to the URL, then the user can host whatever at the specified URL. netsh http add urlacl url= http://+:80/MyService I would like to be able to query and add registered URLs without resorting to parsing commandline output of the "netsh" or "httpconfig" commandline tools. Is there is a public Win32 or .NET API that I can call for this functionality? The Win32 API to use

How to enable HTTPS in WCF service

蓝咒 提交于 2019-11-29 11:58:57
I have hosted my service on IIS. Hosted service has applied SSL certificate and on browse of URL, it appears with HTTPS. But, when i do consume this URL into client application (ASP.NET WEB Application) then, it allows to add https//domain/service.svc but, on client configuration, it appears the URL as http and not https . when do manual change then, it gives error as follow: The provided URI scheme 'https' is invalid; expected 'http'. Below is the WCF service configuration (hosted on IIS): <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="customBehavior"> <serviceMetadata

.NET or Win32 Equivalent of “netsh http add urlacl” command

和自甴很熟 提交于 2019-11-29 00:16:12
问题 There are several questions around how to allow a self-hosted WCF application to use BasicHttpBinding with HTTP.SYS without requiring administrative privileges. It boils down to needing to grant permission (from an admin context) to the URL, then the user can host whatever at the specified URL. netsh http add urlacl url=http://+:80/MyService I would like to be able to query and add registered URLs without resorting to parsing commandline output of the "netsh" or "httpconfig" commandline tools