Closed NealWalters closed 6 years ago
Try using -SerializeAs "text/plain"
and you'll also probably need to use Get-Content -Raw
to prevent the XML being turned into an array of strings.
By default Send-RabbitMqMessage assumes you'll be trying to send an object (and that PowerShell will be on both ends) and so it runs the input through Export-CliXML
. Then in Wait-RabbitMqMessage
if the content type is application/clixml+xml
it will run the XML through Import-Clixml so that it can spit an object back out on the other side.
Adding ' -SerializeAs "text/plain" ' to the Send-RabbitMqMessage worked great. No need to change the Get-Content.
Thanks! Neal
Without the details of the security and servername, I'm sending a message like this:
When I read it using PSRabbitMQ it looks okay. But when doing a Get Message from RabbitMQ web interface (or BizTalk Server) the message has been wrapped with a lot of XML.
Example XML:
I find my data in there, for example I have a city name of Ontario. In my XML:
<N401>ONTARIO</N401>
In the above XML:
How do I get the message to be stored in my simple original XML without all that Powershell XML wrapper "stuff" around it?
Thanks, Neal Walters