Forum Replies Created
-
AuthorPosts
-
Thanks Greg. I actually have more complex xml and it is not well -formed. So, I’m thinking to reassign namespaces in orchestration before sending the message out of BizTalk. Not sure if that will work though.
You can debatch the flat file in the Flat File Disassembler when you first receive the text message.
This is done by the way you specify your flat file schema.
http://geekswithblogs.net/benny/archive/2006/02/05/68249.aspxThis is the most efficient way of debatching.
Debatching and inserting single records into a database is the most inefficient of processes, so you will need every performance gain you can get. In a recent project I refactored a debatching application to insert multiple records at a time, elapsed time was reduced from 56 hours to 40 minutesYes, you will need 3 schema:
<
xs:schema xmlns:a=“urn:areatype“ elementFormDefault=“qualified“ xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:import schemaLocation=“.\areatype.xsd“ namespace=“urn:areatype“ />
<xs:element name=“Area“ type=“a:areaType“ />
</xs:schema><
xs:schema xmlns:tns=“urn:areatype“ elementFormDefault=“qualified“ targetNamespace=“urn:areatype“ xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:import schemaLocation=“.\place.xsd“ />
<xs:complexType name=“areaType“>
<xs:sequence>
<xs:element name=“street“>
<xs:complexType>
<xs:sequence>
<xs:element name=“house“ type=“xs:string“ />
<xs:element ref=“place“ />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema><
xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema“>
<xs:element name=“place“ type=“place“ />
<xs:complexType name=“place“>
<xs:sequence>
<xs:element name=“Number“ type=“xs:string“ />
</xs:sequence>
</xs:complexType>
</xs:schema>These schemas will validate this Xml:
<
Area xmlns:a=“urn:areatype“>
<a:street>
<a:house />
<place>
<Number>1</Number>
</place>
</a:street>
</Area>Hi,
See this tutorial from w3schools about XML namespaces:
http://www.w3schools.com/xml/xml_namespaces.asp
Daniel.
I struggled similariy with Exists functoid. It only give true if the node actually exists, when the node doesn’t exist, it doesn’t return anything. Strange phenomenon.
I’d suggest you use a counter (index) functoid or a cumulative functoid to implement your functionality.
With cumulative string functoid, you can get the values of city, do a search for 1 in the output of the cumulative functoid and map accordingly.
– JC
If you could provide some more info about the errors I could help you through your issues.
I tried to use this, but got some errors.
Hi,
Check out the following blog by Stephen Thomas on how to do message debatching using a receive pipeline in an orchestration:
Daniel.
What a difference it makes to take a weekend and come back to a problem! Well – I found the problem and is looks like a good “Lessoned Learned”. As it turns out – using the index shape in the map was correct. That was what the Microsoft consultatnt here was doing and it worked for him. I had been trying it and all sorts of versions for two days and no luck. The reason it was not working for me was that the incoming XSD was wrong! The first problem was that I had not nested FN and LN correctly under Name, So – the three instances of F/L Name were all under one instance of Name. It should have been three instances of Name with each having one set of First and Last Name. I discovered this by generating some more instances of the XML from the schema in BizTalk and looking at it. The XML I was feeding the map was hand made and correct – but the XSD for it could not understand it.
The second problem was in the destination flat file being created. The second and third instance of name was not getting the values for the tags extracted. The destination XML, which was a flat file schema with the occurs flattened, was being built with empty tags. I had built the destination in BizTalk, but at some point modified it in XML Spy and refreshed it in BizTalk. Apparently Spy created Record Elements of the “Any Type”. BizTalk did not like that. After replacing the second and third tags in the destination schema it worked just great.
So, the moral of the story and lesson learned. If what you are doing should work and does not – start checking the infrastructure! Check the incoming XSD and XML (former was problem for me). Also, XML Spy can be a great tool – but look for times that it won’t feed BizTalk what it wants.
Hi Daniel,
Thank you so much for quick update. I wish I could do the same your guide. Our currect design is to de-batch multiple records from flat file into many single records and then each record will be passed to WCF for inserting to database. I must insert each data by passing it to WCF. I can not use WCF-SQL adapter.
Thank you for your help.
Ziggy,
Is the XML schema in below format?
<Person><FN><LN></Person> where Person loops. And do the FN and LN in the flat file occur a finite number of times?
If yes, you can add a condition to look for the incoming node name and index and only then map to LN/FN
You can also look add XSLT snippets using the scripting functiod. Orchestration won’t be required.
Hope this helps.
– JC
Thanks Daniel,
I have connection and simple select is working fine. I’m trying to send a request with parameters to select values depending on that parameters. Where I specify the select statement? Adapter generated following schema:
-Request
-Operation
-table
@sql
-parameters
– p1
– p2
Thanks,
Hi,
Check the following MSDN thread on connecting to AS400 from BizTalk:
Daniel.
Hi,
I would suggest the following solution:
1) Create a table in SQL database with two columns: a field to store your project name, and another to store a datetime value.
2) Create a stored procedure in the same database, passing two parameters: one parameter of type string that represents a project name, the other of type datetime. In your SP, code logic to first do a look up on the table (defined in step 1) to see if you already have such a row stored in the table for given project name and datetime passed to the SP: if yes, then return appropriate value; if no, then insert the record and return appropriate value.
3) In a Visual Studio Biztalk project, use WCF-SQL adapter to create a schema for your Stored procedure in Generated Items wizard. You can promote both fields (as parameters to your SP) in the schema as Distinguished fields.
4) In another Biztalk project, create your orchestration artifact, reference the SP schema assembly created in step 3 and set up a message type for it, then in an Expression shape, parse the received filename from your Receive Port using context properties to store the project name and datetime stamp (from your filename) into variables defined at your orchestration level; in a Message Assignment shape, assign both variables to the Distinguished fields of your SP schema, and create a logical Request/Response Send port to pass this message to your SP; use a Decide shape to check the response message, and depending on the content of that message, either do further processing (in that branch) if it’s the message received that day, or do nothing (in that branch) if it’s a duplicate message.
Hope this helps,
Daniel.
Hi Roger,
Please be more specific with the problems and/or errors that you are getting when trying to deploy your project artifacts. Are you missing some assembly references?
If you offer more information, some other Biztalk guru can probably help you, if I don’t have the answer, because your original post is too general and plain in its wording.
Daniel.
-
AuthorPosts