community-content

Forum Replies Created

Viewing 15 posts - 7,756 through 7,770 (of 9,652 total)
  • Author
    Posts
  • in reply to: Dynamic Mapping: SalesOrder to PurchaseOrder(s) #15012

    You will need a two stage process one to group the LineItems by supplier and one to split the document into separate purchase orders.

    There are a number of ways to group the line items
    [url]http://www.biztalkgurus.com/Samples/Sorting-Grouping.html[/url]

    my preferred method is using a custom Xslt with <xsl:key>
    [url]http://www.biztalkgurus.com/forums/viewtopic.php?t=637[/url]

    To first link also show how to debtach the purchase orders

    in reply to: Human workflow service #13963

    There isn’t much out there on HWS. It is something I have never used myself.

    I know the BizTalk Server 2004 Unleashed book has a chapter on Human Based Workflow. I’ve not looked at it, but that might help you out.

    Messages are made of two parts, a message context and a stream.

    Although you have defined your messages using .Net objects those objects are not deserialized from the message. You will receive an Xml serialization of that object in the data stream of the message – in fact the Xml that was posted to the web service.

    If you wish to access this data using your object you will need to deserialize this inside the orchestration and serialize it if you wish to send it anywhere.

    in reply to: Creating Zip-Files in send pipeline #14986

    I’m not even sure I understand your code. Why are you creating a file from your pipeline component? What for?

    in reply to: Creating Zip-Files in send pipeline #14979

    My Component is the last step of the pipeline.

    here is code part:

    C#

    #region IComponent Member

    IBaseMessage Microsoft.BizTalk.Component.Interop.IComponent.Execute
    (IPipelineContext pContext, IBaseMessage pInMsg)
    {

    Stream strmInputFile, DataStream;
    string MessageID;
    string BizTalkTempFolder = \”c:\\\\BizTalk_Temp\\\\\”;
    IBaseMessagePart MsgPart, RecendFileName;
    byte[] ZipBuffer = new byte[32768];
    Int32 bytesRead;
    MemoryFile memFile;

    MsgPart = pInMsg.BodyPart;
    strmInputFile = MsgPart.GetOriginalDataStream();
    MessageID = MsgPart.PartID.ToString();

    FileStream OutPutFile = new FileStream(BizTalkTempFolder + MessageID + \”.exe\”, FileMode.Open , FileAccess.Read);
    BinaryReader OutStreamBinary = new BinaryReader(OutPutFile);

    MemoryStream OutputStream = new MemoryStream();

    byte[] OutBuffer = new byte[ 1024 ];
    int OutBufferRead;

    while( ( OutBufferRead = OutPutFile.Read( OutBuffer, 0, OutBuffer.Length ) ) > 0 )
    {
    OutputStream.Write( OutBuffer, 0, OutBufferRead );
    }

    OutputStream.Position = 0;
    MsgPart.Data = OutputStream;
    pContext.ResourceTracker.AddResource(OutputStream);

    // OutPutFile.Close();
    // delete OutPutFile.

    return pInMsg;

    }

    #endregion

    }

    The InputFile is a XML or Flate File and the Output File is a Zip or SFX File.

    So i Hope you can find the error in that code.

    in reply to: Creating Zip-Files in send pipeline #14985

    Is your custom pipeline component running as the last step of the pipeline (i.e. in the Encode step)? You don’t want to run it before the assembler (it would’t run anyway).

    It might also be that you’re forgetting to flush your stream correctly while writing to it, or that you’re not rewinding the stream correctly before handling it back to the messaging engine once you finish executing. What’s your code like?

    in reply to: Why does Biztalk Adjust Date? #13985

    [quote:f2806c42d6=\”nwalters\”]
    It seems odd, but it shows 6 hours previous i.e. 3AM, which is NOT GMT.
    Apparently if you take a non-GMT time and try to convert it to GMT, it goes backwards!
    [/quote:f2806c42d6]

    I think what you’re seeing is being a victim of a fairly nasty issue in the way the .NET Frameworks treats datetimes. Basically, it always wants to have them in local time, which particularly causes problems when XmlSerialization is involved (and hence XmlConvert.ToString()). Here’s a couple of articles with some info:

    [url]http://blogs.msdn.com/brada/archive/2004/04/13/112784.aspx[/url]
    [url]http://blogs.msdn.com/bclteam/archive/2005/03/07/387677.aspx[/url]

    Probably what happens is that BizTalk Reads your datetime, realizes it has a -6 hours offset, and uses that to compute what the local time for that would be. And then gives you that.

    in reply to: custom xsl works differently inside map #15007

    Neal, thanks for your reply.

    I put together a simple test case, and I found that the problem did not occur for the simplest case of taking the union of two sets.

    However, the problem did occur when one of those sets came from an external source. I use an inline c# script to import nodes from an external file. There are two differences between the map and the VS debugger. First, when I use VS, I can use the nodes returned by the c# script immediately. But in the map I have to convert them to a node set using msxsl:node-set(). And second, even after I convert it, the union of the two sets is not the same in each case. In the map, the union appears to be incomplete.

    I included my xsl and my input files below. If you have a chance to run it throught those different processors, that would be great.

    Input Doc 1:
    <root>
    <node_type_1>type1, data 1</node_type_1>
    </root>

    Input Doc 2:
    <root>
    <node_type_2>type2, data 1</node_type_2>
    <node_type_2>type2, data 2</node_type_2>
    <node_type_2>type2, data 3</node_type_2>
    </root>

    Stylesheet:
    <?xml version=’1.0′ encoding=’utf-8′?>
    <xsl:stylesheet version=\”1.0\” xmlns:xsl=\”http://www.w3.org/1999/XSL/Transform\”
    xmlns:xsi=\”http://www.w3.org/2001/XMLSchema-instance\”
    xmlns:msxsl=\”urn:schemas-microsoft-com:xslt\”
    xmlns:userCSharp=\”http://schemas.microsoft.com/BizTalk/2003/userCSharp\”
    >

    <xsl:output method=\”xml\” indent=\”yes\”/>

    <xsl:template match=\”/\” >

    <xsl:variable name=\”externalDoc\” select=\”userCSharp:RetrieveXMLDocument(‘C:\\Biztalk Projects\\M3.WorkRequest\\SOWSchema\\XSL\\union_test2.xml’)\” />

    <xsl:variable name=\”set1\” select=\”//node_type_1\” />
    <xsl:variable name=\”set2\” select=\”msxsl:node-set($externalDoc)/node_type_2\” />
    <root>
    <xsl:copy-of select=\”$set1 | $set2\”/>
    </root>
    </xsl:template>

    <msxsl:script language=\”C#\” implements-prefix=\”userCSharp\”>
    <![CDATA[
    public static System.Xml.XmlNode RetrieveXMLDocument(string url)
    {
    System.IO.Stream responseStream = null;
    try
    {
    responseStream = (System.IO.Stream)new System.IO.FileStream(url, System.IO.FileMode.Open);
    System.Xml.XmlDocument xDoc = new System.Xml.XmlDocument();
    xDoc.Load(responseStream);
    System.Xml.XmlNode node = xDoc.FirstChild;
    while (node.NodeType != System.Xml.XmlNodeType.Element)
    {
    node = node.NextSibling;
    }
    return node;
    }
    finally
    {
    if (responseStream != null)
    {
    responseStream.Close();
    }
    }
    }

    ]]>
    </msxsl:script>
    </xsl:stylesheet>

    in reply to: Help calling a web service #15002

    I ran into something similar a few months ago.

    If I remember correctly, at least one of the input to the web service had to come from a BizTalk Message. Must have something to do with constructing the request message.

    Try creating a distinguished field and using that as your input to the web service rather than hard coding it.

    Also, make sure you are constructing the multi-part message BizTalk created for you when you added the web reference. It should have a part for each input parameter. That is what you want to set.

    Not sure it that will work – but I guess it’s worth a try.

    in reply to: Why does Biztalk Adjust Date? #13984

    Here’s my get-around:

    dtTempDateTime = msgPaymentUpdateRequest.RequestDateTime;

    strRequestDateTime =
    System.Convert.ToString(dtTempDateTime.ToLocalTime());

    This really doesn’t make sense to me, but it works.

    I created a C# Console program as follows:

    [code:1:55c4620cde]DateTime myDateTime = DateTime.Now;
    Console.WriteLine(\"DateTime=\" + myDateTime);
    Console.WriteLine(\"ToLocalTime\" + myDateTime.ToLocalTime());
    Console.ReadLine(); [/code:1:55c4620cde]

    It seems odd, but it shows 6 hours previous i.e. 3AM, which is NOT GMT.
    Apparently if you take a non-GMT time and try to convert it to GMT, it goes backwards!

    Neal

    in reply to: Why does Biztalk Adjust Date? #13983

    I just noticed that the date has an extra \”bonus feature\” after the time:

    RequestDateTime=\”2006-07-07T09:06:09.5156250-06:00\”/>

    Note the -06:00 after the hour/min/seconds.

    I haven’t seen this before, but I think it is the cause of the problem.
    Our website serializes a .NET class, and it serializes the date/time to this format.

    In the first post, my variable strRequestDateTime was actually a DateTime. I tried changing variable to a string, and did this:

    strRequestDateTime = System.Convert.ToDateTime(etc)…

    and it still converted it 6 hours ahead.

    Neal

    in reply to: custom xsl works differently inside map #15006

    I did just realize a workaround for my union problem …

    <xsl:variable name=\”varUnion\” >
    <xsl:copy-of select=\”$var1\” />
    <xsl:copy-of select=\”$var2\” />
    </xsl:variable>

    <xsl:copy-of select=\”$varUnion\” />

    will produce the results I was looking for. However, this may not be as useful in all cases, and I would still like to know the difference between running the xsl in VS and running it in the mapper for future reference.

    Thanks,
    SBD

    in reply to: custom xsl works differently inside map #15005

    Does anyone know what xpath implementation the biztalk mapper uses? This has happened to me more than once where I apply a stylesheet to an input doc using the VS 2005 Debug XSLT feature and I get the expected result, but when I run same stylesheet with the same input through the Test Map feature, I get slightly different results.

    I posted previoulsy about the document() function not working in the mapper, and today I found that the union operator is not behaving the same way either.

    For example, I have two xsl varialbes, $var1 and $var2. $var1 is a set of one element. $var2 is a set of 3 elements.

    This code :
    <xsl:copy-of select=\”($var1 | $var2)\” />

    results in an output of 4 elements, as expected, when I run it directly in VS. When I run that same code on the same input through the map, it reults in only the one element from $var1.

    Furthermore, if I run this code:
    <xsl:copy-of select=\”($var2 | $var1)\” />

    it results in only the first element from $var2.

    Can anyone shed any light on what might be going on here?

    Thanks
    -SBD

    in reply to: xpath document() function in biztalk map #14911

    Thanks Stephen,
    That did work for me eventually … I used an inline c# method to retrieve the doc and return it to the xsl. One thing to note with this method was that I had to use the msxsl:node-set() xpath function in order to convert the result of the c# method to a usable node set.

    in reply to: SQL Server To SQL Server Integration Problem #13514

    Hi,
    i think jan is also facing the same problem as i m facing. Scenario is as follows.

    1) I have a customer table in online POS application using sql server.

    2) I have a CRM application using sql server with customer table.

    3) Now i want to update the CRM customer table as soon as new customer is added in POS customer table.

    what would be the solution in biztalk.

    [b:75258d850f]Best Regards
    Imran Shabbir[/b:75258d850f]

Viewing 15 posts - 7,756 through 7,770 (of 9,652 total)