Click here to Skip to main content
15,938,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing an issue while constructing a message of defined typed schema. The root node of the schema is of complex type. Say Node name is "MessageRequest", but the type is complex and is named as "MessageInput". I have generated the class for this schema and looks similar to the below code:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "namespace")]
    [System.Xml.Serialization.XmlRootAttribute("MessageRequest", Namespace = "namespace", IsNullable = false)]
    public partial class MessageInput

Now in BizTalk construct message shape, i try to create the message of same schema type, it is throwing invalid cast exception Says "Cannot implicitly convert from class type to schema type.
msg_Input = Namespace.GenerateToInput();

Thanks in advance for your help.


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

  Print Answers RSS

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900