Forum Replies Created
-
AuthorPosts
-
Hi Daniel,
No I haven’t configured any of the EDI Properties for this party. I should have mentioned that the Base EDI adapter is being used and not native EDI functionality. The scenario is basically the following:
A file receive location configure with the Base EDI adapter EDI://9313938000631:ZZ:9313938000631 and an passthrough send port subscribing to the receive port.
Hi,
Your best best is to do the following:
1) Download and install iTextSharp, an open source tool (http://sourceforge.net/projects/itextsharp/files/) that allows you to embed PDF conversion functionality in .NET applications.
2) Write a custom disassembler component (that will be called from a receive pipeline in a BizTalk project later on) that will interact with the iTextSharp library component (installed in step 1) to convert the PDF data stream into XML and return that object to your BizTalk orchestration.
Hope this helps,
Daniel.
Hi,
Since the problem occurs sporadically it was not possible for me to debug the pipeline.
A 3rd party application places files on a file share and the receive port gets every XML by applying my custom receive pipeline. (There is no orchestration related to the implementation). Then every send port which has it’s own filtering conditions , picks up a message and posts it to a Sharepoint form library. At this time a send pipeline is also applied to the message in order to keep the initial file name of the message. (This however is not the problem, cause the problem also occurs without using the send pipeline).
If I had 2 send ports with the same filters picking a message at the same time, I think that I would always have duplicates in one or more Libraries.
I did not understand exactly what you mean by “Or, subscription is “different”, but some conditions are same”. Could you please explain?
Thanks.
Hey Greg,
Do you know any source where I can find PDF adapter to receive pdf file in Biztalk ?
Hi,
Did you configure the Edi properties for this party? Specifically, the Party as Interchange Sender information under the Edifact Properties entry…
Daniel.
June 8, 2010 at 12:56 PM in reply to: How to connect two web service from different application with BizTak… #24912Hi Nengsih,
I would hope that the documentation from the ESB toolkit should be sufficient to get you started on an implementation. If along the process, you run into some roadblocks, then you could come to this forum to ask relevant questions, but don’t expect anyone here to hold your hands all the way through an ESB implementation (unless that person is hired as a consultant).
Daniel.
OK. That sounds like a solution I can work with.
But now I will try to do that.I will let you know then! 🙂
Thank you…
Hi,
One suggestion I have is:
1) Make your HTML send port dynamic (I assume it’s the SaveHTML port in the Port Surface in your diagram above), and use the FILE.ReceivedFileName context property of your initial message (assuming it’s ReceiveMessage) as part of your destination filename (make sure to parse out the “.xml” extension).
2) In an Expression shape before your HTML send port, you can do the following assignment (to dynamically configure your send port):
saveHTML(Microsoft.XLANGs.BaseTypes.Address) = “FILE://YourPath/YourFileName.html”;
Where YourFileName is obtained from step 1.
I hope this is a workable solution for you.
Daniel.
Hey Bizzy,
I had the same problem, and found out that the adapter creates 2 messages. First is your EDI, it also creates a zero byte message which you need to handle within a custom pipeline component, give it a special Message type so you can subscribe to it and dump it somewhere. This is obviously not the best solution, but it allowed us to move forward. Not sure if this is a bug or a setup issue.
Good luck!Karmel
Art2link CorportationOn my SendPort there will the File saved as %MEssageID%.html but how can I use that in the Biztalk Expression Editor?
I tried:
SendMessage2 = ReceiveMessage;
SendMessage2(SMTP.EmailBodyTextCharset) = “UTF-8”;
SendMessage2(SMTP.Subject) = “Testmail mit URL”;
SendMessage2(SMTP.EmailBodyText) = “http://localhost/biztalk/” +
System.Convert.ToString(ReceiveMessage(BTS.MessageID)) + “/” +
System.Convert.ToString(SendMessage(BTS.InAppStreamGUID));But both are not the correct one.
Hi,
In your application, do you have a place where the XSL Transform component is invoked (through the public IBaseMessage Execute method), whether it’s in or outside of BizTalk? Where that method is called is the place you should look at to see how the HTML filename is generated (and that provides you with a way to return that filename value to your BizTalk orchestration).
Daniel.
June 8, 2010 at 7:41 AM in reply to: Building BizTalk Solution, Access to path <path > denied #24906@thanks for all answers
Finally it works. I don’t know exactly why, but now I’m able to build. I changed all referenced first to dll’s and later back to project-references. Now it works. I don’t understand this.
I use the same solution-structure as you have. But to make a final version I like to build all together.
Thanks again
Hi Daniel
A mlittle bit late but I had some days off…
Please find the code below…
//———————————————————————
// Datei: XslTransformer.cs
// Beschreibung: Eine Pipeline, welche mittels eines XSL Dokumentes
// eingehende XML nachrichten (messages) in ein HTML Dokumnet konvertiert
// Beispiel: Erstellt aus Vorlage aus dem SDK von MS BizTalk Server 2006
//———————————————————————using System;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
using System.ComponentModel;
using System.Collections;
using Microsoft.BizTalk.Message.Interop;
using Microsoft.BizTalk.Component.Interop;
using Microsoft.Win32;namespace Microsoft.BizTalk.SDKSamples.Pipelines.XslTransformComponent
{
/// Implements a pipeline component that applies Xsl Transformations to XML messages
/// </summary>
/// <remarks>
/// XslTransformer class implements pipeline components that can be used in send pipelines
/// to convert XML messages to HTML format for sending using SMTP transport. Component can
/// be placed only in Encoding stage of send pipeline
/// </remarks>
[ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
[ComponentCategory(CategoryTypes.CATID_Encoder)]
[System.Runtime.InteropServices.Guid(“FA7F9C55-6E8E-4855-8DAC-FA1BC8A499E2”)]
public class XslTransformer : Microsoft.BizTalk.Component.Interop.IBaseComponent,
Microsoft.BizTalk.Component.Interop.IComponent,
Microsoft.BizTalk.Component.Interop.IPersistPropertyBag,
Microsoft.BizTalk.Component.Interop.IComponentUI
{
private string xsltPath = null;
/// <summary>
/// Location of Xsl transform file.
/// </summary>
public string XsltFilePath
{
get { return xsltPath;}
set { xsltPath = value;}
}
#region IBaseComponent
/// <summary>
/// Name of the component.
/// </summary>
[Browsable(false)]
public string Name
{
get { return “XSL Transform Component”; }
}
/// <summary>
/// Version of the component.
/// </summary>
[Browsable(false)]
public string Version
{
get { return “1.0”; }
}
/// <summary>
/// Description of the component.
/// </summary>
[Browsable(false)]
public string Description
{
get { return “XSL Transform Pipeline Component”; }
}
#endregion
#region IComponent/// <summary>
/// Implements IComponent.Execute method.
/// </summary>
/// <param name=”pc”>Pipeline context</param>
/// <param name=”inmsg”>Input message.</param>
/// <returns>Converted to HTML input message.</returns>
/// <remarks>
/// IComponent.Execute method is used to convert XML messages
/// to HTML messages using provided Xslt file.
/// It also sets the content type of the message part to be “text/html”
/// which is necessary for client mail applications to correctly render
/// the message
/// </remarks>
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
inmsg.BodyPart.Data = TransformMessage(inmsg.BodyPart.Data);
inmsg.BodyPart.ContentType = “text/html”;
return inmsg;
}
#endregion#region Helper function
/// <summary>
/// Transforms XML message in input stream to HTML message
/// </summary>
/// <param name=”stm”>Stream with input XML message</param>
/// <returns>Stream with output HTML message</returns>
private Stream TransformMessage(Stream stm)
{
MemoryStream ms = null;
string validXsltPath = null;
try
{
// Get the full path to the Xslt file
validXsltPath = GetValidXsltPath(xsltPath);
// Load transform
XslTransform transform = new XslTransform();
transform.Load(validXsltPath);
//Load Xml stream in XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load(stm);
//Create memory stream to hold transformed data.
ms = new MemoryStream();
//Preform transform
transform.Transform(doc, null, ms, null);
ms.Seek(0, SeekOrigin.Begin);
}
catch(Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
System.Diagnostics.Trace.WriteLine(e.StackTrace);
throw e;
}return ms;
}/// <summary>
/// Liefert den Pfad zur Xslt file
/// Wenn kein Pfad in den Eigenschaften der Pipeline angegeben ist,
/// wird in der Registry gesucht
/// Hier ist der Pfad in den Properties der Pipeline eingetragen
/// –> E:\BizTalk\Computerlinks Orchestrations\RONNY\XslTransformComponent\XslTransform\bin\Debug\XslTransform.dll
/// </summary>
/// <param name=”path”>Pfad des Users aus dem Pipeline Designer</param>
/// <returns>Gibt den vollständigen Pfad der XSLT Datei</returns>
private string GetValidXsltPath(string path)
{
string validPath = path;if (!System.IO.File.Exists(path))
{
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@”SOFTWARE\Microsoft\BizTalk Server\3.0″);
string InstallPath = string.Empty;
if (null != rk)
InstallPath = (String)rk.GetValue(“InstallPath”);
validPath = InstallPath + @”Pipeline Components\” + path;
if (!System.IO.File.Exists(validPath))
{
throw new ArgumentException(“The XSL transformation file ” + path + ” can not be found”);
}
}return validPath;
}#endregion
#region IPersistPropertyBag
/// <summary>
/// Gets class ID of component for usage from unmanaged code.
/// </summary>
/// <param name=”classid”>Class ID of the component.</param>
public void GetClassID(out Guid classid)
{
classid = new System.Guid(“FA7F9C55-6E8E-4855-8DAC-FA1BC8A499E2”);
}
/// <summary>
/// Not implemented.
/// </summary>
public void InitNew()
{
}
public void Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, Int32 errlog)
{
string val = (string)ReadPropertyBag(pb, “XsltFilePath”);
if (val != null) xsltPath = val;
}
/// <summary>
/// Saves the current component configuration into the property bag.
/// </summary>
/// <param name=”pb”>Configuration property bag.</param>
/// <param name=”fClearDirty”>Not used.</param>
/// <param name=”fSaveAllProperties”>Not used.</param>
public void Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, Boolean fClearDirty, Boolean fSaveAllProperties)
{
object val = (object)xsltPath;
WritePropertyBag(pb, “XsltFilePath”, val);
}/// <summary>
/// Reads property value from property bag.
/// </summary>
/// <param name=”pb”>Property bag.</param>
/// <param name=”propName”>Name of property.</param>
/// <returns>Value of the property.</returns>
private static object ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName)
{
object val = null;
try
{
pb.Read(propName,out val,0);
}catch(System.ArgumentException)
{
return val;
}
catch(Exception ex)
{
throw new ApplicationException( ex.Message);
}
return val;
}private static void WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, string propName, object val)
{
try
{
pb.Write(propName, ref val);
}
catch(Exception ex)
{
throw new ApplicationException( ex.Message);
}
}
#endregion#region IComponentUI
/// <summary>
/// Component icon to use in BizTalk Editor.
/// </summary>
[Browsable(false)]
public IntPtr Icon
{
get { return IntPtr.Zero; }
}/// <summary>
/// The Validate method is called by the BizTalk Editor during the build
/// of a BizTalk project.
/// </summary>
/// <param name=”obj”>Project system.</param>
/// <returns>
/// A list of error and/or warning messages encounter during validation
/// of this component.
/// </returns>
public IEnumerator Validate(object projectSystem)
{
if (projectSystem==null)
throw new System.ArgumentNullException(“No project system”);IEnumerator enumerator = null;
ArrayList strList = new ArrayList();try
{
GetValidXsltPath(xsltPath);
}
catch(Exception e)
{
strList.Add(e.Message);
enumerator = strList.GetEnumerator();
}return enumerator;
}#endregion
}
}Thanks for your help
June 8, 2010 at 1:27 AM in reply to: How to connect two web service from different application with BizTak… #24904Hayy NealWalters,,,
Yeeep,
it can be one solution…
But, is it right to use that solution to connect many system??
I mean, i will integrate many system with many sistem…
Let’s say that i will integrate 4 application to 4 application…
I want to use BizTalk to remove the point-to-point connection, Sir…
That’s right??
Actually, i want to implement ESB (Enterprise Service Bus) architecture Sir…
Give me some suggestion….
Great thanks,
Nengsih Fitria
Hi,
Did you go with debug from start point (receive pipeline) to end point? What is between ports? (Is there an orchestration, or it’s a CBR?) Can it be – that two send port subscribed on same values and send your message to same destination? Or, subscription is “different”, but some conditions are same? And two messageg go to same destination.
-
AuthorPosts