community-content

Forum Replies Created

Viewing 15 posts - 6,931 through 6,945 (of 9,652 total)
  • Author
    Posts
  • in reply to: How to retrieve body from a pop3 message #15959

    I do have the messagepart that holds the text. And I solved this by creating a .net class that takes a XLANGMessage variable in, read the part as  a stream into a bytearray, and converting this into a string variable which is returned.

    This certanly solved it, but it seems to be to complicated to be the best way to do it. The issue is that since I have to define the message in as XmlDocument, but the pipeline is PassThrough, I end up with data in a XmlDocument that is not valid. As soon I try to access the XmlDocument it failes, because it try to validate the xml, which is incorrect.

    So, the only way I foun around this was to read this as a stream.

    Tore

    in reply to: Weird Installation Issue.. #15956

    I can't say for sure, but the big "wierd" WMI error I've consistantly encountered with installing BizTalk is the undocumented maximum computer name length.  You can read the details here:

    http://www.timrayburn.net/2006/08/04/BizTalk+2004+Configuration+Error+Number+80004005.aspx

    Hi Greg,

    Thanks i got that working my last post with error that was caused by the namespace problem. Now everything is fine and working well.

     Thanks

    Mani

    You need to take into account the namespaces in the Xslt

    <?xml version="1.0" encoding="utf-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ns0="http://TestLooping.first" exclude-result-prefixes="msxsl" version="1.0">
    <xsl:output indent="yes" omit-xml-declaration="yes" version="1.0" method="xml" />
    <xsl:key name="glkey" match="/ns0:GLS/GL" use="number"/>
    <xsl:template match="/">
    <xsl:apply-templates select="/ns0:GLS" />
    </xsl:template>
    <xsl:template match="/ns0:GLS">
     <ns0:GLS>
      <xsl:for-each select="GL">
       <xsl:variable name="group" select="key('glkey', number)"/>
       <xsl:if test="generate-id($group[1]) = generate-id()">
        <GL>
         <amount>
          <xsl:value-of select="sum($group/amount)"/>
         </amount>
         <number>
          <xsl:value-of select="number" />
         </number>
        </GL>
       </xsl:if>
      </xsl:for-each>
     </ns0:GLS>
    </xsl:template>
    </xsl:stylesheet>

    Hi Greg,

    I did the same what you said,

    i get the error says Output validation error: "Root element is missing". Any idea y this is happening

      <?xml version="1.0" encoding="utf-16" ?>

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0">
      <xsl:output indent="yes" omit-xml-declaration="yes" version="1.0" method="xml" />
      <xsl:key name="glkey" match="/GLS/GL" use="number" />
    <xsl:template match="/">
      <xsl:apply-templates select="/GLS" />
      </xsl:template>
    <xsl:template match="/GLS">
    <GLS>
    <xsl:for-each select="GL">
      <xsl:variable name="group" select="key('glkey',number)" />
    <xsl:if test="generate-id($group[1])=generate-id()">
    <GL>
    <number>
      <xsl:value-of select="number" />
      </number>
    <amount>
      <xsl:value-of select="sum($group/amount/text())" />
      </amount>
      </GL>
      </xsl:if>
      </xsl:for-each>
      </GLS>
      </xsl:template>
      </xsl:stylesheet>
    And my input instance file looks like this
    <ns0:GLS xmlns:ns0="http://TestLooping.first">
      <GL>
        <amount>10.4</amount>
        <number>10</number>
      </GL>
      <GL>
        <amount>10.4</amount>
        <number>10</number>
      </GL>
    </ns0:GLS>

    Hi Greg,

    I did the same what you said,

    i get the error says Output validation error: "Root element is missing". Any idea y this is happening

      <?xml version="1.0" encoding="utf-16" ?>

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0">
      <xsl:output indent="yes" omit-xml-declaration="yes" version="1.0" method="xml" />
      <xsl:key name="glkey" match="/GLS/GL" use="number" />
    <xsl:template match="/">
      <xsl:apply-templates select="/GLS" />
      </xsl:template>
    <xsl:template match="/GLS">
    <GLS>
    <xsl:for-each select="GL">
      <xsl:variable name="group" select="key('glkey',number)" />
    <xsl:if test="generate-id($group[1])=generate-id()">
    <GL>
    <number>
      <xsl:value-of select="number" />
      </number>
    <amount>
      <xsl:value-of select="sum($group/amount/text())" />
      </amount>
      </GL>
      </xsl:if>
      </xsl:for-each>
      </GLS>
      </xsl:template>
      </xsl:stylesheet>
    And my input instance file looks like this
    <ns0:GLS xmlns:ns0="http://TestLooping.first">
      <GL>
        <amount>10.4</amount>
        <number>10</number>
      </GL>
      <GL>
        <amount>10.4</amount>
        <number>10</number>
      </GL>
    </ns0:GLS>

    Mani,

    You cannot use this xslt from within a scripting functoid. You need to use the custom Xslt feature of the mapper.

    Cut the Xslt above, and paste into a file, save this file (as Unicode) into your project directory, call it <mapname>.xsl

    In your project, Add Existing Item, and select this file (this is not strictly necessary but helps with source control)

    Open your map and select the grid. In the Properties window there should be a Custom Xslt property. Use the ellipsis and select the xsl file created above.

    This overrides the creation of the Xslt by the Biztalk Mapper and uses the Xslt provided in the file, so all the links in the map will no longer be used. You will need to replicate these in the Xslt file.

      

    hi greg,

    i am using the following xslt but i get some errors see below for errors;

    <?xml version="1.0" encoding="utf-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0">
    <xsl:output indent="yes" omit-xml-declaration="yes" version="1.0" method="xml"/>
    <xsl:key name="glkey" match="/GLS/GL" use="number"/>
    <xsl:template match="/">
    <xsl:apply-templates select="/*[local-name()='GLS' and namespace-uri()='http://TestLooping.first'%5D"/&gt;
    </xsl:template>
    <xsl:template match="/*[local-name()='GLS' and namespace-uri()='http://TestLooping.first'%5D"&gt;
    <GLS>
    <xsl:for-each select="/*[local-name()='GLS' and namespace-uri()='http://TestLooping.first'%5D/*%5Blocal-name()='GL&#039; and namespace-uri()='']">
    <xsl:variable name="group" select="key('glkey',number)"/>
    <xsl:if test="generate-id($group[1])=generate-id()">
    <GL>
    <xsl:element name="number"><xsl:value-of select="number"/></xsl:element>
    <xsl:element name="amount"><xsl:value-of select="sum($group/amount/text())"/></xsl:element>
    </GL>
    </xsl:if>
    </xsl:for-each>
    </GLS>
    </xsl:template>
    </xsl:stylesheet>

     

    Error 2 The Script functoid, that connects to target node 'amount', has an error in its 'Xslt Call-Template' definition: 'Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 1, position 81.' D:\TestProjects\TestLooping\TestLooping\First_XML_To_Destination_XML.btm 

    Error 5 XSL transform error: Unable to write output instance to the following <file:///D:\TestProjects\TestLooping\output.xml>. XSLT compile error at (10,28). See InnerException for details. '' is an invalid QName. D:\TestProjects\TestLooping\TestLooping\First_XML_To_Destination_XML.btm 

    Thanks

    -Mani

    You need to change the xpath for the use reference to "glaccount/number", and also the output node structure:

     

    <?xml version="1.0" encoding="utf-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0">
    <xsl:output indent="yes" omit-xml-declaration="yes" version="1.0" method="xml" />
    <xsl:key name="glkey" match="/Root/GL" use="glaccount/number"/>
    <xsl:template match="/">
    <xsl:apply-templates select="/Root" />
    </xsl:template>
    <xsl:template match="/Root">
     <Root>
      <xsl:for-each select="GL">
       <xsl:variable name="group" select="key('glkey', glaccount/number)"/>
       <xsl:if test="generate-id($group[1]) = generate-id()">
        <GL>
      <amount><xsl:value-of select="sum($group/amount)"/></amount>
      <glaccount>
       <number><xsl:value-of select="glaccount/number" /></number>
      </glaccount>
        </GL>
      </xsl:if>
      </xsl:for-each>
     </Root>
    </xsl:template>
    </xsl:stylesheet> 

    [quote user="Bryan Corazza"]

    Very odd behavior. Does it happen the same time every day?  Is it predictable?  Is the Websphere MQ adapter being disabled?  Maybe its a connection issue.  I am assuming from the email that there is nothing in the event log when this happens?[/quote]

     It is unpredictable. It has happened twice already today. I might try switching to the new Host Integration Server MQSeries adapter which bypasses the MQAgent and see if that works better. When it happened again, I checked the MQSeries server, BizTalk server and the App Server the orchestration talks to via Web Service, and no events. It just simply stops polling the messages. The Host Instance still is listed as RUNNING. However, as soon as I stop and start it; it works again.

     Very frustrating. I dealt with very similar occurance with Queued Components awhile back where the component would stop work w/ MSMQ and the damn components had to be restarted. I never did find a solution for that one. I had to rewrite my own queuing which works solid even today. It seems like I am always dealing with Microsoft related quirks. Hopefully someone will point out something I did wrong, then I will eat my words.

    in reply to: How to retrieve body from a pop3 message #15946

    Does this (http://blogs.msdn.com/richardbpi/archive/2006/02/03/524484.aspx) help at all?  Can you not grab the messagepart content that holds the body text?

    in reply to: Calling BRE policy in code from Orchestration #15945

    What is the "NotificationEvent"?  I take it that it's a TypedXmlDocument type, since that's what the BRE expects for XML facts …

    in reply to: rules engine in wwf or biztalk….. #15944
    Hey there,
    As you imply, the Microsoft BRE is a pretty powerful engine, but, I would argue doesn't have the easiest to use interface.  Building rules in the Composer is fine, but once you get to a sizable count of rules, it can be a challenge to manage.  Some of my customers have built standalone user interface (using Excel and the Rules API), or, you could go with a 3rd party integrated solution like RuleBurst or InRule.  I'll be throwing up a review of RuleBurst on the blog within the next week.  Very impressive software that lets you manage rules in Office (Word,Excel,Visio) and export out for direct consumption by BIzTalk.
    For a guide, the API docs in the BTS 2006 Help aren't bad, but I haven't seen a great, public doc on developing against the API.
    For WF rules, there isn't a whole lotta infrastructure out of the box.  That said, you'll find plenty of bits on the http://wf.netfx3.com/ site.

    Hi Greg,

    this sample helped me but there is a small change in structure of the message and i haven't done much in XSLT.

     the message looks like

    <root>

    <GL> 

    <amount>200</amount>

    <glaccount>

    <number>1</number>

    </glaccount>

    </GL>

    </root>

     

    now what is the change in my XSLT? i know the group you have specified in the xslt has to change. let me know what the change is?

    The easiest solution, by far, would be to scheduled your receive locations.  If you examine your receive locations you will see that you can specify a window of time in which it will pick up messages.  Let's say for arguments sake that you are receiving the files at 10pm and that running all of the Type A messages is taking about an hour.

    ReceiveLocation_TypeA is allowed to run from 10pm to 12pm and is limited to files of the pattern *.TypeA

    ReceiveLocation_TypeB is allowed to run from 1am to 3am and is limited to files of the pattern *.TypeB

    This will result in sequential execution by ensuring the BTS doesn't even see the messages until the appointed hour.  The catch being that is TypeA suddenly starts taking longer to run you'll have to adjust the timings, so put in a good amount of buffer.

Viewing 15 posts - 6,931 through 6,945 (of 9,652 total)