Forum Replies Created
-
AuthorPosts
-
July 7, 2009 at 2:10 AM in reply to: How to pass XML document as string parameter to Scripting Functoid #22797
How do you assign the content to xmlTmpDocOut?
There are a couple of issues with your code:
strTmp = xmlTmpDocOut.InnerText.ToString();The InnerText property only returns the text content of your Xml, basically strips all the xml tags.
You should use:
strTmp = xmlTmpDocOut.OuterXml;The xpath statement in your map is also incorrect, there is no <Schema> root node in your message.
You should use:
/*[local-name()=’HashString’]/*[local-name()=’xmlDoc’]This may not be the best way of achieving your result. Are you using custom Xslt? What is the purpose of passing the Xml to the scripting functoid?
Iam also getting same errors while i access HTTP Adapter via Biztalk orchestration…
The Messaging Engine failed to register the adapter for “HTTP” for the receive location “/HTTPRequestResponseSample/BTSHTTPReceive.dll”. Please verify that the receive location exists, and that the isolated adapter runs under an account that has access to the BizTalk databases.
Please let me know what could be possible issue
Hi Susan,
Here is an example, let say I have this Employees schema, which contains multiple Employee record.
—————————————————————————————————-
<?xml version=”1.0″ encoding=”utf-16″?>
<xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ xmlns=”http://BizTalk_Server_Project1.Employees” targetNamespace=”http://BizTalk_Server_Project1.Employees” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<xs:element name=”Employees”>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs=”1″ maxOccurs=”unbounded” name=”Employee”>
<xs:complexType>
<xs:sequence>
<xs:element name=”FirstName” type=”xs:string” />
<xs:element name=”LastName” type=”xs:string” />
<xs:element name=”RecordID” type=”xs:string” />
<xs:element name=”UserID” type=”xs:string” />
<xs:element name=”Address” type=”xs:string” />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>—————————————————————————————————-
Some of the Employee record might have been duplicated, therefore I want to remove the duplicate record base on the UserID. Hence i created a map that maps an Employees msg to an Employees message and use a custom XSL file for the map (see here for an example of how to use custom XSL for map: http://www.biztalkgurus.com/forums/p/12513/24762.aspx#24762)
Let say I have this input message:
————————————————————————————————————-
<?xml version=”1.0″ encoding=”utf-8″?>
<ns0:Employees xmlns:ns0=”http://BizTalk_Server_Project1.Employees”>
<Employee>
<FirstName>FirstName_0</FirstName>
<LastName>LastName_0</LastName>
<RecordID>RecordID_0</RecordID>
<UserID>UserID_0</UserID>
<Address>Address_0</Address>
</Employee>
<Employee>
<FirstName>FirstName_1</FirstName>
<LastName>LastName_1</LastName>
<RecordID>RecordID_1</RecordID>
<UserID>UserID_1</UserID>
<Address>Address_1</Address>
</Employee>
<Employee>
<FirstName>FirstName_0</FirstName>
<LastName>LastName_0</LastName>
<RecordID>RecordID_0</RecordID>
<UserID>UserID_0</UserID>
<Address>Address_0</Address>
</Employee>
<Employee>
<FirstName>FirstName_2</FirstName>
<LastName>LastName_2</LastName>
<RecordID>RecordID_2</RecordID>
<UserID>UserID_2</UserID>
<Address>Address_2</Address>
</Employee>
<Employee>
<FirstName>FirstName_1</FirstName>
<LastName>LastName_1</LastName>
<RecordID>RecordID_1</RecordID>
<UserID>UserID_1</UserID>
<Address>Address_1</Address>
</Employee>
</ns0:Employees>————————————————————————————————————-
I use this custom XSL to transform the message:
————————————————————————————————————-
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<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:ns0=”http://BizTalk_Server_Project1.Employees”>
<xsl:output omit-xml-declaration=”yes” method=”xml” version=”1.0″ />
<xsl:template match=”/”>
<xsl:copy>
<xsl:apply-templates select=”/ns0:Employees”/>
</xsl:copy>
</xsl:template>
<xsl:template match=”/ns0:Employees”>
<xsl:copy>
<xsl:apply-templates select=”Employee”>
<xsl:sort select=”UserID” order=”ascending”/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match=”Employee”>
<xsl:if test=”not(UserID = preceding-sibling::Employee/UserID)”>
<xsl:copy-of select=”.”/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>————————————————————————————————————————
and here is the output message:
————————————————————————————————————————
<?xml version=”1.0″ encoding=”utf-8″?>
<ns0:Employees xmlns:ns0=”http://BizTalk_Server_Project1.Employees”>
<Employee>
<FirstName>FirstName_0</FirstName>
<LastName>LastName_0</LastName>
<RecordID>RecordID_0</RecordID>
<UserID>UserID_0</UserID>
<Address>Address_0</Address>
</Employee>
<Employee>
<FirstName>FirstName_1</FirstName>
<LastName>LastName_1</LastName>
<RecordID>RecordID_1</RecordID>
<UserID>UserID_1</UserID>
<Address>Address_1</Address>
</Employee>
<Employee>
<FirstName>FirstName_2</FirstName>
<LastName>LastName_2</LastName>
<RecordID>RecordID_2</RecordID>
<UserID>UserID_2</UserID>
<Address>Address_2</Address>
</Employee>
</ns0:Employees>————————————————————————————————————-
Let me know if that helpsJuly 6, 2009 at 9:54 PM in reply to: How to pass XML document as string parameter to Scripting Functoid #22793July 4, 2009 at 5:55 AM in reply to: Is it possible to consume WebService with added reference to WSDL and not ASMX? #22786Anyone?
I have to map nearly 50,000 messages. If I map one after other then it takes nearly 25 hours for mapping. S0 I want to instantiate parallel mapping by triggering multiple instances of an orchestration. I am planning to instantiate nearly 16 instances in a loop so that each instance can handle nearly 4000 messages. So I thought of initializing correlation set in a loop and send 16 message to a folder. these messages instantiates 16 child orchestrations. I need to know when all 16 are complete. So I have put a receive shape in a loop for the same correlation set. The it failed with a compilation error “a correlation may be initialized only once”. If I have to initialize a correlation set in a scope in side the loop then I cannot use the correlation set in another loop to receive the message. Also, I want the programming logic to determine the number of instances (16 or more or less) so I was unable to use parallel shape. I will not be able to change the map to loop through messages as I have nearly 30 maps with very complex logic. I am thinking to change the orchestration rather than changing 30 maps.
Basically, I am looking for parallel mapping in B1zTalk 2004 and the main orchestration need to know when all the mappings are complete. Any help would be great..!!!
July 3, 2009 at 1:36 AM in reply to: How to set a default value to an destination schema element in BizTalk Map #22784Hi
I had the same problem.. okay here is my solution
- Logical Existence : Returns true if the input record or field exists in the source document.
- Equal : First Value Logical Existence; Second Value : true … This will trueReturns true if the first parameter is equal to the second parameter. i.e if the logical existence retruns true.
- Scripting Functoid : With the following code.. ::-) First parameter Equal functoid; Second Parameter source element
public int uCheckAvailableOrNot(bool param1,string sourceElementVariable)
{
bool valueMissing = true;
//In my case I need to retrun something for the my destination element
int defaultNummer = 200;
//If my source schema have a value
if (param1 == valueMissing )
{
return Int32.Parse(sourceElementVariable);
}
//if there is no value return the default
else
{
return defaultNummer;
}}
Hope it helps
Akabuilo
July 2, 2009 at 2:22 PM in reply to: I want to route the incoming file (based on the filename) to different directories #22783Thanks Greg, I was able to get it working.
The http adapter should allow you to do this. I believe that you would need your send port in the orchestration to be dynamic so that you could tell it to use the HTTP adapter and then set it’s URI property to your string from above.
Do a search on Dynamic Sendports and you should get some information on it.
Good article.
Doesn’t answer the real question though:
Why there is another language, when we way passed the bitalk 2000 times with the xml based XLANGs and now “well” integrated to VS.NET. And orchestration is compiled into .Net assembly.
The partual class is a great fit for the purpose and Yet there is the “Xlang Language” in place
BizTalk is acually using a languange named XLang which uses a C# style syntax, but it is not C#. Please see this link for a more detailed explination
Great, found a inline workaround for the .ToString()
(System.String)System.Convert.ChangeType(MyMessage(MyNamesapce.MyInt),typeof(System.String))
at least cast of object to string is working
bit long, but without extra assembly
In my experience this is not a great way of performing this sort of task.
If you are only shifting data from oracle to SQL and there is minimal mapping and no further interaction with the data I would strongly recommend a more suited technology such as SSIS.
I have had a very similar problem with significantly smaller file sizes (100MB) that I had to pick up a batch file and stick it in sql.
Almost every angle I turned to I got an out of memory exception or very erratic behaviour from BizTalk (a symptom of the low memory i think)
I tried all sorts of tricks, including the aforementioned xquery and xml parameters. While useful in principle, the practicality of doing this means your original message will need to be converted to an escaped string and placed in the attribute that represents that stored procedure parameter. If you are dealing with a big message this is not going to please BizTalk at all.
Maybe the new WCF sql adapter may offer more resilience, but I would count on it 🙂
So the only place this leaves you (and is the route I followed in the end) is to experiment with the solutions suggested where you
1. read the data from oracle in smaller chubnks and push those through to sql
Not sure how the oracle adapter works, but you could get a race condition where the sql write is not complete by the next oracle read making the pressure build in biztalk and on the target DB.
2. read all the data from oracle and debatch in a pipeline
This assumes you can read in all this data from oracle without issue. If you can you can either split the batch in a pipeline and have multiple orchestrations pushing data to sql, or process the batch sequentially or semi sequentially where you control the flow of data to the sql server.Your SQL box will also be being kicked to kingdom come and other services running on the biztalk \ sql platform may experience performance issues.
Hope this helps, and I feel your pain!
Dino
In my experience this is not a great way of performing this sort of task.
If you are only shifting data from oracle to SQL and there is minimal mapping and no further interaction with the data I would strongly recommend a more suited technology such as SSIS.
I have had a very similar problem with significantly smaller file sizes (100MB) that I had to pick up a batch file and stick it in sql.
Almost every angle I turned to I got an out of memory exception or very erratic behaviour from BizTalk (a symptom of the low memory i think)
I tried all sorts of tricks, including the aforementioned xquery and xml parameters. While useful in principle, the practicality of doing this means your original message will need to be converted to an escaped string and placed in the attribute that represents that stored procedure parameter. If you are dealing with a big message this is not going to please BizTalk at all.
Maybe the new WCF sql adapter may offer more resilience, but I would count on it 🙂
So the only place this leaves you (and is the route I followed in the end) is to experiment with the solutions suggested where you
1. read the data from oracle in smaller chubnks and push those through to sql
Not sure how the oracle adapter works, but you could get a race condition where the sql write is not complete by the next oracle read making the pressure build in biztalk and on the target DB.
2. read all the data from oracle and debatch in a pipeline
This assumes you can read in all this data from oracle without issue. If you can you can either split the batch in a pipeline and have multiple orchestrations pushing data to sql, or process the batch sequentially or semi sequentially where you control the flow of data to the sql server.Your SQL box will also be being kicked to kingdom come and other services running on the biztalk \ sql platform may experience performance issues.
Hope this helps, and I feel your pain!
Dino
Do you mean FTP over HTTP-over-SSL or you mean FTP over SSL/TLS? FTP clients don’t work over HTTP, but it’s possible to request an FTP resource from HTTP proxy. Also it’s possible (but non-trivial) to tunnel FTP over HTTPS proxy (this is sometimes called HTTP CONNECT proxy). If you need the latter, I believe, EldoS adapters do this (if not, it’s easy to modify them as the backend library supports HTTP CONNECT proxies).
-
AuthorPosts
