WCF Published Orchestration “Oddity”

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.

Leave a Reply

Recent Posts




All Rights Reserved Theme by 404 THEME.