Forum Replies Created
-
AuthorPosts
-
April 13, 2006 at 6:24 PM in reply to: Orchestration exposed as web service — XmlDocument Type #13310
Thank you sir, got it working!
Hi all,
I have a custom XSLT used within some maps I execute inside some orchestartions and the publishing app threw a kink at me with some XML changes I didn’t expect. Unfortunately, the XSLT was provided to me by a member of the boards here, as I’m not as well versed in XSLT as I’d like to be (but working on it).
Here’s my situation:
My incoming messages come into me in a name/value pair setup as below:
[code:1:8a2c0b04e5]<Root>
<Header>
<Info Name=\"field1\" Value=\"value1\" />
<Info Name=\"field2\" Value=\"value2\" />
</Header>
<Detail>
<Info Name=\"field1\" Value=\"value1\" />
<Info Name=\"field2\" Value=\"value2\" />
</Detail>
</Root>[/code:1:8a2c0b04e5][/code]The XSLT converts the XML to output the following:
[code:1:8a2c0b04e5]<Root>
<Header>
<field1>value1</field1>
<field2>value2</field2>
</Header>
<Detail>
<field1>value1</field1>
<field2>value2</field2>
</Detail>
</Root>[/code:1:8a2c0b04e5]The XSLT:
[code:1:8a2c0b04e5]
…
<xsl:template match=\"/\">
<xsl:apply-templates select=\"/Root\" />
</xsl:template>
<xsl:template match=\"/Root\">
<Root>
<Header>
<xsl:for-each select=\"Header/Info\">
<xsl:element name=\"{string(@Name)}\">
<xsl:value-of select=\"string(@Value)\" />
</xsl:element>
</xsl:for-each>
</Header>
<Detail>
<xsl:for-each select=\"Detail/Info\">
<xsl:element name=\"{string(@Name)}\">
<xsl:value-of select=\"string(@Value)\" />
</xsl:element>
</xsl:for-each>
</Detail>
</Root>
</xsl:template>
…
[/code:1:8a2c0b04e5]Whew…now, here is the change that occurred in the incoming XML:
[code:1:8a2c0b04e5]<Root>
<Header>
<Info Name=\"field1\" Value=\"value1\" />
<Info Name=\"field2\" Value=\"value2\" />
</Header>
<Detail>
<Info Name=\"field1\" Value=\"value1\" />
<Spec>
<Info Name=\"field1\" Value=\"value1\" />
<Info Name=\"field2\" Value=\"value2\" />
</Spec>
<Info Name=\"field2\" Value=\"value2\" />
<Spec>
<Info Name=\"field1\" Value=\"value1\" />
<Info Name=\"field2\" Value=\"value2\" />
</Spec>
</Detail>
</Root>[/code:1:8a2c0b04e5]As seen above, the new elment of ‘Spec’ has been added. The current XSLT is not seeing this new element and therefore, is not creating the output with the new element nested in the XML where I’d like it to do so. Also, the ‘Spec’ element may or may not be in the feed so I need to only output the ‘Spec’ data if it’s in the incoming message…so I won’t be creating the element if it’s not in the incoming message.
Can anybody see how I can make the necessary change to the XSLT to reach my goal?
Thanks in advance!
-RichIs it necessary to install MS BizTalk Server 2006 and MS SQL Server 2005 on the same machine?
Are SQL Server client tools (that come with BizTalk 2006) needed to access databases on another machine?
Is it possible to use SQL Server 2005 client tools to access a SQL Server 2000 database?
So you don’t think it is possible to do it quite simply within the script itself?
Well you could build a component that does the trick,
drag it to the gac and use that component in a map…..Thanks Stephan,
As a matter of fact even I installed BTS2006 in 4 systems so far. Even I didn’t encounter any problem.
This is the first time I am facing such problemI don’t think there is a permission problem. I tried again but this time it shows same error but instead of deployment.dll it shows Microsoft.Sql.Adapter.dll
Why it is failing registry service.Is there any way I can mannually register this dll?
Any help would be appreciated.
Is your rule deployed?
This might be because your message type on the input into the rules doesn’t match anything in the Orchestration. Did you import your XSD into the Rules? If so, did you change the message type property? I don’t remember the exact details, but it’s something like when you import the XSD it doesn’t get the full message name in the rules.
Hope this helps.
Did you read through the installation guide? Might be a permissions problem? You a Admin and Network System has the correct folder permissions to the temp drive?
I’ve installed it about 5 times so far – and haven’t seen that error.
The .xsd file describing the text file has a node for the whole document and one for each row.
The document level node needs to have ‘Child Order’ set to ‘postfix’
Even though the ‘commas’ in the actual row are ‘infix’ the document level node is asking where the ‘carriage returns’ (0x0D 0x0A) are in the document and they are postfix – so when this was changed it worked!
Regards
JManThanks a lot
[b:1761eaa790]greg.forsythe[/b:1761eaa790]
Just to let you know:It’s an ideal solution for us. Simple and elegant. Everybody is happy 😀 Thank you once again for your time and kind attitude to beginners!
As a reminder to ourselves (or anyone who will follow up): the orch should contain a configuraqtion for dynamic port
DynamicSendPort(Microsoft.XLANGs.BaseTypes.Address) = \”http://server/ebXml/servlet.jsp?\” + strParameter;I want to send an e-mail message (using an xslt-transform to html-format it) with an attached image-file. The first part is done, but how do I attach a file to the e-mail?
Sorry, I’m not real sure on this.
But, as far as I know if you want extra schemas you need to buy the full EDI adapter.
Best of luck.
It depends on your definition of guaranteed delivery.
It you require guaranteed, once and only once ordered delivery then you need to use a protocol that supports this i.e. MSMQ, MQSeries and in the future WCF.The other adapters provide a level of acknowledgement. And will retry a number of times to deliver the message and provide ACK/NACK messages if you use [b:3f5eb3bdaa]Delivery Notification[/b:3f5eb3bdaa] from an orchestration or suspend the message if you don’t.
The HTTP adapter requires a 200 response from the remote Web server, The FILE adapter needs to successfully write the file to a disk. The SMTP adapter only needs to send the message to the first SMTP gateway server.
You can also layer other protocols on top of the transport to provide acknowledgement e.g. BTF, AS2. ebXML etc.INPUT:
<keys>
<key>
<name>first</name>
<value>123</value>
</key>
<key>
<name>second</name>
<value>45678</value>
</key>
</keys>XSLT:
<xsl:stylesheet version=\”1.0\” xmlns:xsl=\”http://www.w3.org/1999/XSL/Transform\”><xsl:template match=\”/\”>
<keysout>
<xsl:apply-templates/>
</keysout>
</xsl:template><xsl:template match=\”//key\”>
<xsl:variable name=\”elname\”>
<xsl:value-of select=\”name\”/>
</xsl:variable>
<xsl:element name=\”{$elname}\”>
<xsl:value-of select=\”value\”/>
</xsl:element>
</xsl:template></xsl:stylesheet>
The trick above is making the element name a variable.
OUTPUT:
<keysout>
<first>123</first>
<second>45678</second>
</keysout>I would suggest you write it all in native XSLT. We use Stylus Studio which has an XSLT debugger for all our complex maps. Then in Biztalk, click on the map grid, then set the \”Custom XSLT Path\” property to the name of your .xslt stylesheet. You could also try to use the Scripting functoid and use in-line XSLT.
Neal Walters
http://Biztalk-Training.com<?xml version=’1.0′?>
<xsl:stylesheet version=\”1.0\” xmlns:xsl=\”http://www.w3.org/1999/XSL/Transform\”><xsl:template match=\”/\”>
<xsl:apply-templates/>
</xsl:template><xsl:template match=\”//key\”>
<xsl:variable name=\”elname\”>
<xsl:value-of select=\”name\”/>
</xsl:variable>
<xsl:element name=\”{$elname}\”>
<xsl:value-of select=\”value\”/>
</xsl:element>
</xsl:template></xsl:stylesheet>
-
AuthorPosts