1
Vote

MessageContract issue with Web Service Software Factory

description

I am using the Web Service Software Factory 2010 to generate my web service code. (Using WCF with XmlSerlializer)

I have request XSD file with the following as a root element.

....

When I generate the Code from Host Designer, it creates MessageContract class like below...

namespace Service.MessageContracts
{
/// 
/// Service Contract Class - SubmitRequest
/// 
[WCF::MessageContract(IsWrapped = false)]
[WCF::XmlSerializerFormat] 
public partial class SubmitRequest
{
    private DataContracts.SubmitRequest submitRequest;

    [WCF::MessageBodyMember(Namespace="service/2012/01", Order=0)]
    [System.Xml.Serialization.XmlElementAttribute] 
    public DataContracts.SubmitRequest SubmitRequestField
    {
        get { return submitRequest; }
        set { submitRequest = value; }
    }

    public SubmitRequest()
    {
    }

    public SubmitRequest(DataContracts.SubmitRequest submitRequest)
    {
        this.submitRequest = submitRequest;
    }
}
}

I don't know how it creates "SubmitRequestField" (Wrapped property of SubmitRequest)

The issue here is - this creates problem with Schema Validation. When I Create WSDL and generates Client Proxy Request they have SubmitRequestField at the top body element which fails the Schema Validation with the XSD which is having "SubmitRequest" element at the top.

Why WSSF generates this "SubmitRequestField" field automatically? Is there any way to avoid this?

comments