|
Home > Archive > BizTalk Server General > December 2005 > How to prefix text to an xml message being received!
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
How to prefix text to an xml message being received!
|
|
| Srinivas Appana 2005-12-07, 5:55 pm |
| Hi,
How can i prefix a string in front of the XML message being Received from a
file. Basically i am trying to add the xml header (<?xml version="1.0"
encoding="ISO-8859-1"?> ) to the xml received.
Thanks,
- SA
| |
| Tomas Restrepo \(MVP\) 2005-12-08, 5:54 pm |
| Srinivas,
> How can i prefix a string in front of the XML message being Received from
> a
> file. Basically i am trying to add the xml header (<?xml version="1.0"
> encoding="ISO-8859-1"?> ) to the xml received.
You could certainly do it with a custom pipeline component that prepends the
xml declaration just before the disassemble stage.
However, why would you want to do it?
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
| Srinivas Appana 2005-12-08, 5:54 pm |
| HI Tomas,
The problem i am getting the following error with the default XMLReceive
pipeline as we have german chars in our messages and it does not have any xml
header declared.
********************
"There was a failure executing the receive pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML disassembler"
Receive Location: "C:\Biztalk\Receive\BuPaIDoc\*.xml" Reason: Error trying to
parse the incoming document: "There is an invalid character in the given
encoding. Line 28, position 15.". "
*********************
The receive succeeds if i prefix the xml with the xml header as follows
<?xml version="1.0" encoding="ISO-8859-1"?>.
I there a better way to solve this problem?
Thanks,
- SA
"Tomas Restrepo (MVP)" wrote:
> Srinivas,
>
>
> You could certainly do it with a custom pipeline component that prepends the
> xml declaration just before the disassemble stage.
>
> However, why would you want to do it?
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
>
>
>
| |
| Tomas Restrepo \(MVP\) 2005-12-08, 5:54 pm |
| Srinivas,
>
> The problem i am getting the following error with the default XMLReceive
> pipeline as we have german chars in our messages and it does not have any
> xml
> header declared.
>
> ********************
> "There was a failure executing the receive pipeline:
> "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML disassembler"
> Receive Location: "C:\Biztalk\Receive\BuPaIDoc\*.xml" Reason: Error trying
> to
> parse the incoming document: "There is an invalid character in the given
> encoding. Line 28, position 15.". "
> *********************
> The receive succeeds if i prefix the xml with the xml header as follows
> <?xml version="1.0" encoding="ISO-8859-1"?>.
>
> I there a better way to solve this problem?
Humm... two come to mind:
If you add the xml declaration, then you could add it, as I said before,
using a custom pipeline component that is run before the disassemble stage
(during decoding, actually). However, you need to make sure it is added in
ASCII/UTF-8, otherwise it might not be correctly recognized. You also need
to watch out for messages that already contain the declaration.
Another possibility is to write, again, a custom pipeline component in the
same stage, but this time to set the Charset property of the message's body
part (IBaseMessagePart) to the one you're interested in. The XmlDisassembler
will pick then use that encoding to disassemble the message.
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
|
|
|
|
|