Answered by:
Biztalk Converting Xml tags to < and >

Question
-
Hi All,
We've an Xml message, one field for which contains html (xml again), we need to send out this message via the File adapter, when we print the message before sending it out, it's showing the message correctly (no tags inside html are converted to < or >) but when it goes out the tags have been replaced with these, we've tried using Pass thru pipeline and Xml Transmit pipeline both but same result, can someone point that how we can avoid this conversion?
Regards
Sajid
Don't wish for less problems, wish for more skills -- Jim Rohn
Thursday, May 24, 2012 8:57 AM
Answers
-
In the end we did it in pipeline...by replacing the Xml escape characters with proper xml characters, its working fine after that. I beleive since here Xml parser is involved, it only replaces with Xml escape characters not Html...because Html escape characters list is huge...and we cant replace that in code...fingers crossed!
Regards
Sajid
Don't wish for less problems, wish for more skills -- Jim Rohn
- Marked as answer by Sajid Hussain Monday, May 28, 2012 8:57 AM
Monday, May 28, 2012 8:57 AM
All replies
-
you may need to put under cdata
KiranMP
Thursday, May 24, 2012 9:29 AM -
Hi,
Use CDATA as Kiran suggested as otherwise your outgoing XML might not conform to the Schema. You can find more on CData here.
Regards,
Bali
MCTS: BizTalk Server 2010,BizTalk Server 2006 and WCF
My Blog:dpsbali-biztalkweblog
-----------------------------------------------------
Mark As Answer or Vote As Helpful if this helps.Thursday, May 24, 2012 10:21 AM -
Thanks for replying Kiran and Bali!
The field we are working with in our schema is an String, within it, it contains xml, now we wrapped it inside CData as mentioned here.
We logged the complete string and the CData was wrapped fine with all the tags intact within the string but again when the final file is outputted same result, all the tags within that string are converted to < and > dont know what's wrong now, any clue?
Regards
Sajid
Don't wish for less problems, wish for more skills -- Jim Rohn
Thursday, May 24, 2012 4:49 PM -
If you want CDATA to be present in the output, you have to set the following property in the Map.
"CDATA Section Elements"
Thanks, SKGuru
- Edited by SKGuru Thursday, May 24, 2012 5:29 PM
Thursday, May 24, 2012 5:29 PM -
Hi Sajid,
This is the same problem i have faced a year ago.
If you are using biztalk mapper then < > will be converted to < or >
you can overcome this issue if you use custom XSLT instead of Biztalk map. in XSLT when you create that node which contains your xml string use disable-outout-escaping property and set it to true. biztalk compiled map does not disable output escaping by default and there is no way to do it using Biztalk mapper so have to use XSLT.
let me know if you need more help to know how to do it. you can send me your schemas and map i will create XSLT for you if you require.
Best Regards, Rahul Dubey MCTS BizTalk Server
- Proposed as answer by Saroj kumar Das Thursday, June 20, 2013 7:20 AM
Friday, May 25, 2012 7:57 AM -
Thanks for replying Rahul & SKGuru, actually we are not using a map, we are doing message assignment to promoted properties inside orchestration, it's a string type, we've to find out a solution to some how build that string so that when it's outputted, tags are intact, so far wrapping that string around CData hasn't helped.
Regards
Sajid
Don't wish for less problems, wish for more skills -- Jim Rohn
Friday, May 25, 2012 8:28 AM -
Hi Sajid,
So, in your case same thing happens, when you assign your xml string to your promoted property XML parser escapse it automatically and thats why you are getting < or >.
After message assignment you can use a map that will only do 1-1 mapping between same schema and in that map you can call XSLT and disable output escaping, and yes this would be a little overhead in your orchestration to do this unnecessary mapping.
Best Regards, Rahul Dubey MCTS BizTalk Server
Friday, May 25, 2012 9:23 AM -
Why cant you use <any> element instead of String?
Thanks, SKGuru
Friday, May 25, 2012 1:03 PM -
Why cant you use <any> element instead of String?
Yeah, I was thinking of <any> also. But html usually is not well-formed. Not sure the xml parser will not parse the text under <any> node. If it parses then errors will be generated.
Thanks, SKGuru
Leonid Ganeline [BizTalk MVP] BizTalkien: Naming Convention for BizTalk Solutions
Saturday, May 26, 2012 1:55 AMModerator -
In the end we did it in pipeline...by replacing the Xml escape characters with proper xml characters, its working fine after that. I beleive since here Xml parser is involved, it only replaces with Xml escape characters not Html...because Html escape characters list is huge...and we cant replace that in code...fingers crossed!
Regards
Sajid
Don't wish for less problems, wish for more skills -- Jim Rohn
- Marked as answer by Sajid Hussain Monday, May 28, 2012 8:57 AM
Monday, May 28, 2012 8:57 AM -
I am also facing the same kind of issue. Actually i am trying to catch the fault contract from WCF service in bizTalk
I am getting the below error and actual fault contract object in only under tag <ErrorDescription> only and fault contract object here contains < symbols instead of xml tag
Below is the error message i can see
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP:Body>
<SOAP:Fault>
<faultcode>Microsoft BizTalk Server Negative Acknowledgment </faultcode>
<faultstring>An error occurred while processing the message, refer to the details section for more information </faultstring>
<faultactor>net.tcp://10.144.186.40/990301/FunctionPoint.svc</faultactor>
<detail>
<ns0:NACK Type="NACK" xmlns:ns0="http://schema.microsoft.com/BizTalk/2003/NACKMessage.xsd">
<NAckID>{C2D2CA73-851C-4478-9D9B-915353CF1EFE}</NAckID>
<ErrorCode>0xc0c0167a</ErrorCode>
<ErrorCategory>0</ErrorCategory>
<ErrorDescription>
System.ServiceModel.FaultException: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://Corrections.Ioms.Bpl/IDirectorService/GetOWNPendingHeadersFPServiceExceptionFault</a:Action><a:RelatesTo>urn:uuid:85711ee1-c58b-4c8e-92f7-29bead659834</a:RelatesTo><ActivityId CorrelationId="61579598-5a66-48be-b2fc-be7b4ee7cff2" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">00000000-0000-0000-0000-000000000000</ActivityId><SystemData IomsMessages="&lt;?xml version=&quot;1.0&quot;?&gt;&#xD;&#xA;&lt;ArrayOfIomsMessage xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; /&gt;" xmlns="IomsHeader" /><a:To s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/anonymous</a:To></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value></s:Code><s:Reason><s:Text xml:lang="en-NZ">Custom Exception</s:Text></s:Reason><s:Detail><FPServiceException xmlns="http://schemas.datacontract.org/2004/07/Corrections.Ioms.Bpl.Services.Web" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ExceptionMessage>ORA-1017: invalid username/password; logon denied</ExceptionMessage><InnerException></InnerException><Messages><MessageCollection><ErrorCode>E000</ErrorCode><ErrorDesc>GetOWNPendingHeadersServiceFailed</ErrorDesc><IsHalt>true</IsHalt></MessageCollection></Messages><StackTrace> at Corrections.Ioms.Bpl.Services.Data.OracleOdp.OracleHelper.ExecuteStoredProcedure(StoredProcCommand SPCmd)
at Corrections.Ioms.Bpl.Services.Data.OracleOdp.OracleHelper.ExecuteSearchProcs(StoredProcCommand SPCmd)
at Corrections.Ioms.Bpl.Collective.Jsi.Director.DataAbstraction.DirectorDal.GetOWNPendingHeaders()
at Corrections.Ioms.Bpl.Collective.Jsi.Director.Logic.DirectorLogic.GetOWNPendingHeaders()</StackTrace><Title>Custom Exception</Title></FPServiceException></s:Detail></s:Fault></s:Body></s:Envelope>
at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
</ErrorDescription>
</ns0:NACK>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>Wednesday, May 30, 2012 4:29 AM -
Hey Rahul. Your Solution worked like magic. I also faced the same problem < > was converted to < or > i used the property disable-outout-escaping="Yes". Now i am getting the right output.
Thanks a lot
saroj
Thursday, June 20, 2013 7:22 AM