Forum Replies Created
-
AuthorPosts
-
Also the context-position is 1- based
So you should have something like this:[code:1:51ddb39d9a]/*[local-name()=’Sample’ and namespace-uri()=’http://BizTalkOrch.InPutSchema’]/*[local-name()=’Body’ and position()=1 and namespace-uri()=”][/code:1:51ddb39d9a]
Microsoft is about the only place I have seen they type of information. Check out the main BizTalk site at http://www.microsoft.com/biztalk/ Although, I have never found there info to be very helpful.
I know HP has a performance white paper.
I think that’s a problem with your Analysis Services. Make sure you have SP 3a for that as well and if you are using a remote SQL you will need the client tools with SP 3a installed on the BizTalk Server.
You might also want to check out Microsoft site. I think they have a lot of KB’s covering the different installation issues.
Is your direct binding working?
I’m guessing the problem is in your direct binding. Make sure you have an active subscription for the message or you’ll get that error.
Thank you very much – now reading goes ok.
Now to next file…
/RIf this is part of the same process you can map either the incoming Xml data or the SQL data that you write to SQL into any format you wish and send it anywhere.
If this is not the same process then you can use the SQL Receive Adapter with either a Select statement or store procedure. The SQL Receive adapter polls the database at an interval you specify.
First you need to create a Biztalk project, with a property schema defining you new property. This needs to be built and deployed.
Then you create a simple pipeline component. I would suggest using Martijn Hoogendoorn’s Pipeline Component Wizard that will create the shell project for your component.
http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=1d4f7d6b-7d27-4f05-a8ee-48cfcd5abf4a
You need a very simple pipeline component.
In the Execute method you can read the FILE.ReceivedFileName property from the context,
[code:1:b98450480e]inputMessage.Context.Read(\"ReceivedFileName\", \"http://schemas.microsoft.com/BizTalk/2003/file-properties\");[/code:1:b98450480e]
possibly parse the string removing the path info and promote the result into your property
[code:1:b98450480e]inputMessage.Context.Promote(<Your PropertyName>, <your property schema namespace>, <new value>);[/code:1:b98450480e]There is no need to to read the data stream, the most complicated part of a pipeline component. The FILE properties are set by the adapter so you can position your component in any stage except the Disassemble stage and you do not have to worry about the completion of the stream read.
Once built you copy the resulting DLL to the [b:b98450480e]C:\\Program Files\\Microsoft Biztalk Server 2004\\Pipeline Components[/b:b98450480e] directory
To debug, you can attach to the BTSNTSrv.exe process setting appropriate breakpoints in VS2003You can do this with two scripting functoids:
For a schema like this as both input and output:
[code:1:2c46f67690]<Schema>
Root
Record
Field1
Field2
Field3[/code:1:2c46f67690]Add a scripting functoid, select [b:2c46f67690]Inline XSLT Call Template[/b:2c46f67690]
Add this code:
[code:1:2c46f67690]<xsl:template match=\"Record\">
<xsl:element name=\"Record\">
<xsl:element name=\"Field1\">
<xsl:value-of select=\"Field1\"/>
</xsl:element>
<xsl:element name=\"Field2\">
<xsl:value-of select=\"Field2\"/>
</xsl:element>
<xsl:element name=\"Field3\">
<xsl:value-of select=\"Field3\"/>
</xsl:element>
</xsl:element>
</xsl:template>[/code:1:2c46f67690]Add another scripting functoid, select [b:2c46f67690]Inline XSLT[/b:2c46f67690]
Add this code:
[code:1:2c46f67690]<xsl:apply-templates select =\"Record[position() != last()]\"/>[/code:1:2c46f67690]Connect this functoid to the Record element of the output schema.
You will get this warning [i:2c46f67690]The \”Scripting\” functoid has no output parameters[/i:2c46f67690] about the first functoid but you can ignore thisThank you kindly sir 🙂
How can l write a pipeline that extracts the File. ReceivedName?
Thanks for your answersI tried with functoids but could get the desired result.
This is a custom Xslt that shows how to filter the last record[code:1:4407151d2d]<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
xmlns:msxsl=\"urn:schemas-microsoft-com:xslt\"
xmlns:var=\"http://schemas.microsoft.com/BizTalk/2003/var\"
exclude-result-prefixes=\"msxsl var\"
version=\"1.0\"
xmlns:s0=\"urn:input:namespace\"
xmlns:ns0=\"urn:output:namespace\">
<xsl:output omit-xml-declaration=\"yes\" version=\"1.0\" method=\"xml\" />
<xsl:template match=\"/s0:Root\">
<xsl:element name=\"ns0:outputdocument\">
<xsl:apply-templates select =\"Record[position() != last()]\"/>
</xsl:element>
</xsl:template>
<xsl:template match=\"Record\">
<xsl:element name=\"Record\">
<xsl:element name=\"Field1\">
<xsl:value-of select=\"Field1\"/>
</xsl:element>
<xsl:element name=\"Field2\">
<xsl:value-of select=\"Field2\"/>
</xsl:element>
<xsl:element name=\"Field3\">
<xsl:value-of select=\"Field3\"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>[/code:1:4407151d2d]I’m new to all this so please excuse my ignorance 🙂
Case: I made a schema for my XML data that looks like this:[code:1:72c3072d7e]<?xml version=\"1.0\" encoding=\"utf-16\"?>
<xs:schema xmlns:b=\"http://schemas.microsoft.com/BizTalk/2003\" xmlns=\"http://BizTalk_Server_Project1.Schema1\" targetNamespace=\"http://BizTalk_Server_Project1.Schema1\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">
<xs:element name=\"Root\">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs=\"1\" maxOccurs=\"unbounded\" name=\"Row\">
<xs:complexType>
<xs:sequence>
<xs:element name=\"Field1\" type=\"xs:string\" />
<xs:element name=\"Field2\" type=\"xs:string\" />
<xs:element name=\"Field3\" type=\"xs:string\" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>[/code:1:72c3072d7e]When I chose Generate Instance on the schema in VS I get that following XML which works fine when I run it through my BizTalk project
[code:1:72c3072d7e]<ns0:Root xmlns:ns0=\"http://BizTalk_Server_Project1.Schema1\">
<Row>
<Field1>Field1_0</Field1>
<Field2>Field2_0</Field2>
<Field3>Field3_0</Field3>
</Row>
</ns0:Root>[/code:1:72c3072d7e]My problem is that the real xml I will have to run through the project doesn’t have the ns0: prefix. Like this:
[code:1:72c3072d7e]<Root xmlns=\"http://BizTalk_Server_Project1.Schema1\">
<Row>
<Field1>Field1_0</Field1>
<Field2>Field2_0</Field2>
<Field3>Field3_0</Field3>
</Row>
</Root>[/code:1:72c3072d7e]When I try to run that xml through biztalk it doesn’t work. I end up with an xml without the fields.
I’m sure I’m just missing something simple and obvious. Afaik if you don’t have a ns prefix it should use the default namespace, which I set with the xmlns=\”http://BizTalk_Server_Project1.Schema1\” line in the schema, right?
Any pointers would be appreciated
Hello
How can I define in map to exclude this last line when reading file?
\\R
[quote:488cffc3c8=\”greg.forsythe\”]The parser starts at the top of the file, so it finds the header and then your List records.
The problem is it cannot differentiate the trailer record from the List records.
One solution is to use the Tag Identifier property on the List record. Is there some identifying data in each List record that you do not need that is different from the header and trailer.
e.g.
Hfield1field2field3
Lfield1field2field3field4field5field6
Lfield1field2field3field4field5field6
Lfield1field2field3field4field5field6
TLfield1In a file like this you can declare the Tag Identifier on the header to be H , the list records to be L and the trailer to be T.
With delimited data the Tag Identifier must always be at the start of the record, but with positional data you can also specify an offset.
If you have no data that can be used as a Tag Identifier then do not specify a trailer and you can use a map to exclude the last line of your List.[/quote:488cffc3c8]
Did you initialize the variable. If yes please send the expression details.
I have the following xml:
[color=blue:67475ee949]<ns0:Sample xmlns:ns0=\”http://BizTalkOrch.InPutSchema\”>
<Body>
<AnyThing>AnyThing_0</AnyThing>
</Body>
</ns0:Sample>[/color:67475ee949]This message is assigned to message variable InMsg.
I have a variable called xmlDoc of type System.xml.xmldocument
I have another message of type System.xml.xmldocument called OutMsgI am using xPath to extract some of InMsg message details:
my xpath expression is:[color=darkred:67475ee949]xDoc = new System.Xml.XmlDocument();
xDoc= xpath(InMsg, \”//*[local-name()=’Body’][0]\”);
OutMsg=xDoc;[/color:67475ee949]When I execute this and check it the Debug mode tracked events:
I get the following error:
[color=red:67475ee949]Microsoft.XLANGs.Core.NullPartException: The part ‘part’ of message ‘OutMsg’ contained a null value at the end of the construct block[/color:67475ee949].
at Microsoft.XLANGs.Core.Part.ConstructionCompleteEvent()
at Microsoft.XLANGs.Core.XMessage.ConstructionCompleteEvent()
at BizTalkOrch1.XPath.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Microsoft.XLANGs.Core.NullPartException
Scoped@
XPath.XPath
9363d962-4b5b-4fda-b012-74d2e73cf154I feel something is wrong in my xPath statment. Please help If you can suggest some thing better.
-
AuthorPosts