wcf-binding

WCF http binding

旧城冷巷雨未停 提交于 2019-11-28 01:59:27
问题 I create a wcf service application and a asp.net mvc project(as client). I added my wcf service via Add Service Reference file to my asp.net mvc reference. I use Entity Framework to connect DB in my wcf application. I have a UserManagement.svc.cs service. This is my UserManagement.svc.cs codes: public class UserManagement : IUserManagement { iFlowEntities db = new iFlowEntities(); public void AddRole(role role) { db.roles.Add(role); db.SaveChanges(); } public List<role> RoleList() { List<role

WCF is using the computer name instead of the IP address and cannot be resolved

吃可爱长大的小学妹 提交于 2019-11-27 21:36:44
I have a WCF service that works fine on the LAN but when trying to access it from outside the service reference fails. My WCF service is hosted on a win2k3 box that is using a static IP no domain. Jorge Barrera This is what worked for me. In config file < serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> < / system.serviceModel > If it is set to false, I was getting that crazy computername substitution. multipleSiteBindingsEnabled="true" seems to be all that I have to do for this to work as it should. I was looking into an approach to reuse the Host header from HTTP request. In

WCF: How can I programatically recreate these App.config values?

寵の児 提交于 2019-11-27 20:49:11
I have a WCF service that works ok if I create the service without specifying any binding or endpoint (it reads it from the generated values in the App.config when I registered the WCF via Visual Studio). I have a simple method that returns the service reference: return new SmsServiceReference.SmsEngineServiceClient(); This works ok (because the values are read from the config). However, I'd like to have some of these values in a Database (the URI for example) and would like to do something like this: Binding binding = new BasicHttpBinding(); EndpointAddress endpointAddress = new

How can I combine the WCF services config for both http and https in one web.config?

别等时光非礼了梦想. 提交于 2019-11-27 19:44:15
I spent a lot of time figuring out how to configure my WCF services so that they would work for https in the production environment. Basically, I needed to do this: <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /> <services> <service name="MyNamespace.MyService" behaviorConfiguration="MyServiceBehavior"> <endpoint

basicHttpBinding vs wsHttpBinding [duplicate]

北城以北 提交于 2019-11-27 19:16:57
This question already has an answer here: BasicHttpBinding vs WsHttpBinding vs WebHttpBinding 1 answer In a WCF endpoint, what is the difference between basicHttpBinding and wsHttpBinding? When should each be used? marc_s Ton of material on that out there - just google for "WCF basicHttpBinding wsHttpBinding". You'll find amongst others: WCF : BasicHttpBinding compared to WSHttpBinding at SOAP packet level. Difference between BasicHttpBinding and WsHttpBinding and many, many more! Very basically: basicHttp is SOAP 1.1, wsHttp is SOAP 1.2 (they're quite different, esp. when it comes to SOAP

Transfer large amount of data in WCF service

前提是你 提交于 2019-11-27 17:28:11
I have created a web service in WCF which returns more than 54000 data-rows with 10 data in each row. I have used the wsHttpBinding for communication. The service works well with less data (i.e. 2000 rows) but it bombs out when attempting to send large record set with 50000+ rows(~2MB). The exception message is like this An error occurred while receiving the HTTP response to http://localhost:9002/MyService.svc . This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the

.NET assembly runs in partial trust on a network drive, but all other in full trust

落花浮王杯 提交于 2019-11-27 16:17:04
We have a strange issue with our C++ solution (which calls .NET 4.0 assemblies) when running on a network drive. The solution hosts several WCF services with NetTcpBinding, one of them with a non-default binding configuration. A non-default NetTcpBinding is per se not possible under partial trust (see Stack Overflow question When does WCF NetTcpBinding need full trust on the client? ), but the solution runs under a fully trusted network drive. This does work on several different computers (Windows Vista and Windows 7) but fails on one (Windows Vista) with throwing an exception, An error

XDocument.Descendants() not returning any elements

喜欢而已 提交于 2019-11-27 15:02:11
I'm trying to bind a Silverlight DataGrid to the results of a WCF service call. I was not seeing the data displayed in the grid, so when I ran through the debugger, I notice that XDocument.Descendants() was not returning any elements even when I was passing in a valid element name. Here is the XML that is passed back from the service: <ArrayOfEmployee xmlns="http://schemas.datacontract.org/2004/07/Employees.Entities" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Employee> <BirthDate>1953-09-02T00:00:00</BirthDate> <EmployeeNumber>10001</EmployeeNumber> <FirstName>Georgi</FirstName>

maxReceivedMessageSize not fixing 413: Request Entity Too Large

泄露秘密 提交于 2019-11-27 14:35:59
My call to my WCF web service is failing with System.Net.WebException: The request failed with HTTP status 413: Request Entity Too Large. Checking Fiddler, I see that I'm sending: Content-Length: 149839 Which is over 65KB. Enabling WCF tracing on the server, I see: System.ServiceModel.ProtocolException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. Adding this property doesn't solve the issue. I've tried with just that property, and (later) with various others

WCF sessions with a wsHttpBinding and without windows security

坚强是说给别人听的谎言 提交于 2019-11-27 12:30:37
I need to create a WCF service that is hosted in IIS, uses http transport and hold state in the server’s memory. While I’m aware that stateful services aren't a good idea, this last constrain is necessary to make the service work with a legacy client. My first thought was to asp.net’s session to store the values. I activated the asp.net compatibility mode in my service, which gave me access to the HttpContext, but values that were placed in the session object were not being persisted in memory. I assume this was because the http module that handles session state was not correctly configured,