XmlElement Question
-
I have the following webservice which gets a xml payload I would like to take that payload validate it against a schema then send it to websphere MQ. I have a good portion working but when I write the payload to MQ its empty almost like I am not able to get the information being sent in. Here is the code I am using and any help would be great as I have hit a road block and still pretty new to all this. /// [System.Web.Services.Protocols.SoapHeaderAttribute("payloadManifest", Direction=System.Web.Services.Protocols.SoapHeaderDirection.InOut)] [System.Web.Services.WebMethodAttribute()] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://arknet.arkona.com/wsTransport/service/ProcessMessage", RequestNamespace="http://www.starstandards.org/webservices/2005/10/transport", ResponseNamespace="http://www.starstandards.org/webservices/2005/10/transport", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Binding="starTransport")] public virtual void ProcessMessage([System.Xml.Serialization.XmlElementAttribute(ElementName="payload")] ref Payload payload) { //Here is the Code that reads the XML Payload Stream and Validates it to the correct Schema before sending the message forward. //System.Xml.XmlElement xe = payload.content[0].Any; //XmlDocument xmlDoc = xe.OwnerDocument; //xmlDoc.Schemas.Add(null, "http://localhost/wsTransport/ProcessCRM.xsd"); //xmlDoc.Validate(delegate(object sender, ValidationEventArgs vargs) //{ // Console.WriteLine("{0}: {1}", vargs.Severity, vargs.Message); //}, xe); System.Xml.XmlElement xe = payload.content[0].Any; XmlDocument xmlDoc = xe.OwnerDocument; string qManager = "ARKDEV.QUEUE.MANAGER"; string channel = "SYSTEM.ADMIN.SVRCONN"; string hostName = "arkdev.arkona.com"; string qName = "ROB.IN.QUEUE"; MQEnvironment.Hostname = (hostName); MQEnvironment.Channel = (channel); MQEnvironment.Port = 1414; try { MQQueueManager qMgr = new MQQueueManager(qManager); MQQueue queue = qMgr.AccessQueue(qName, MQC.MQOO_OUTPUT); MQMessage msgData = new MQMessage();