Soap Envelope Question and Soap envelope on Part of MIME Document Response

6 views
Skip to first unread message

vamsi

unread,
Dec 7, 2005, 3:53:43 PM12/7/05
to Biztalk.ConfigurationErrors
Hi,


We are doing a migration from Biztalk 2000 to Biztalk 2004.Previosly
out Trading partner used to send an XML with Soap Envelope to an ASP
file.The ASP used the Biztalk Interchange to Post to Biztalk2000.After
Processing Biztalk sends back the response to the Trading Partner with
the Soap Envelope.


I am trying to find out how its adding the Soap Envelope when its
sending the response.


In the Migrated Senario i am able to establish everything in the
Response file except the SOAP Envelope.


i am not using th Biztalk interchange in the new Migrated Biztalk
2004.I am receiving the file in the ASP and droping the file in the
folder for Biztalk 2004 to pick it up from there.Biztalk 2004 picks up
the file from the folder,process the file and then sends it to the
Trading Partner.


can anyone tell me how i can resolve this problem of adding a SOAP
envelope to the Response?


Thanks,
Vamsi.
-------------------------------------------------------------------------------------------------------------------------
Answer
------------------------------------------------------------------------------------------------------------------------

Use the BTF assembler in a send pipeline. You can add the same
information
that was used in earlier versions. I used the assembler when migrating
a
BT2002 project that used SOAP in the same manner you described.


-------------------------------------------------------------------------------------------------------------------------
Question
------------------------------------------------------------------------------------------------------------------------

Hi,


I have to send a MIME Document response to the trading Partner.I have
figured out everything except on how to add a soap envelope only to a
part of the Multipart Mime response.When i was using the Biztalk
FrameWork Assembler in my send pipeline to set the soap details it
gives me this error


" '<', hexadecimal value 0x3C, is an invalid attribute character"


Can anyone help me in pointing out what i am doing wrong.Can anyone
tell me if i can use the Biztalk Framework Assembler in .net code and
call it in orchstration.If i can do that how do i set the values and
properties in .net.


Thanks,
Appreciate any help.
Vamsi

vamsi

unread,
Dec 20, 2005, 6:49:00 PM12/20/05
to Biztalk.B2B.Questions
Hi,

Answer:

In my Example ,i receive a multipart mime and send out a multipart
mime.The Multipart type i used was of Systm.XML.XMLDocument.

if i use the XML Document as the Multpart type for the Attachment part
the encoding errors out because it is expecting a XML.

In order to resolve this problem ,Microsoft has a solution of creating
a RawString Type.The RawString Type should be used for the multipart if
the second part is PDF.

The code for creating a Raw String is below


using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using System.Runtime.Serialization;

using Microsoft.XLANGs.BaseTypes;

namespace Microsoft.Samples.BizTalk.XlangCustomFormatters
{
public abstract class BaseFormatter : IFormatter
{
public virtual SerializationBinder Binder
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public virtual StreamingContext Context
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public virtual ISurrogateSelector SurrogateSelector
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}

public abstract void Serialize( Stream stm, object obj );
public abstract object Deserialize( Stream stm );
}

public class RawStringFormatter : BaseFormatter
{
public override void Serialize(Stream s, object o)
{
RawString rs = (RawString)o;
byte[] ba = rs.ToByteArray();
s.Write( ba, 0, ba.Length );
}

public override object Deserialize(Stream stm)
{
StreamReader sr = new StreamReader( stm, true );
string s = sr.ReadToEnd();
return new RawString( s );
}
}

[CustomFormatter(typeof(RawStringFormatter))]
[Serializable]
public class RawString
{
[XmlIgnore]
string _val;

public RawString(string s )
{
if (null==s)
throw new ArgumentNullException();
_val = s;
}

public RawString()
{
}

public byte[] ToByteArray()
{
return Encoding.UTF8.GetBytes( _val );
}

public override string ToString()
{
return _val;
}
}
}

Also at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_email_ibad.asp

Write this code in .Net and import the assembly in your Biztalk
Solution.

You will now be able to set the Multipart PDF type to a raw string.

This solved my problem.

Reply all
Reply to author
Forward
0 new messages