cancel
Showing results for 
Search instead for 
Did you mean: 

.Net Connector 2.0 web.config error

Former Member
0 Kudos

Hello,

we are trying to optimize connections to SAP and we intended to use the parameters from the documentation ( see below ).

hey

When the file web.config is edited to add those parameters, the project won't start stating "verify that there are no error in your web.config file".

I took mainly the example from sdn.forum & VS2003 help but it does not seems to work so I was trying to find out how to change these parameters programatically with config.instance.

Can someone help ?

-- code I tried to add to web.config

<configSections>

<sectionGroup name="SAP">

<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23"/>

</sectionGroup>

</configSections>

<SAP>

<Connector>

MaxOpenConnections="200"

MaxCapacity="20"

MaxIdleTime="10"

CleanupInterval="20" />

</Connector>

</SAP>

My web.config is like

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<configSections />

<system.web>

...

<compilation defaultLanguage="vb" debug="true">

<assemblies>

<add assembly="SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

<add assembly="SAP.Connector.Rfc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

</assemblies>

</compilation>

...

<runtime>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">

</assemblyBinding>

</runtime>

</configuration>

<b>CleanupInterval </b>Controls the time interval (in seconds) that the cleanup thread waits beween clean ups.

<b>MaxCapacity </b>Controls the maximum size of the connection pool.

<b>MaxIdleTime </b>Controls the maximum time (in seconds) that a connection is keept open when it stays in the connection pool.

<b>MaxOpenConnections </b>Allows to controls the maximum number of Connection objects returned from NCo.

<b>UseAutoPooling </b>Used to control if the GetConnection methods will automatically return connection from connection pool.

Manuel.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Your web.config should look like this-

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>

<sectionGroup name="SAP">

<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

</sectionGroup>

<SAP>

<Connector>

<ConnectionPool

UseAutoPooling="True"

MaxIdleTime="YourValue"

MaxCapacity="YourValue"

/>

</Connector>

</SAP>

</configuration>

Please adjust the values as per your environment. You can also add more parameters if you wish. You don't have to put the assembly inside the compilation section.

Please remove all the SAP connector related settings from you config file. Try to run the application. If the error does not appears, then copy and paste the text from the above in respective sections of web.config and it should work.

Please write back if you still get the error.

Regards.

Former Member
0 Kudos

If and when I remove the compilation lines, it makes my project not debugable.

I have all sort of setting I must keep, login, debug etc.. in web.config

My Project which is in VB have just been migrated from DCOM to .Net Connector 2.0.1.

I have tried to add the example from Visual Studio but it returns a error message when adding parameters in web.config.

<i>Error while trying to run project: Unable to start debugging on the web server. Server side-error occured on sending debug http request.

Make sure the server is operating correctly.</i> ( it is )<i> Verify there are no syntax errors in web.config ...</i>

Is there a way to have detailed error when something is wrong in web.config ?

Do you know how to change connection pooling parameters programatically ? Example ? (config instance ??)

Thanks,

Manuel.

Former Member
0 Kudos

Hi,

1. I did not mean to remove the compilation line. Just remove the add assembly tag.

**Old -

<compilation defaultLanguage="vb" debug="true">

<assemblies>

<add assembly="SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

<add assembly="SAP.Connector.Rfc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

</assemblies>

</compilation>

**New

<compilation defaultLanguage="vb" debug="true">

</compilation>

2. The error you are posting could be of many reasons. That is why I asked you to remove SAP related sections from Web.Config and run the application. That way you could identify if the reason is indeed SAP related sections ?

3. Regarding the error message, see the microsoft KB article on this http://support.microsoft.com/kb/306172 .The last time I had the similar error, all of sudden one fine morning and after hours or investigation it turned out that our IT guys had installed some security patch. I rebooted the system and everything started working fine.

4. You can access the parameter in the code as well. Just open the VS studio help and search for SAP connector configuration. (Let me know if you trouble finding)

5. However, I would advise you to keep the settings in web.config. It is easy to maintained from there and you dont have to recompile your application if any changes to be made.

Regards.

Former Member
0 Kudos

Hey,

testing again

(I forgot to remove one part added earlier)

Cordially,

