Answered by:
MessageContract issue with Web Service Software Factory

Question
-
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.
<xs:element name="SubmitRequest">.... </xs:element>
When I generate the Code from Host Designer, it creates MessageContract class like below...
namespace Service.MessageContracts { /// <summary> /// Service Contract Class - SubmitRequest /// </summary> [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; } } }
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?
Chintan
Wednesday, February 20, 2013 5:14 PM
Answers
-
There was an issue with the Namespace.
I specified the same namespace with Service Contract and XSD Message and that's the reason it was not performing the Schema Validation.
When I specified the different namespace for XSD Message in Service Designer file, it started working correctly.
Chintan
- Edited by Chintan - Strings Tuesday, February 26, 2013 9:58 PM
- Marked as answer by Chintan - Strings Tuesday, February 26, 2013 9:58 PM
Tuesday, February 26, 2013 9:57 PM
All replies
-
Hi,
Thanks for your post.
From your description, the issue is related to a tool at this page, so I'd suggest you post the issue in DISCUSSIONS tab or ISSUE TRACKER tab at that page to get better help, thanks for your understanding.
Best Regards.
Haixia
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Thursday, February 21, 2013 10:01 AM -
There was an issue with the Namespace.
I specified the same namespace with Service Contract and XSD Message and that's the reason it was not performing the Schema Validation.
When I specified the different namespace for XSD Message in Service Designer file, it started working correctly.
Chintan
- Edited by Chintan - Strings Tuesday, February 26, 2013 9:58 PM
- Marked as answer by Chintan - Strings Tuesday, February 26, 2013 9:58 PM
Tuesday, February 26, 2013 9:57 PM