I created two schema that are identical except for one thing.
One of them has an extra element after the max-occurs=unbounded.

First schema – DemoRequest1.xsd

Second schema – DemoRequest2.xsd

I then created two identical orchestrations, except one receives DemoRequest1 and one receives DemoRequest2 (they both return the same message in the response).

Then both orchestraiton were published as WCF services.

We can see the differences in two ways:
1) By using the WCFClientTest.exe utility (found here:
C:Program FilesMicrosoft Visual Studio 9.0Common7IDE)
2) By creating a C# program, and adding a service reference to the published orchestration (WCF web service)

WCFTestClient shows the following:



The results are perhaps more clear in C#:

        static void Main(string[] args)
            svcref1.Demo1Request req1 = new WCFOddityConsumeConsoleApp.svcref1.Demo1Request();
            svcref1.Demo2Request req2 = new WCFOddityConsumeConsoleApp.svcref1.Demo2Request();

            req1.DemoRequest1[2].MyString = "abc";      //Note the element ?MyGroup? does not even appear here!
            req1.DemoRequest1[2].MyDecimal = 123;

            req2.DemoRequest2.MyGroup[2].MyString = "abc";
            req2.DemoRequest2.MyGroup[2].MyDecimal = 123;
            req2.DemoRequest2.AfterMyGroup = "test";


You can see how in one case, the “MyGroup” element has totally disappeared, and the subscript is now on it’s parent element!

So the moral of the story is, we sometimes add a “DummyElement” after the maxOccurs=unbounded group/record – so the world seem more normal.

1) This one comes with Visual Studio:
C:Program FilesMicrosoft Visual Studio 9.0Common7IDEWCFTestClient.exe
a) Just add your the URL to your service
b) double clik on the method you want to call
c) fill in the values
d) click invoke
It shows the response formatted, and there is an XML tab to show you the full XML.

2) CodePlex has several:
a) http://wcftestharness.codeplex.com/
b) http://www.codeplex.com/wsdldisco

3) http://www.soapui.org/ – Free and paid version – I think you have to register to get the free version.

If you want to do Load Testing – http://wcfloadtest.codeplex.com/

Neal Walters
March 6, 2009

An SQL database field was defined as CHAR(1). We used LINQ to SQL to expose in a web service, which defined the field as a System.Nullable.

Unforuntately, it is not well known or well documented that “CHAR”s serializae and deserialize as the ASCII number, which is the equivalent of the character.

Thus is a BizTalk map, we had to use the Character to ASCII functoid to conver the letter “C” to the number “67”, in order to get BizTalk to properly build XML that is passed to a web service. When passing the letter “C”, you get a deserialization error.

See Also this blog link

WCF Tracing

Sometimes, you might need to run a full WCF trace (on both the IIS web service, and the client).
The XML in this article will do that and discuss how to view it.

            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
               <add name="traceListener"
                   initializeData= "c:logTraces.svclog" />

You can view the file in XML, but it can be a little ugly.

Microsoft has provided a free utility called SVCTraceViewer.exe.
To get this utility, unfortunatley you have to download the Windows developers toolkit.
After you install, it can be found in this directory:
“c:Program FilesMicrosoft SDKsWindowsv6.0ABinSvcTraceViewer.exe”

How to download SvcTraceViewer.exe
Unfortunately, you can not just download the utility standalone.
No, the only way (as far that I know of) to have it, is to install the .NET SDK. The latest version of this SDK is 6.1 and is called ‘Windows SDK for Windows Server 2008 and .NET Framework 3.5’.

This is a huge install. First you have to download a 1,29 GB .ISO on http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en. After burning it to DVD or mounting it with a ISO mounting tool (like http://www.slysoft.com/en/virtual-clonedrive.html) or running UltraIso or something to turn it into regulary disk files, you can start the setup. To have SvcTraceViewer.exe you only need to select Developer Tools .NET Development Tools.

You can double click to run it, and it opens a Windows program.
You simply open the trace log file you captured above, and it formats it beautifully, with errors in red, and warnings in yellow. You can still see the full XML if you want (for example to copy it to clipboard, a MSDN Forum Post, or an email).

Get 404 page not found when browsing a web service you know is there.
For example, from IIS you right-click and select “Browse” on the .svc file (so you know it is really there). NOTE: the 404 is a “red herring” an outright lie – a bad error given to us by Microsoft to confuse us.

Try checking to see if you have ASP.NET 1.1 instead of 2.0 set.
Right click your “virtual directory”, then click the “ASP.NET” tab.
.NET 2.0 and 3.5 use the same “CLR”, therefore you will see 2.0.50727 in the
ASP.NET version on this tab. If you see 1.x, then change it to 2.0.50727.

From IIS Admin, right-click the project, …

If and when you get this error on Windows 2003, there is an additional setup required.
Click “Web Service Extensions” at the bottom of IIS, and check the “ASP.NET V2.0.50727” and see if is is “allowed” instead of “prohibited”.

If you get “service unavailable”, then make sure the userid that is running your application pool (Win 2003/IIS 6) is a member of the “IIS_WPG” (IIS worker process group) and that the password is correct.