Manuel

Message was edited by:

de Palma Manuel

Former Member
0 Kudos

I removed the <Add assembly...> lines and it Works

but it did not make any difference as soon as I added

<b><sectionGroup name="SAP">

<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

</sectionGroup></b>

Here below my web.config complete.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections />
  <b>  <sectionGroup name="SAP">
<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />
</sectionGroup></b>

  <system.web>
    <browserCaps>
...
    <compilation defaultLanguage="vb" debug="true">
    </compilation>
    <!--  DYNAMIC DEBUG COMPILATION
          Set compilation debug="true" to insert debugging symbols (.pdb information)
          into the compiled page. Because this creates a larger file that executes
          more slowly, you should set this value to true only when debugging and to
          false at all other times. For more information, refer to the documentation about
          debugging ASP.NET files.
    -->
    <compilation defaultLanguage="vb" debug="true">
    </compilation>
    <!--  CUSTOM ERROR MESSAGES
          Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. 
          Add <error> tags for each of the errors you want to handle.
    -->
    <customErrors mode="Off" />
    <!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"
    -->
    <authentication mode="Windows" />
    <!--  AUTHORIZATION 
          This section sets the authorization policies of the application. You can allow or deny access
          to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous 
          (unauthenticated) users.
    -->
    <authorization>
      <allow users="*" />
      <!-- Allow all users -->
      <!--  <allow     users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
                  <deny      users="[comma separated list of users]"
                             roles="[comma separated list of roles]"/>
            -->
    </authorization>
    <!--  APPLICATION-LEVEL TRACE LOGGING
          Application-level tracing enables trace log output	 for every page within an application. 
          Set trace enabled="true" to enable application trace logging.  If pageOutput="true", the
          trace information will be displayed at the bottom of each page.  Otherwise, you can view the 
          application trace log by browsing the "trace.axd" page from your web application
          root. 
    -->
    <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
    <!--  SESSION STATE SETTINGS
          By default ASP.NET uses cookies to identify which requests belong to a particular session. 
          If cookies are not available, a session can be tracked by adding a session identifier to the URL. 
          To disable cookies, set sessionState cookieless="true".
    -->
    <sessionState ...
...
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
  </system.web>
  <!-- Specific settings -->
  <appSettings>
...
  </appSettings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
    </assemblyBinding>
  </runtime>
</configuration>

Manuel

Former Member
0 Kudos

Hi Manuel,

Two things-

Firstly check if this "< b >" and "< /b >" (see below) tag is there in your web.config ? If yes remove them.

**from your code

< b > <sectionGroup name="SAP">

<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23" />

</sectionGroup>< /b >

Try to run the application. If the error still persists then go to window -> assembly directory and check the version and public token key of the Sap connector assembly. And check against the values in web.config.

Regards.

Former Member
0 Kudos

HI Manuel,

I also noticed in your web.config following error-

<?xml version="1.0" encoding="utf-8"?>

<configuration>

<configSections />

Here you have closing tag for "configSections /" which is not correct. It should be like-

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>

**see there is no "/" there. You have to close this tag only after the end of the

<SectionGroup name=....></SectionGroup>

For example-

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<configSections>

<sectionGroup name="SAP">

</sectionGroup>

<sectionGroup name="SomeOtherSection">

</sectionGroup>

</configSections>

Regards.

Former Member
0 Kudos

<b>Not Yet</b>

The tag were added in the forum post editor.

The \ behind configSections is not the problem.

The SAP version is correct, checked in c:/winnt/assembly

I have been advised not to programatically change the parameters but is there any other mean in my case ? Does anyone can help me to properly set those parameters one way or the other ?

CleanupInterval, MaxCapacity, MaxIdleTime, MaxOpenConnections , <u>UseAutoPooling </u>

Long evening ahead.

Thanks everyone.

Cordially,

Manuel.

Former Member
0 Kudos

Hi Manuel,

If possible send me the web.config file. My id is jiteshs@hcl.in.

Regards,

Former Member
0 Kudos

Hi manuel,

You have to register <sectionGroup> before <system.web> section.

Regards.

Message was edited by:

Jitesh Kumar Sinha

Answers (0)