ok question I have is how do I get this stream that I write to a string later in my code.
// 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/ProcessCreditContract.xsd"
);
xmlDoc.Validate(delegate(o
bject sender, ValidationEventArgs vargs)
{
Console.WriteLine("{0}: {1}", vargs.Severity, vargs.Message);
}, xe);
When I grab it here I can validate the xml against a .xsd file without issue. Now I want to take that same xml
and write it to a Websphere MQ Queue
something like this
MQMessage xmlPayload = new MQMessage();
XmlDocument xmlDoc = xe.OwnerDocument;
xmlPayload.WriteString(xml
Payload);
but I get the following error
------ Build started: Project: e:\projects\transWSEngine\
, Configuration: Debug .NET ------
Validating Web Site
Building directory '/transWSEngine/App_Code/S
TARTranspo
rt2005Arko
naMS/'.
e:\projects\transWSEngine\
App_Code\S
TARTranspo
rt2005Arko
naMS\servi
ce.cs(129,
33): error CS0136: A local variable named 'xmlDoc' cannot be declared in this scope because it would give a different meaning to 'xmlDoc', which is already used in a 'parent or current' scope to denote something else
e:\projects\transWSEngine\
App_Code\S
TARTranspo
rt2005Arko
naMS\servi
ce.cs(130,
21): error CS1502: The best overloaded method match for 'IBM.WMQ.MQMessage.WriteSt
ring(strin
g)' has some invalid arguments
e:\projects\transWSEngine\
App_Code\S
TARTranspo
rt2005Arko
naMS\servi
ce.cs(130,
44): error CS1503: Argument '1': cannot convert from 'IBM.WMQ.MQMessage' to 'string'
Validation Complete
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
any help would be great as I am so close to getting this project finished just need to get over this last step.