Data at Root Level is Invalid - External assembly message transformation


hello,

in hl7 solution, in orchestration, call external assembly add node message.

so pass message body (form hl7 multipart message), input parameter.

msgmultipart_oru_r01_23_out.bodysegments = helper.biztalkmessagemanipulation.biztalkmessagemanipulation.createbodytransformzbx(msg_body_oru_out, msgmultipart_in.zsegments);

msgmultipart_oru_r01_23_out.bodysegments and msg_body_oru_out have same schema.

my method takes xmldocument input , return modified xmldocument. not creating new document, creating nodes , adding them @ end of input document. , @ end return input xmldocument new nodes added.

i tried adding xmldeclaration, have had same error.

here beginning of message receive parameter (and send back) :

<?xml version="1.0"?><ns0:oru_r01_23_glo_def xmlns:ns0="http://microsoft.com/healthcare/hl7/2x"><pid_patientidentification>...</pid_patientidentification> ... <obx_observationsegment>...</obx_observationsegment></ns0:oru_r01_23_glo_def>

here error message :

log name:      application
source:        xlang/s
date:          30/08/2012 2:07:23 pm
event id:      10034
task category: none
level:         error
keywords:      classic
user:          n/a
computer:      purkinje02.dev.fujitsu.purkinje.com
description:
xlang/s engine event log entry: uncaught exception (see 'inner exception' below) has suspended instance of service 'purkinje.bzt.transmissionclinique.orc.orcobteniretmapficsider(28ef8373-9107-114e-5a07-ea45ce63fd6b)'.
service instance remain suspended until administratively resumed or terminated. 
if resumed instance continue last persisted state , may re-throw same unexpected exception.
instanceid: 20741b03-347e-48bf-b547-15a2ad32ff0b
shape name: constructmsg_hl7_purkinje
shapeid: 720a814e-6f2b-43eb-b09d-780f7bfb5cc4
exception thrown from: segment 1, progress 13
inner exception: there error in xml document (1, 1).
        
exception type: invalidoperationexception
source: system.xml
target site: system.object deserialize(system.xml.xmlreader, system.string, system.xml.serialization.xmldeserializationevents)
following stack trace identifies location exception occured

   at system.xml.serialization.xmlserializer.deserialize(xmlreader xmlreader, string encodingstyle, xmldeserializationevents events)
   at system.xml.serialization.xmlserializer.deserialize(textreader textreader)
   at microsoft.xlangs.core.value.getobject(type t)
   at microsoft.xlangs.core.value.retrieveas(type t)
   at microsoft.xlangs.core.part.protectedretrieveas(type t)
   at microsoft.xlangs.core.part.retrieveas(type t)
   at purkinje.bzt.transmissionclinique.orc.__system_string__.get_typedvalue()
   at purkinje.bzt.transmissionclinique.orc.orcobteniretmapficsider.segment1(stopconditions stopon)
   at microsoft.xlangs.core.segmentscheduler.runasegment(segment s, stopconditions stopcond, exception& exp)
additional error information:

        data @ root level invalid. line 1, position 1.
        
exception type: xmlexception
source: system.xml
target site: void throw(system.exception)
following stack trace identifies location exception occured

   at system.xml.xmltextreaderimpl.throw(exception e)
   at system.xml.xmltextreaderimpl.throw(string res, string arg)
   at system.xml.xmltextreaderimpl.parserootlevelwhitespace()
   at system.xml.xmltextreaderimpl.parsedocumentcontent()
   at system.xml.xmltextreaderimpl.read()
   at system.xml.xmltextreader.read()
   at system.xml.xmlreader.movetocontent()
   at system.xml.serialization.xmlserializationprimitivereader.read_string()
   at system.xml.serialization.xmlserializer.deserializeprimitive(xmlreader xmlreader, xmldeserializationevents events)
   at system.xml.serialization.xmlserializer.deserialize(xmlreader xmlreader, string encodingstyle, xmldeserializationevents events)

hi,

ankit, message i'm using parameter orchestration input message, it's hl7 pipeline building it.

but, have found way make work! 

it indeed, parameters, don't know why xml (custom schema) , string not work directly parameters ...

i tried passing string value directly, didn't work.

i tried assign message parts xmldocument variables : worked xml schema typed message part, didn't string message part.

the solution :

i moved external dll call assignment shape expression shape (don't if helps, heard assignment had limitation ...)

instead of passing 2 message parts separately, used whole message single parameter, , used xlangmassage parameter type in dll method.

helper.biztalkmessagemanipulation.biztalkmessagemanipulation.createbodytransformzbx_xlang(msgmultipart_sider_in);

using microsoft.xlangs.basetypes;  public static xmldocument createbodytransformzbx_xlang(xlangmessage sidermessage) { }

then had retrieve , convert message parts : no problem xml part, string, had use stream object (other casts failed) :

xmldocument siderbodywithnewobx = (xmldocument)sidermessage[1].retrieveas(typeof(xmldocument));

stream streamsiderzsegments = (stream)sidermessage[2].retrieveas(typeof(stream)); textreader txt = new streamreader(streamsiderzsegments); string strsiderzsegments = txt.readtoend();

the reason of trouble string message part, seems hl7 undeclared zsegment, , according microsoft, not string, more blob ...

http://msdn.microsoft.com/en-us/library/ee409346.aspx



BizTalk Server  >  BizTalk Server General



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'