Thursday, July 24, 2008

btsharepointadapterws.asmx - Server Error - No Access

Situation:
After installing the BizTalk Adapter on a SharePoint (SPA1) Server, I wanted to have access to the btsharepointadapterws.asmx webservice via internet explorer.

Problem:
I receive a Server error, with no extra information.
Even if I played by changing the CustomErrors tag in the web.config, I didn’t receive any extra information.




Solution:
Open the file
C:\Program Files\Microsoft BizTalk Server 2006\Business Activity Services\BTSharePointV3AdapterWS\web.config

Under System.Web -> WebServices - >Protocols you will see

Put this line as comment and save the file.



No you will have access to the webservice.

Tuesday, July 8, 2008

Stored Procedures parameters and empty nodes.

Situation:
An Xml file contains data and needs to be uploaded to a DB2 database (Or other database).
The xsd tells us that one of the field’s isn’t mandatory.



A stored procedure who accepts some IN parameters.




A mapping that converts the data from the xml file to the stored procedure schema.



Problem:
When you use the mapping above, and the name isn’t available in the Import Xml (minoccures = 0), and phone is available, then the stored procedure will throw an error.
The raison is as in the Import Xml file, the mapping can’t find a Name node, the CustomerName node will not be created. This means in our example that we only send 2 parameters instead of 3, and the stored procedure will not find the CustomerName input parameter/

Solution:

Add to the mapping the ‘Value Mapping’, set the first parameter to true, the second the node you want to copy.
This way, every node in the Xml will be created, even if you send a null value.

List of supported macros

%datetime%: Coordinated Universal Time (UTC) date time in the format YYYY-MM-DDThhmmss (for example, 1997-07-12T103508).

%datetime_bts2000%: UTC date time in the format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (for example, 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds).

%datetime.tz%: Local date time plus time zone from GMT in the format YYYY-MM-DDThhmmssTZD, (for example, 1997-07-12T103508+800).

%DestinationParty%: Name of the destination party. The value comes from the message context property BTS.DestinationParty.

%DestinationPartyQualifier%: Qualifier of the destination party. The value comes from the message context property BTS.DestinationPartyQualifier.

%MessageID%: Globally unique identifier (GUID) of the message in BizTalk Server. The value comes directly from the message context property BTS.MessageID.

%SourceFileName%: Name of the file from where the File adapter read the message. The file name includes the extension and excludes the file path, for example, Sample.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if a message was received on an adapter other than the File adapter, the macro will not be substituted and will remain in the file name as is (for example, C:\Drop\%SourceFileName%).

%SourceParty%: Name of the source party from which the File adapter received the message.

%SourcePartyQualifier%: Qualifier of the source party from which the File adapter received the message.

%time%: UTC time in the format hhmmss.

%time.tz%: Local time plus time zone from GMT in the format hhmmssTZD (for example, 124525+530).