Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond

Re: Mapping problem: using Scripting functoid - calling external assembly error

BizTalk 2009

This group is for all content related to BizTalk Server 2009. This includes a forum, samples, and videos. Most of the content here also applies to other versions of BizTalk beyond 2009.

Mapping problem: using Scripting functoid - calling external assembly error

Answered (Verified) This question is answered

Hi to all,

I need to calculate some value in incoming message - and transfer it to outgoing message.

I receive string from incoming schema - which is number, transfer it to method through Scripting functoid, inside that method I do some logic on parameter and return number as string as output.

Facing error of "Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'."

While I test my map - it works, and while I start to debug the map - or  running on runtime - I get next error.

Any clues?

For additional info: I have another map, which also uses similar way - and it works, but! - the main difference, that map which doesn't work - I invoke with reflection, and the working map - is regular - deployed as usually.

Can be the cause for error reflection while invoking scripting functoid which uses external assembly?

Thanx for help,

Yonathan.

p.s. - Down here is s stack trace.

Timestamp: 14/09/2010 09:07:58
Message: HandlingInstanceID: ef365ba2-71d8-4f11-b1d1-9173b78c7294
An exception of type 'System.Xml.Xsl.XslTransformException' occurred and was caught.
------------------------------------------------------------------------------------
09/14/2010 11:07:58
Type : System.Xml.Xsl.XslTransformException, System.Data.SqlXml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/BizTalk/2003/ScriptNS0'.
Source : System.Data.SqlXml
Help link :
SourceUri :
LineNumber : 0
LinePosition : 0
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Collections.Generic.IList`1[System.Xml.XPath.XPathItem] InvokeXsltLateBoundFunction(System.String, System.String, System.Collections.Generic.IList`1[System.Xml.XPath.XPathItem][])
Stack Trace :    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
   at <xsl:template match="/s0:root">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
   at <xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
   at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
   at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
   at System.Xml.Xsl.XmlILCommand.Execute(XmlReader contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
   at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results)
   at Gov.RishuyZamin.ConstructionPermit.Utility.ExecuteMapping(String sXslt, String sXmlData)

Additional Info:

MachineName : Machine name 56ad364e35
AppDomainName : __XDomain_3.0.1.0_0
ThreadIdentity :
WindowsIdentity : $$$$$$$
Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: Machine name
Application Domain: __XDomain_3.0.1.0_0
Process Id: 4112
Process Name: C:\Program Files\Microsoft BizTalk Server 2009\BTSNTSvc.exe
Win32 Thread Id: 2796
Thread Name:
Extended Properties:

Yonathan Masovich

Verified Answer
  • There is more to a BizTalk map than just the Xslt. When calling an external assembly from within the Xslt then an instance of the class must be created and passed to the XsltTransform in the XsltArgumentList. The specification of these classes in kept in the Extension Xml file.
    i.e. System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results)

    If you wish to dynamically call a BizTalk map there is a another method that does not require Reflection:
    http://www.biztalkgurus.com/media/p/15561.aspx

     

    • Top 10 Contributor
All Replies
  • Hi Yonathan,

     

       Is there any reason why you are using Reflection in the map that doesn't work vs. the regular way in the map that works? What if you did not use Reflection and see if that resolves the issue?

     

       Daniel.

     

    "Google skills are more important than your coding skills."

    • Top 10 Contributor
  • Hi Daniel,

    The reason to use reflection  - is because I create many different messages with data based on One incoming message in an orchestration in a loop.

    Every iteration - I get XSL according to type of message to be created from DB, and invoke external assembly - for stay Generic for creating messages in different services.

    Do you think, that reflection can cause to failure of mapping?

     

    Yonathan Masovich

    • Top 25 Contributor
  • More to say: why I don't use in "working" map with reflection - because it's one certain place in my Business flow, which doesn't need to be Generic. So I call to Map project  from Orchestration project.

    Yonathan Masovich

    • Top 25 Contributor
  • There is more to a BizTalk map than just the Xslt. When calling an external assembly from within the Xslt then an instance of the class must be created and passed to the XsltTransform in the XsltArgumentList. The specification of these classes in kept in the Extension Xml file.
    i.e. System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results)

    If you wish to dynamically call a BizTalk map there is a another method that does not require Reflection:
    http://www.biztalkgurus.com/media/p/15561.aspx

     

    • Top 10 Contributor
  • HI Greg!

    1. Of course I know that *.btm is not pure XSLT

    2. Thanx for answering about the Argument list. We'll check this.

    3. Have a good day :)

     

     

    Yonathan Masovich

    • Top 25 Contributor
  • Validate the map. It will create an extension xml. Provide the path of the xml as a input to CustomeExtensionXML property in Map

    Edit
Page 1 of 1 (7 items)