Click here to Skip to main content
13,189,324 members (64,806 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I'm writing a WCF client (that will be in a COM component) so I can't use Service References.
I've had to take the WSDL generated classes and alter them so that the right SOAP format is passed.

I've got the sending working, but I'm not able to process the response properly.

I think its because the response can contain 0 or more repeated elements and my classes don't have the right attributes set.

So the response I'm receiving (determined using Fiddler):
<soapenv:Envelope xmlns:soapenv="" xmlns:oug="">
            <item>Component execution complete but an unexpected Exception occurred</item>

So as you can see the data_flux is repeated.

The response method and data_flux is defined in my code as:
[MessageContractAttribute(WrapperName = "ougWSResponse", WrapperNamespace = "", IsWrapped = true)]
    public partial class ougWSResponse
        [MessageBodyMemberAttribute(Namespace = "", Order = 0)]
        [XmlElementAttribute("data_flux", Form = System.Xml.Schema.XmlSchemaForm.None)]
        public stringArray[] data_flux;
        public ougWSResponse() { }
        public ougWSResponse(stringArray[] data_flux)
            this.data_flux = data_flux;
    [XmlTypeAttribute(Namespace = "", IncludeInSchema=false)]
    public partial class stringArray : object, INotifyPropertyChanged
        private string[] itemField;
        [XmlElementAttribute("item", Form = System.Xml.Schema.XmlSchemaForm.None, Order = 0)]
        public string[] item
                return this.itemField;
                this.itemField = value;
        //...snipped INPC stuff

I think its either the attributes or the ougWSResponse class definition that's wrong.

Any pointers or articles to check would be great. I do find attributes to have the most useless documentation (that concentrates on their definition and not what most people want their usage!)
Posted 21-Feb-13 2:21am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171016.2 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100