empty payload xml file websphere MQ .net

Posted on 2007-07-24
Last Modified: 2013-11-15
So I finally get MQ writing to a queue with .net and the payload / message is empty.

I am having a hard time figureing out what I need to add at this point


I grab this from an xml.element in .net

with the following

System.Xml.XmlElement xe = payload.content[0].Any;
            XmlDocument xmlDoc = xe.OwnerDocument;

I have tried strings and other such things. it just puts a blank message on MQ

here is my code

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost/wsTransport/service/ProcessMessage", RequestNamespace="", ResponseNamespace="", 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 = "";
            string qName = "ROB.IN.QUEUE";

            MQEnvironment.Hostname = (hostName);
            MQEnvironment.Channel = (channel);
            MQEnvironment.Port = 1414;

                MQQueueManager qMgr = new MQQueueManager(qManager);

                MQQueue queue = qMgr.AccessQueue(qName, MQC.MQOO_OUTPUT);

                MQMessage msgData = new MQMessage();


                MQPutMessageOptions pmo = new MQPutMessageOptions();

                queue.Put(msgData, pmo);


            catch (MQException e)
                Console.WriteLine("Error: {0}", e.ToString());
Question by:jareddraper
    1 Comment
    LVL 4

    Accepted Solution

    Here is a classic example that may help you to resolve this... Filter it by language to show C# and let me know if it doesn't provide sufficient help.

    More learning, more fun

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that undeā€¦
    This video demonstrates basic masking and how to edit the mask to reveal the desired image.
    An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now