External Assembly Call in BizTalk Map

Hello All,
I am trying to call an external assembly as below from a scripting Functoid:
public static string dblookup()
string eaidbconnection = null;
eaidbconnection = System.Convert.ToString(BizTalk.CE.Eai.Common.EaiSettings.GetSetting("ForecastFileExclusions"));
return eaidbconnection;
But when I do so and test the map am getting the below error: Exception has been thrown by the target of an invocation.Object reference not set to an instance of an object.
When I deploy the application and then use the map as inbound map in the receive port I get the error as : Exception has been thrown by the target of an invocation.
The external assembly is gaced in assembly too.
What is wrong with the code?

Hello All,
Even when I change the code of the method to just return a string it is not working :
public static string dblookup()
string eaidbconnection = null;
eaidbconnection = "Provider=SQLOLEDB;Server=ServerName\SQL02;Database=EAI_Main;Integrated Security=SSPI;";
return eaidbconnection;
I am using a databaselookup functoid and want to keep the database name input as configurable. so want to fetch it from a table.. but that is not working so in the above code am simply returning the connection string from the method and that is also not
working. But, when use this connection string directly in the db functoid it works. There seems to be something wrong when I am calling the external assembly from sricting functoid. I think this is a server issue ?  so is there anythign I can check to
confirm the same ?

