Web Services/WCF
We have a service operation, for which it is very important to ensure that a client receives the status, that was determined at the end of operation.If client does receive the response, the server status should be "completed". Otherwise (in case of communication error), server status should be rollback and stay as "pending". The possible technical solutions were discussed and WCF Transactions support with 2PC(two phase commit) was selected. We implemented service operation with transaction commit/rollback ......
We have a wcf service, that expects to return a huge XML data. It worked ok in testing, but in production it failed with error "Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota."The MSDN article about dataContractSerializer xml configuration element correctly describes maxItemsInObjectGraph attribute default as 65536, but documentation for of the DataContractSerializer.MaxI... ......
We are implementing WCF Service versioning after having problems with enums in response ( Do not expose enum in WCF response )I found that we need rigorously follow the recommendations "Versioning When Schema Validation Is Not Required" from msdn article:Best Practices: Data Contract VersioningInitially I've ignored the recommendation "Do not attempt to version data contracts by type inheritance" and failed to generate backward compatible XML.Reading the documentation I've noticed in Service Versioning ......
I wanted to ResolveUrl() from WCF service and foundhttp://www.west-wind.c... .However the function assumes that the call is synchronous, in asynchronous call (e.g called from TPL task) HttpContext.Current==null.I had to split my asynchronous method into two-a long asynchronous one, invoked as task and generating relative URL and a post-task, that is calling wwWebUtils.ResolveServerUrl... http://www.codeproject.com/... ......
We had a backward compatibility problem in WCF client, when in Service application a new value was added to one of enums. We discussed different ways to avoid this backward compatibility issues, and I found recommendation do not expose enum in wcf response in http://stackoverflow.com/a/... is still required to create new versions of our service interfaces to replace each enum fields with string field, that expects only documented values, and describe, what should be default behavior, ......
We wanted to follow recommendation from http://omaralzabir.com/best... to“add “From” header and set the server name. I do this on each webserver and specify different names on each box. It’s handy to see from which servers requests are being served. When you are trying to troubleshoot load balancing issues, it comes handy to see if a particular server is sending requests” However one of the client of our rest service reported that From value in the response ......
We have two services, that can be called independently, but also can be used together. They have some common types, and if they called together, default Visual Studio proxy generation will create the same types in different namespaces. There are multiple articles, that recommend to use command line SvcUtil instead of Visual Studio IDE. The article How to reuse types across service endpoints suggests on client side manually update Reference.svcmap to include multiple <MetadataSources> and NamespaceMappings ......
I wanted to replace .Net Remoting calls with WCF. Article “From .NET Remoting to the Windows Communication Foundation (WCF)” was very useful for me. It was misleading reference to Attribute ReturnUnknownExceptionsAsFa... which doesn’t exist any more.It has been changed to IncludeExceptionDetailInFau... I wanted to use WCF Binary Encoding when Host in Windows 2003 Server(IIS6) instead of text encoding, that is coming out-of-the-box I found the blog WCF: Enable Binary Encoding Over Http and literally ......
I have a WCF service and client, which worked fine, when I debug it on my local machine. However when I deployed the service to test server on the different domain. I've started to receive error System.ServiceModel.Securit... The caller was not authenticated by the service. ---> System.ServiceModel.FaultEx... The request for security token could not be satisfied because authentication failed. I've found a few similar recommendations, e.g. http://community.discountas... ......
We are still using Microsoft WSE 3.0 and on test server started to get Event Type: Error Event Source: Microsoft WSE 3.0 WSE054: An error occurred during the operation of the TraceInputFilter: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.String.GetStringForS... value, Int32 startIndex, Int32 length, Int32 capacity) at System.Text.StringBuilder.G... tid) at System.Text.StringBuilder.s... value) ......
The Web Service Provider that we are using recommends NOT send Expect100Continue header. The specifying static value System.Net.ServicePointMana... is not good, because some other providers may prefer to use the header. In the haacked's "HttpWebRequest and the Expect: 100-continue Header Problem" post comment of Mirronelli Jun 02, 2005 6:22 AM suggest to specify webRequest.ServicePoint.Exp... = false; for each webRequest. If I am using web service(derived from ......
I wanted to have a diagram from .Net Dataset (stored as XSD) and include elements from XSD generated from WCF service. I found that is not supported by MS tools. Dataset Designer doesn't have any export facility.XSD files generated from WCF service, do not have any graphical interface at all. I ended up with manually drawing in Visio objects used by WCF service and merge PrintScreens from VS Dataset Designer and Visio Class Diagram in Paint.Not a nice solution. I've posted a suggestion "Ability to ......
After installing .Net 3.5 SP1 on the existing server, that runs .Net 2.0, I've got the exception: Source : mscorlib Message : An error occurred creating the configuration section handler for system.serviceModel/bindings: Could not load type 'System.ServiceModel.Config... from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934... Filename : c:\WINDOWS\Microsoft.NET\Fr... Line : 100 Errors : ......
The post based on How to enable WCF tracing article Open WCF Service Configuration Editor under VS 2008 Tools menu or directly from installation folder (typically C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\SvcCo... - subfolder v6.0 can be different depending on which version of Windows SDK has been installed) To enable WCF message logging Click the Diagnostics node, and expand it. Enable Message Logging on the right Tab To edit Message Logging settings, click the Message Logging ......
I have an existing C# file, generated a long time ago from XSD definition. The XSD files were changed, and proxy class should be regenerated. I've tried to use XML Schema Definition Tool (Xsd.exe) to generate C# class, but it returned the error: "The datatype is missing". I've actually have two XSD files -outer and imported Thanks to the post: XSD.exe is kicking my butt, man...redux , it pointed me to specify all necessary files on the commandline. Note that name of generated file is combined from ......
I need to asynchronously call a few web services at the same time. VS 2005/2008 Web services proxy generator creates several proxy class methods , including synchronous MyWebMethod(parameters) and asynchronous pair BeginMyWebMethod(parameters) and EndMyWebMethod(parameters) The way to use Begin/End methods is described in article "Calling Web Services Asynchronously " Even if I am going to use asynchronous method in the real application, for unit testing(including TestHarness ) it is much easier ......
I have a class library DLL, that has client web services reference. The reference is dynamic and in generated app.config the URL is listed inside <applicationSettings>. I am using the class from web Application(WAP) and by copying <..Properties.Settings> to web.config I am able to change the URL just by modifying value in web.config(I even wrote helper class to Update Dynamic Web reference URLs Diring Installation in Visual Studio 2005). The approach is well described in How to share ......
I need to create WSDL file for RPC/Encoding soap implementation. To learn how to create the WSDL I took an Example 5. SOAP binding of request-response RPC operation over HTTP from Web Services Description Language (WSDL) 1.1 specification and tried to run WSDL.exe for the file. I have to fix couple simple errors 1. removed wsdl: from wsdl:arrayType 2. Changed StockQuoteBinding to StockQuoteSoapBinding in <port name="StockQuotePort" binding="tns:StockQuoteBind... And then I've got the error: ......
I tried to find Tools to generate WSDL from SOAP Sample, but wasn't successful. I've started to use WSCF - Web services Contract-First to generate WSDL from XSD, that I've created manually , but I have the next problem. The SOAP example uses collections vector (with apache namespace) and I am not sure how specify them in WSDL to generate expected SOAP messages. Someone suggested "specify a struct in your wsdl file that contains whatever information your vector objects contain, and return an array ......
I need to create client to web services that are documented by providing samples of SOAP messages, but there is no WSDL file available. I've done a Google search and bookmarked a few links, that can help: XSLT that transforms from XSD to WSDL and related Spring Web Services(inJava) Rick Strahl 's Syncing up external WSDL Schemas with a stock .ASMX Web Service? WSCF - Web services Contract-First, for real soapUI is a free and open source desktop application for inspecting, invoking, developing, simulating/mocking ......
Full Web Services/WCF Archive