Re: Problem with solicit-response adapter BTS 2004

From: Vladimir Tchalkov (vlado_at_act-soft.nspam.com)
Date: 06/07/04


Date: Mon, 7 Jun 2021 20:03:44 +0300

Hi Kelly,

I had similiar problems with my adapter. My mistake was the encoding of the
xml response file.
I used ANSI encoding with code page 1251. I changed this to UTF8 and it
worked.
I think the problem was that I was missing the XML header and the encoding
of the response was not specified.
So try UTF8 or try to add a XML header specifying the encoding.

Best regards,
Vladimir

"Kelly Fulks" <kfulks@knology.net> wrote in message
news:bc02a42a.0406041149.43cbbfe4@posting.google.com...
> I am attempting to build a solicit-response adapter for biztalk 2004.
> I have studied the sample code included with the biztalk SDK and
> believe that I understand what is being done. I have taken the base
> adapter code from the Common section of the Adapter section of the SDK
> and built it into an assembly. My code is written in vb.net as that
> is a requirement of the project and is in a separate assembly.
>
> My adapter will receive the xml from biztalk fine. I am using a
> static document for the return at this time for testing. I am
> preparing the document and then putting it into the response message.
> When the response message gets back into biztalk there is an error as
> shown below:
>
> There was a failure executing the receive pipeline:
> "Microsoft.BizTalk.DefaultPipelines.XMLReceive" Source: "XML
> disassembler" Receive Location:
> "Provider=***; InitialCatalog=***;" Reason: None of the
> components at Disassemble stage can recognize the data.
>
> The XML will validate fine against the schema and I can even use HAT
> to save the message from BizTalk and that message will validate. The
> namespace is correct and verified and is included in the HAT error
> message properly. I have included some code below in hopes that
> someone will see an obvious error in what I am doing. The code is
> from the "EnqueueWorkItem" routine and all XML documents that are
> saved work properly. It is strictly the one that is returned to
> BizTalk that causes a problem.
>
> ----- begin code here -----
> Dim XmlString As String
> XmlString = "<ns0:RimsResults
> xmlns:ns0='http://ingr-isg.com/Palmetto/'>" & _
> "<ns0:RimsResult>" & _
> "<ns0:LRSData County='32' RouteType='4' Route='20'
> RouteAux='1' Dir='1' />" & _
> "<ns0:DynSegData BMP='0.0' EMP='1.0' />" & _
> "<ns0:OutputColumns>" & _
> "<ns0:OutputColumn Name='NbrLanes' Value='2' />" & _
> "</ns0:OutputColumns>" & _
> "</ns0:RimsResult>" & _
> "<ns0:RimsResult>" & _
> "<ns0:LRSData County='32' RouteType='4' Route='20'
> RouteAux='1' Dir='1' />" & _
> "<ns0:DynSegData BMP='1.0' EMP='1.2' />" & _
> "<ns0:OutputColumns>" & _
> "<ns0:OutputColumn Name='NbrLanes' Value='2' />" & _
> "</ns0:OutputColumns>" & _
> "</ns0:RimsResult>" & _
> "<ns0:RimsResult>" & _
> "<ns0:LRSData County='32' RouteType='4' Route='20'
> RouteAux='1' Dir='1' />" & _
> "<ns0:DynSegData BMP='1.2' EMP='1.9' />" & _
> "<ns0:OutputColumns>" & _
> "<ns0:OutputColumn Name='NbrLanes' Value='2' />" & _
> "</ns0:OutputColumns>" & _
> "</ns0:RimsResult>" & _
> "</ns0:RimsResults>"
>
> ' Need to do the real work here - KLF
> ' For now we are using a fixed response to get everything working.
> Dim myResultsDom As System.Xml.XmlDocument
> myResultsDom = New System.Xml.XmlDocument
> myResultsDom.LoadXml(XmlString)
>
> myMsgFactory = Me.TransportProxy.GetMessageFactory
> myResponsePart = myMsgFactory.CreateMessagePart
> myResponse = myMsgFactory.CreateMessage
> myResponse.AddPart("body", myResponsePart, True)
> \myStream = New System.IO.MemoryStream
> myResponse.BodyPart.Data = myStream
>
> ' Save the response to the message and to a file for comparison
> purposes
> ' the file save will go away after debugging - KLF
> myResultsDom.Save(myStream)
> myResultsDom.Save("C:\temp\MyRspDocument.xml")
>
> ' This places the response into BizTalk
> btsBatch = New StandardTransmitBatchHandler(Me.TransportProxy, True)
> btsBatch.SubmitResponseMessage(msg, myResponse, myResultsDom)
> ' This gets the original message out of the message queue within
> BizTalk Server
> btsBatch.DeleteMessage(msg, Nothing)
> btsBatch.Done(Nothing)
> ----- end code here -----
>
> Any ideas? Thanks!



Relevant Pages