Similar Messages

  • How to reduce the number of DB calls in Biztalk Map

    Hi,
    I am using the
    1. first scripting Functoid(calling External Assembly)  to fetch the details from DB as comma separated values(1,2,3)
    2. Scripting Functoid to apply Inline XSLT temple(which will pick the comma separated value and place it as three different records)
    Instance messages
    All the items are working as expected but, the call to DB is happening for each record in the details.
    if my input has n number of details section, the database call is happening n times, which is drastically reducing the performance.
    I wanted to make it as one DB call . Please suggest
    Regards, Vignesh S

    Hi,
    You can also use the Blogical BizTalk Database lookup functoid with caching feature.This functoid can be used like the
    Database lookup functoid that ships with BizTalk. It will execute a query against a given database and cache the result using the
    System.Web.Caching.Cache with a sliding expiration of one minute.
    Download:
    https://blogicalfunctoids.codeplex.com/
    Kind regards,
    Tomasso Groenendijk
    Blog 
    |  Twitter
    MCTS BizTalk Server 2006, 2010
    If this answers your question please mark it accordingly

  • BizTalk 2013 Using External Assembly using C Sharp Calling a Web Service

    Hi:
    I have a assembly dll and its .config file, tested and knowing it works. I like to use the dll in my BizTalk Map. Used gacutil
    to register the dll, AND hand copied the .config file right next to it. Wrote a test program, works fine outside of BizTalk.
    In the BizTalk MAP, during VS testing, I get the following error.
    This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
    My .dll configuration file is not getting recognized.
    Appreciate any hint or guidance.
    Cheers, Toraj
    Toraj [email protected]

    This a great recommendation. For now, I modified the BTSNTSvc.exe.config and BTSNTSvc64.exe.config.
    Sample as follows.
    I am containing getting the same error in VS during testing my map. Error is "...This might be because no configuration file was found for your application, or because no endpoint element matching this
    contract could be found in the client element."
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup useLegacyV2RuntimeActivationPolicy="true">
            <supportedRuntime version="v4.0" />
        </startup>
        <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                <probing privatePath="BizTalk Assemblies;Developer Tools;Tracking;Tracking\interop" />
            </assemblyBinding>
        </runtime>
        <system.runtime.remoting>
            <channelSinkProviders>
                <serverProviders>
                    <provider id="sspi" type="Microsoft.BizTalk.XLANGs.BTXEngine.SecurityServerChannelSinkProvider,Microsoft.XLANGs.BizTalk.Engine" securityPackage="ntlm" authenticationLevel="packetPrivacy"
    />
                </serverProviders>
            </channelSinkProviders>
            <application>
                <channels>
                    <channel ref="tcp" port="0" name="">
                   <serverProviders>
                       <provider ref="sspi" />
                            <formatter ref="binary" typeFilterLevel="Full"/>
                        </serverProviders>
                    </channel>
                </channels>
            </application>
        </system.runtime.remoting>
        <!-- app.config for Adec.BTSUtility.PurchLineMetaDataQueryService class -->
    <system.serviceModel>
            <bindings>
                <netTcpBinding>
                    <binding name="QueryServiceEndpoint" transferMode="Streamed" maxReceivedMessageSize="2147483647" />
                </netTcpBinding>
            </bindings>
            <client>
                <endpoint address="net.tcp://ServerName:8201/DynamicsAx/Services/QueryService"
                    binding="netTcpBinding" bindingConfiguration="QueryServiceEndpoint"
                    contract="AxQueryServiceReference.IQueryService" name="QueryServiceEndpoint">
                    <identity>
                        <userPrincipalName value="[email protected]" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>
    Toraj [email protected]

  • External Assembly

    Hi all,
    In my BizTalk Maps, I am trying to use an external assembly, which is a C# class. When I debug the map, I get the error below. So, basically the script is calling a C# method within the external assembly to retrieve a value from a SQL DB.
    I have tested my code and it's retrieving the data fine. I am using Visual Studio 2010. Any help would be appreciated.
    Thanks in advance.

    If you would like to use visual studio to test you map that call external assembly that access app.config
    then you need to update configuration file of running instance which is in your case your visual studio
    find the location of your visual studio exe file, you will find config file , there you need to update your configuration settings
    in my case:C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.config
    No need to update BTSNTSvc.exe.config when you test by visual studio
    Once you want to test using BizTlak then you need to update BTSNTSvc.exe.config
    which BTSNTSvc.exe is the running instance
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

  • How to map single to multiple record in Biztalk Map

    Hi,
    I have a flat file Input as below
    For understandability I am making it as XML:
    <Input>
    <Name>vignesh</Name>
    <Country>India</Country>
    <orderNumber>123<orderNumber>
    </Input>
    I am having a look up table to retrieve multiple LineItem per Name
    Output expected 
    I need to repeat the record based on the table as
    <Output>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>38</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>45</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>88</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>99</LineItems>
    </Detail>
    <Detail>
    <Name>vignesh</Name>
    <LineItems>85</LineItems>
    </Detail>
    </Output>
    I have created an external assembly to pull the data from database and concatenating the lineitems in a string as (38,45,88,99,85). Now either I need to use map functoids/inline xslt's.
    Please help to move further with some samples.
    Regards, Vignesh S

    Hi Vignesh,
    Add a scripting functiod as shown here in the image, in the scripting functiod call "Inline XSLT Call Template". This scripting functiod would have two parameters.
    1- Name link from the soruce schema. 2- Output something like "38,45,88,99,85" (without quotes). This could be link from the functiod which pulls the data from db. In my case, I just used a string fuctiod which would output
    38,45,88,99,85 to the scripting functiod.
    In the scripting fuctiod, use the below XSLT template. I have commented the XSLT to detail how it works:
    <xsl:template name="ConstructDetailNodeTemplate">
    <xsl:param name="name" />
    <xsl:param name="value" />
    <xsl:variable name="NameFromSoruce" select="$name"></xsl:variable>
    <!-- call splitter template which accepts the "," separated string -->
    <xsl:call-template name="StringSplit">
    <xsl:with-param name="nam" select="$NameFromSoruce" />
    <xsl:with-param name="val" select="$value" />
    </xsl:call-template>
    </xsl:template>
    <xsl:template name="StringSplit">
    <xsl:param name="nam" />
    <xsl:param name="val" />
    <!-- do a check to see if the input string (still) has a "," in it -->
    <xsl:choose>
    <xsl:when test="contains($val, ',')">
    <Detail>
    <Name>
    <xsl:value-of select="$nam"/>
    </Name>
    <!-- pull out the value of the string before the "," delimiter -->
    <LineItems><xsl:value-of select="substring-before($val, ',')" /></LineItems>
    </Detail>
    <!-- recursively call this template and pass in
    value AFTER the "," delimiter -->
    <xsl:call-template name="StringSplit">
    <xsl:with-param name="nam" select="$nam" />
    <xsl:with-param name="val" select="substring-after($val, ',')" />
    </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
    <!-- if there is no more delimiter values, print out
    the whole string -->
    <Detail>
    <Name>
    <xsl:value-of select="$nam" />
    </Name>
    <LineItems>
    <xsl:value-of select="$val" />
    </LineItems>
    </Detail>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    The output would look like this as you wanted for the above your input:
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

  • Biztalk Map Logic

    Hi,
    I have the Biztalk Map logic as shown in figure
    Discount Step and Loyalty both are repeatitive node structures
    Sample Input Xml is as shown below
    <DiscountStepList>
     <DiscountStep>
      <NumberOfTrips>35</NumberOfTrips>
      <Percentage>1113</Percentage>
      </DiscountStep>
     <DiscountStep>
      <NumberOfTrips>5</NumberOfTrips>
      <Percentage>7732</Percentage>
      </DiscountStep>
     <DiscountStep>
      <NumberOfTrips>30</NumberOfTrips>
      <Percentage>8280</Percentage>
      </DiscountStep>
       </DiscountStepList>
    the logic to get the o/p will be
    For Childe Element MIntrip:
    in the first iteration Mintrip=1 and in Secoond iteration Mintrip=Last elememnt Maxtrips+1
    For CHild Element Maxtrips:
    In the first Iteration Maxtrips="NumberOfTrips" and in Second iteration current element MintripNum  + NumberOfTrips.
    The o/p for the above input example will be like
    <ns0:Loyalites xmlns:ns0="http://BizTalk_Server_Project7.Schemdfa1">
      <Loaylty>
        <MinTrip>1</MinTrip>
        <MaxTrips>35</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>42</MinTrip>
        <MaxTrips>72(42+30)</MaxTrips>
      </Loaylty>
    </ns0:Loyalites>
    Is it possible in Biztalk Map using functoids?

    Sujith,
    You got to buy me a drink :)
    You can achive this using XSLT in your map, following XSLT will get the desired result:
    <?xml version="1.0" encoding="UTF-16"?>
    <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_Project7.Schemdfa1" >
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/DiscountStepList" />
    </xsl:template>
    <xsl:template match="/DiscountStepList">
    <ns0:Loyalites>
    <xsl:for-each select="DiscountStep">
    <xsl:if test="position() =1">
    <Loaylty>
    <MinTrip>
    <xsl:value-of select="position()" />
    </MinTrip>
    <MaxTrips>
    <xsl:value-of select="NumberOfTrips/text()" />
    </MaxTrips>
    </Loaylty>
    <xsl:call-template name="ConstructNextLoayltyNode">
    <xsl:with-param name="i" select="2"/>
    <xsl:with-param name="limit" select="count(/DiscountStepList/DiscountStep)"/>
    <xsl:with-param name="vMaxTrips" select="NumberOfTrips/text()"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:for-each>
    </ns0:Loyalites>
    </xsl:template>
    <xsl:template name="ConstructNextLoayltyNode">
    <xsl:param name="i"/>
    <xsl:param name="limit"/>
    <xsl:param name="vMaxTrips"/>
    <xsl:if test="$i &lt;= $limit">
    <Loaylty>
    <MinTrip>
    <xsl:value-of select="$vMaxTrips + 1" />
    </MinTrip>
    <MaxTrips>
    <xsl:value-of select="$vMaxTrips + 1 +/DiscountStepList/DiscountStep[$i]/NumberOfTrips/text() " />
    </MaxTrips>
    </Loaylty>
    <xsl:call-template name="ConstructNextLoayltyNode">
    <xsl:with-param name="i" select="$i+1"/>
    <xsl:with-param name="limit" select="$limit"/>
    <xsl:with-param name="vMaxTrips" select="$vMaxTrips + 1 +/DiscountStepList/DiscountStep[$i]/NumberOfTrips/text()"/>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    Note: You may have to change the namespace as yours. And also the output sample you have show has repeated node as following which is correct.
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    <Loaylty>
        <MinTrip>36</MinTrip>
        <MaxTrips>41(36+5)</MaxTrips>
      </Loaylty>
    For your requirement you will get the out as following which your requirement:
    <ns0:Loyalites xmlns:ns0="http://BizTalk_Server_Project7.Schemdfa1">
    <Loaylty>
    <MinTrip>1</MinTrip>
    <MaxTrips>35</MaxTrips>
    </Loaylty>
    <Loaylty>
    <MinTrip>36</MinTrip>
    <MaxTrips>41</MaxTrips>
    </Loaylty>
    <Loaylty>
    <MinTrip>42</MinTrip>
    <MaxTrips>72</MaxTrips>
    </Loaylty>
    </ns0:Loyalites>
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Error while invoking external WS call from BPEL2.0

    Hi,
    I have a BPEL process from where I am making external WS call.
    I have the WSDL file & the Endpoint URL for the external WS.
    So,I have follow the below steps at BPEL editor.
    1. Synchronous BPEL process[it includes 'receiveInput' & 'replyOutput'].
    2. Added a "Partnet Link"[Created using external WSDL & Endpoint URL] at the Right hand side of BPEL Editor
    3.Added "Invoke" node between 'receiveInput' & 'replyOutput' and then pointed to the newly created "PartnerLink"
    While rebuilding the .jpr file I am getting the below error.
    **C:\JDeveloper\mywork\CustomerDetails\CustomerDetails.bpel**
    **Error(75): Element 'scope' not expected.**
    Can Any one help me to resolve the issue ??
    Note: I have been using JDev 11.1.1.6 and have gone through the below URL for similar kinda sample.
    http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_sync.htm#CIHIEIHD
    Cheers,
    Deba

    Hi Deba,
    Just so I get my facts straight, when you look at the BPEL source code, what do you see? You should be seeing, first, a sequence, then, the receive activity, and then your invoke activity and finally reply. Isn't it?
    As far as the error message suggests, looks like you have placed a "scope" - structured activity, at a place it does not belong.
    HTH
    Cheers
    Swagat

  • External interface.call is not working

    hi, i am trying to call one java script function in
    actionscript by using External interface.call method. but its not
    working .can u pls tell me why this happend

    "angadala" <[email protected]> wrote in
    message
    news:gmpc58$g9p$[email protected]..
    > skill status.mxml
    >
    >
    > <mx:Script>
    > <![CDATA[
    > if (ExternalInterface.available) {
    > ExternalInterface.call(getDataFromXml);
    > }
    >
    > it is javascript
    > <script type="javascript">
    > var data = new Array();
    > data[0]=[1,2,3];
    > function getData()
    > {
    > return data;
    > }
    > </script>
    > </head>
    > <body>
    > <div id="SkillStatus">
    > <p>Alternative content</p>
    > </div>
    >
    > </body>
    > </HTML>
    >
    1) Your JavaScript function name and the function name you
    are calling
    don't match.
    2) On the Flex side, you are calling a JS function that I
    think you are
    expecting to return a value, but not assigning the result of
    the value to a
    function.

  • How to call the second mapping in the first mapping fails in the BPM

    Hi All,
    I have a scenario like this.
    There are two mappings. There is a one condition while genearying the root element of the first mapping. If this condition is not satisfies the first mapping will fail. If this mapping fails i want to trigger another mapping.
    How to achieve this functionality.
    If it is possible with BPM. how to call the second mapping in the BPM.

    Hi
    you can not create the containter for the synchronous interfaces.
    you have to craete the two asysnchronous abstact interfaces .
    thenusing those two abstract interfaces you have to define the containers in the BPM.
    and you also have to define the interface mapping b/w those two abstract interfaces.
    once you define the interface mapping you will be able to select the interface mapping using the transformation step in BPM.
    once you select the interface mapping in BPM then you will be able to selece the interfaces
    if you still face the problenm please reply me back.
    Thanks
    Rinku Gangwnau

  • Can we call a Java Map in Message  Map

    Hello,
    Can we call a Java Map in Message  Map
    Thanks and Regards
    Hemant

    Hello Vijay,
    I think this is your code:
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import java.util.Map;
    import java.io.*;
    public class PayloadToXMLField1 implements StreamTransformation {
        String strXML = new String();
       //Declare the XML tag for your XML message
       String StartXMLTag = "<DocumentBody>";
       String EndXMLTag = "</DocumentBody>";
       //String StartXMLTag1 = "<Code>";
       //String EndXMLTag1 = "</Code>";
        AbstractTrace trace;
        private Map param = null;
        public void setParameter(Map param) {
            this.param = param;
        public void execute(InputStream in, OutputStream out) {
            trace =
                (AbstractTrace) param.get(
                    StreamTransformationConstants.MAPPING_TRACE);
            trace.addInfo("Process Started");
            try {
                StringBuffer strbuffer = new StringBuffer();
                byte[] b = new byte[4096];
                for (int n;(n = in.read(b)) != -1;) {
                    strbuffer.append(new String(b, 0, n));
                strXML = strbuffer.toString();
            } catch (Exception e) {
                System.out.println("Exception Occurred");
            String outputPayload =
                StartXMLTag
             + "<![CDATA["
             + strXML
             + "]]>"
             + EndXMLTag;
            try {
                out.write(outputPayload.getBytes());
             trace.addInfo("Process Completed");;
            } catch (Exception e) {
                trace.addInfo("Process Terminated: Error in writing out payload");;
    I need this code to be converted in UDF if Java map cannot be called in Message Map.
    Can anyone help me how to write UDF for the same java map.
    Thanks and Regards
    Hemant

  • Cannot get external procedural call in Oracle RAC Environment

    Cannot get external procedure call to work in our test RAC env.
    We are able to get it to work in our DEV env which is a single instance
    LISTENER.ORA:
    NODE1:
    # listener.ora Network Configuration File: /opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER_SBLBGT01 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sblbgt01-vip1)(PORT = 1521)(IP = FIRST))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.41.1.21)(PORT = 1521)(IP = FIRST))
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    (ENVS="EXTPROC_DLLS=ANY")
    NODE2:
    # listener.ora.sblbgt02 Network Configuration File: /opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.sblbgt02
    # Generated by Oracle configuration tools.
    LISTENER_SBLBGT02 =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sblbgt02-vip2)(PORT = 1521)(IP = FIRST))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.41.1.22)(PORT = 1521)(IP = FIRST))
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    (ENVS="EXTPROC_DLLS=ANY")
    2) ### If you are receiving errors, please list exact error messages and text: ###
    (cont 1.)
    tnsnames.ora (on both nodes):
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
    (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO)))
    [opt/oracle/app/oracle/product/10.2.0/db_1/network/admin]> tnsping EXTPROC_CONNECTION_DATA
    TNS Ping Utility for Solaris: Version 10.2.0.3.0 - Production on 11-APR-2011 10:52:49
    Copyright (c) 1997, 2006, Oracle. All rights reserved.
    Used parameter files:
    /opt/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = extproc)) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO)))
    OK (0 msec)
    Calling External Procedure:
    SQL> execute ttran.shell('ls');
    BEGIN ttran.shell('ls'); END;
    ERROR at line 1:
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "TTRAN.SHELL", line 1
    ORA-06512: at line 1

    Any Reply Please...
    would appreciate your help...

  • BizTalk Map: Grouping CRM Response XML based on the ID field in Custom XSLT

    Hi,
    I will receive a CRM response as below. 
    <ns0:RetrieveMultipleResponse xmlns:ns0="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:ns3="http://schemas.microsoft.com/xrm/2011/Metadata" xmlns:ns5="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" xmlns:ns4="http://schemas.microsoft.com/xrm/2011/Contracts"><ns0:RetrieveMultipleResult>    <ns4:Entities>      <ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.75000000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">826c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity>   <ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.25000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">766c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity><ns4:Entity>        <b:Attributes xmlns:b="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic">            <b:KeyValuePairOfstringanyType>            <c:key>ccx_datevaccineinfostatementpresented</c:key>            <c:value i:type="d:dateTime" xmlns:d="http://www.w3.org/2001/XMLSchema">2012-08-14T04:00:00Z</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_administeredamount</c:key>            <c:value i:type="d:decimal" xmlns:d="http://www.w3.org/2001/XMLSchema">0.7500000000</c:value>          </b:KeyValuePairOfstringanyType>          <b:KeyValuePairOfstringanyType>            <c:key>ccx_immunizationid</c:key>            <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">826c2b0e-a349-e411-866c-00155d1e1f77</c:value>          </b:KeyValuePairOfstringanyType>     </b:Attributes>  </ns4:Entity></Entities></ns0:RetrieveMultipleResult></ns0:RetrieveMultipleResponse>
    I have  to count the distinct Entities based on ccx_immunizationid value & also I have to group the fields if both entity has same immunization ID. If the xml file (without namespace) and the field is <ccx_immunizationid>2323</ccx_imunizationid>,
    I can use something like below,
    <xsl:template match="//Entity/Attributes[not(./ccx_immunizationid= preceding::ccx_immunizationid)]">
    but here, I have to look for the key 'ccx_immunizationid' and its value. 
    I am using custom xslt in BizTalk map. Please help. Thanks.
    Regards,
    Lakshmi

    You need to get the distinct record filtered by "value" field whose "key" is "ccx_immunizationid" i.e <c:key>ccx_immunizationid</c:key>".
    So you need to use the XPath with syntax: 
    /*[not(@name = preceding::*/@name)]
    So in your case, the XPath value will be like the following:
    /*[local-name()='RetrieveMultipleResponse' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts/Services']/*[local-name()='RetrieveMultipleResult' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts/Services']/*[local-name()='Entities' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='Entity' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='Attributes' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts']/*[local-name()='KeyValuePairOfstringanyType' and namespace-uri()='http://schemas.microsoft.com/xrm/2011/Contracts'][*[local-name()='key' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic']/text() ='ccx_immunizationid'][not(*[local-name()='value' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic'] = preceding::*[local-name()='value' and namespace-uri()='http://schemas.datacontract.org/2004/07/System.Collections.Generic'])]
    You may need to change the namespaces according to yours. This XPath would give you an idea of how to use the distinct XPath (1.0) snystax as shown above in your XML.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • OS Authentication problems during external procedure calls

    Hi,
    Here's our setup: Oracle 9i on Windows OS
    1. Created an OS ID = TESTID on domain = MYDOMAIN
    MYDOMAIN\TESTID
    2. Granted the necessary OS rights on MYDOMAIN\TESTID and assigned it to start/stop the external procedure listener service. The ID has "deny logon locally" policy applied to it on Windows OS.
    3. Restarted the external procedure listener service so that the changes would take effect.
    4. Created an ID on the Oracle DB as OPS$MYDOMAIN\TESTID (identified externally)
    5. Assigned the necessary DB privs to the ID (including create session)
    6. Set the registry entry:
    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0\OSAUTH_PREFIX_DOMAIN = TRUE
    7. On one of our application modules (oracle forms) we triggered an external procedure call and it failed with:
    ORA-01017: invalid username\password
    We used to call the same external procedure before and we never had problems with it. The setup before was that the IDs are on the local server. We had to move the server to MYDOMAIN which is why we did the steps listed above.
    I don't have a clue why the external procedure calls keeps on failing with the new setup. Need your advise on this.
    Below are some of our DB init parms:
    remote_login_password_file = EXCLUSIVE
    remote_os_authent = FALSE
    remote_os_roles = FALSE
    os_authent_prefix = OPS$
    thanks.

    I don't remember noticing an option to set how many passes it will go through. There were two options - you can either write zeros to the drive or do the 8-way random write, where it writes random data across the drive in a random pattern 8 times.
    If there is an amount of passes you can set with the zeros, I did whatever the default one is.
    It's 4:13 now. If it hasn't moved by 5, should I shut down and try again when I return to work tomorrow?
    Jason

  • Reset or Clear SAP user context by external RFC caller program

    Hello,
    I have a SAP system with performance problems due to a SAP user context starts using a lot of memory.
    This user context comes from an External RFC caller program written in Delphi and which uses the SAP RFC SDK provided by SAPGUI 6.40: SAP Automation library, SAPFuntionsOCX, I mean, using methods in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
    Everytime we have performance problems, this RFC SAP user context is using near 1400 Mb of extended memory, although there is a lot of free physical RAM memory available, there are free dialog processes and CPU load is low (no more than 30%).
    This performance problem is solved by closing the external program (written in Delphi) which connects to SAP via RFC.
    This external program works for the warehouse management and connects to SAP several times per minute. Due to connection performance and the high frequency with which this external program must connect to SAP, the connection to SAP is not closed after each call to RFC SAP function modules.
    The extended memory used by this SAP RFC user is growing along time. I detected, using ST03 transaction, that these user sessions have always the same transaction code hash, I mean, although the external programs call the same SAP RFC funcion modules several times (¡¡¡ always clearing the variables at the beginning and at the end of de ABAP code, with ABAP commands like REFRESH and FREE ¡¡¡¡) the technical transaction code is the same and I suppose the user context (in extended memory) is not deleted.
    I think it is better than the external program close the context memory (similar to "/n" okcode in SAPGUI).
    But we don't want to close the connection, because the external program connects to SAP with a high frequency, and the logon process is expensive.
    Is there any way to send something similar to "/n" (end of transaction) from the external program? Is there any command in the SAP RFC SDK library (SAPFuntionsOCX or something similar?
    I cannot find any method to do that in the object "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory.
    Old information for Object Classes "SAPFunctions" in SAPFunctionsOCX in file "wdtfuncU.ocx", in SAPGUI directory, is described in the following URL:
    http://help.sap.com/saphelp_45b/helpdata/en/39/7e00d1ac6011d189c60000e829fbbd/frameset.htm
    But I cannot find anything related to something similar to a "/n" in SAPGUI.
    As I have the SAPGUI installed on my desktop, I can see all SAP RFC classes and methods from Excel, by opening the Visual Basic editor.
    I am only asking a way to send to SAP a command to free the user context used for an open RFC session in order to avoid the memory used to be continuously growing, without having to close the RFC session.
    The external program only calls a certain SAP function module periodically and we want to free the user context between calls without logging off. This is the same, very similar, as if we called that function from SAPGUI and we used "/n" in SAPGUI between calls.
    Anyone can help me?
    Thanks and best regards.

    Hello,
    I don't know if this will solve your problem, but you may be using MF 'RFC_CONNECTION_CLOSE' between each call of you RFC function.
    Regards
    Brice
    Edited by: blsapsdn on Apr 15, 2011 5:27 PM

  • Feature 'nested external environment calls' not implemented

    Hi.
    I've created a .Net 3.5 DLL which is called by a stored procedure using CLR in a trigger.
    Inside one of the functions I've got an update-statement against the same table as the trigger which calls the CLR code.
    That update results in a SAExeption:
    30.04.2014 14:19:55 (ConnID. 89) - W747lnr=4000996, Error: Feature 'nested external environment calls' not implemented
    iAnywhere.Data.SQLAnywhere.SAException: Feature 'nested external environment calls' not implemented
       at iAnywhere.Data.SQLAnywhere.SACommand.ExecuteReader()
       at CLRKalkyle.Exts.Execute(SAConnection conn, String sql, Object[] args)
       at CLRKalkyle.CalculusFunctions.DivInnfrakt(SAConnection conn, Pallet palle, Decimal totkvant)
       at CLRKalkyle.CalculusFunctions.GetInnfrakt(SAConnection conn, Int32 klientnr, String uttakstype, Int32 uttaksnr, Int32 w722lnr)
       at CLRKalkyle.Exts.DivKalkyle(SAConnection conn, Int32 klientnr, String uttakstype, Int32 uttaksnr, Int32 w722lnr, Int32 w747lnr)
       at CLRKalkyle.CLRKalkyle.GenKalkyle(Int32 klientnr, Int32 w747lnr)
    I'm using SAServerSideConnection without transaction (the CLR is called per row in the database).
    Is it possible to run the update in a new thread, or perhaps a new connection?
    Or do I have to run the update after all the other code is finished?
    Hope you understand my problem.
    Regards,
    Bjarne Anker

    This is the trigger:
    ALTER TRIGGER "wau_w747_maaoppdat_on" after update of MaaOppdateres
    order 2 on MTS.W747KalkyleData
    referencing old as old_name new as new_name
    for each row when(old_name.MaaOppdateres = 0 and new_name.MaaOppdateres = 1)
    begin
        call spw_GenKalkyle_w747lnr(new_name.klientnr,new_name.w747lnr)
    end
    Stored procedure:
    ALTER PROCEDURE "MTS"."spw_GenKalkyle_w747lnr"( in p1 integer,in p2 integer )
    external name 'D:\\SVN\\Trading\\CLRKalkyle\\CLRKalkyle\\bin\\Release\\CLRKalkyle.dll::CLRKalkyle.CLRKalkyle.GenKalkyle(int,int)' language clr
    This is where the exception occurs in the program:
    sql = @"update w747kalkyledata w747
    set w747.maaoppdateres = 1
    from w722fakturalinje w722
    where w722.KlientNr = ?
    and w722.TilgangsType = ?
    and w722.TilgangsNr = ?
    and w722.tilgangsnr > 0
    and w722.klientnr = w747.klientnr
    and w722.uttakstype = w747.uttakstype
    and w722.uttaksnr = w747.uttaksnr
    and w722.w722lnr = w747.w722lnr
    and w722.uttakstype = 'DF'
    and w747.maaoppdateres = 0";
    SAServerSideConnection.Connection.Execute(sql, palle.klientnr, palle.tilgangstype, palle.tilgangsnr);
    In short, the trigger is at the table W747 and the code fails when running the update against the same table.
    I guess it would be best to send the sourcecode via email if you need to look at the whole picture.
    Regards,
    Bjarne Anker

Maybe you are looking for