Neal Walters - Mostly Biztalk Blogs

Tuesday, June 10, 2008

If you are getting this error:

The "succeeded" operator can only be applied to an immediate child scope or service,
then make sure you specify a valid transactionName in parentheses, for example:

!succeeded(SendLoanData)

Note: SendLoanData is not the name of the scope, it is the TransactionIdentifier that you assign to the scope (which you could then use the same text value as the scope name).

This error was related to the compiler error:
"must receive before sending a fault message on an implemented port".

The issue here has to do with publishing an orchestration as a web service. Typically you have a two-way receive port, where you receive a message, and everything works fine, you send a response. But sometimes, you must also add a Fault response to the receive port.

This has already been discussed in the two blogs below
(more references for more info about the "succeeded" operator in BizTalk).

http://www.traceofthought.net/CommentView,guid,abdd6ca2-e964-437d-8bee-0188ec5b5afa.aspx#commentstart

http://staff.southworks.net/blogs/lito/archive/2007/01/02/Biztalk-Server-2004_3A00_-The-_1C20_succeded_280029001D20_-operator.aspx

Tuesday, May 20, 2008

Another nice blog: SQL Statements that tell you why a Deploy won't work, i.e. what maps or pipelines may be used on ports (Eric Stott's blog):

http://blog.biztalk-info.com/archive/2008/03/19
/Having_problems_undeploying_that_pesky_BizTalk_Assembly.aspx

I found this blog from Richard Seroter called "BizTalk Code Review Checklist":



http://seroter.wordpress.com/2007/09/04/my-biztalk-code-review-checklist

Sunday, April 06, 2008

Earlier this year, I released a new training to learn MySQL.
It uses the open-source Joomla database as an example, and teaches the basics of SELECT, INSERT, UPDATE, DELETE, along with how to do backups/restores.

Why I recently attended Intalio BPMN class - see my new blog at M2MSys:
http://www.m2msysonline.com/we-blog/show,Why-BizTalk-Guru-Attended-Intalio-BPMN-Class-.html

Friday, December 14, 2007

I recently created a new set of Joomla Video Tutorials called "Joomla Unmasked". This is a follow-up course to our prior course called Joomla Magic.

PACKT Publishing just conducted a contest and named Joomla as Best PHP Open Source Content Management System

Joomla can be categorized as a CMS, also known as a Content Management System. SharePoint is Microsoft's offering of a CMS (but it is also of course a document storage system). I have found that PHP-Fusion much easier to use than Joomla, however Joomla seems to be gaining wider recognition and acceptance. While PHP-Fusion has maybe 60-80 mods (plug-ins), Joomla has something like 2500 extensions (both free and paid).

Both PHP-Fusion and Joomla are "Open Source", meaning that you can download the software for FREE, and even view, learn-from, or change the source code to your heart's content.

NOTE: I haven't blogged on BizTalk for the last year due to a recent contract that didn't want me to "leak" our supposed secrets. I have, however, started to do book-reviews and/or book-summaries of recent books that I have read on my Neal Walters personal site.

Wednesday, August 02, 2006

XQuery is a very cool new and upcoming language. It's still not a W3C final recommendation, but Stylus Studio has a great implementation.

With Biztalk and working with XML, I have often found it is nice to scan all the files in a directory and extract some xml tags from each file. XQuery doesn't natively support this, but the following will handle it. Unfortunately, it requires a few lines of Java Code (doesn't seem to support .NET yet).


declare namespace ext = "FileUtils";
declare function ext:listFiles($path as xs:string) as xs:string* external;
declare variable $dirname as xs:string := "file:///c:/xmltest";

<Sample>
{
for $filename in fn:tokenize(ext:listFiles($dirname), ",")
[fn:matches(., ".xml")]
, $rootel in doc(fn:concat($dirname, "/", fn:encode-for-uri($filename)))
return
<filename name='{$filename}'>
<root>{$rootel//*[local-name()='AdminError']/*[local-name()='CorrelationId'][1]}</root>
</filename>
}
</Sample>






Create a file called: .java - you don't even have to compile it.
This is an external function that we call from the XQuery program.

import java.net.*;
import java.io.*;

public class FileUtils
{
public static String listFiles(String root) throws URISyntaxException
{
File f = new File(new URI(root));
String[] list = f.list();
StringBuffer sb = new StringBuffer();
for(int i = 0; i < list.length ; i++)
{
if(sb. length()>0)
sb.append(",");
sb.append(list[i]);
}
return sb.toString();
}
}




NOTE 1: be sure and use the 3 slashes between file:///c:/xmltest.
NOTE 2: the function "fn:encode-for-uri" is used because we were dealing with Biztalk files that had curly braces around the GUID. The special characters in the filenam was causing the XQuery to "choke" without this function.

Here's an example that reads a single file. I needed a quick list of all the credit card expiration dates in a file (this selects only the non-blank ones, then even sorts them). I was trying to figure out if they were YYMM or MMYY.

<html>
{
let $file := doc("ISAFeed.xml")

for $item in $file//viewfmt
where $item/ccardex > ' '
order by $item/ccardex
return <ExpireDate>{$item/ccardex}</ExpireDate>

}
</html>

The above use the FLWR statement (pronounced "flower" and stands for: For/Let/Where/Return. The curly-braces surround substitution of variables.
Comments begin and end with happy faces (: for example :)

Tuesday, June 13, 2006

Can you spot the XML error below?

This could happen either in a Biztalk expression or in a C# program.

strText = ("<ns0:CCQOrderCreateRequest SchemaVersion='1.0' xmlns:ns0='http://schemas.compassion.com/ccq/ordercreaterequest/2006-01-01'>" +
"</ns0:CCQOrderCreateRequest>");
xmlDoc.Load(strText);

The error message is
Invalid URI: The URI scheme is not valid.
System.UriFormatException: Invalid URI: The URI scheme is not valid.

The problem is that the .Load should be .LoadXml - I'm obviously trying to load from a string and not a file. The error message is very obtuse.

Tuesday, May 23, 2006

Stylus Studio -

Have you ever thought about what Biztalk left out? even in the 2006 release?

I keep Stylus Studio (http://www.stylusstudio.com/) open on my Windows desktop all day. I'm constant copying XML fragments into it, formatting them, and using the XPath "tester" utility. With Stylus Studio, you can also go into tree or grid mode, click a node, then right click to create the XPath. This is a big time saver for testing XPath first, outside of compiling and testing a huge Biztalk orchestration.

The other thing I HATE, is those XSLT scripting functoids in Biztalk. The little Biztalk talk edit window is only about 6 lines tall - so how can you manage it? I have recently taken several maps out of Biztalk and rewritten them entirely in XSLT. I use the Stylus Studio XSLST debugger to write and test it, then I set the "Custom XSLT Path" property in Biztalk (and no longer use the Biztalk mapping grid). Stylus Studio also has some drag and drop features similar to Biztalk mapper, and something similar to functoids - they are similar yet different.

There are some maps that are so difficult, you just can't seem to do them in Biztalk mapper without writing some XSLT code.

You can also play with XQuery in Stylus Studio. At my past consulting client, we used this (and a little java routine) to create queries that could search through a directory of hundreds of XML messages and find messages that met specific criteria.

I have also got many good tips from the Stylus Studio forums. They are great at answering questions, and often I get an answer the same day.