on 03-29-2011 3:59 PM
Hello
I am trying to use .Net connector (NCO 3.0) with WCF service and recieving the following Inner Exception
*"exePath must be specified when not running inside a stand alone exe."*
The same code works perfectly when used in a Console application.
Am I missing something in the configuration.
Below is the stack trace for the same
at SAP.Middleware.Connector.RfcDestinationManager.GetDestination(String destinationName)
at MaintainPersonalData.MaintainPersonnelData.GetPersonnelDetails(Int32 EmpNo, DateTime BeginDate, DateTime EndDate) in *********************************************************************\MaintainPersonnelData.svc.cs:line 26
at SyncInvokeGetPersonnelDetails(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
We have this exact same problem. It seems to me there's an issue with how the connector is looking for its config information. As far as we know it should be looking in the web.config file of the hosting site when WCF is in IIS but this doesn't seem to be happening - it's looking for a config file related to the config assembly which it won't find.
As with the previous poster, we have connected to SAP with no problem from a console application. We're investigating hosting our WCF service in a windows service in the hope that solves the problem. Sure seems like something isn't right with the connector as working with .NET config locations across Windows/web is pretty basic stuff.
Pareshkumar, did you make any progress?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I try to create a WCF service with sapnco 3.0 but when i launch my site, i have this error :
Could not load file or assembly 'sapnco' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I use sapnco 64 bits on windows server 2008 64 bits. I set the platform target on 64 bits.
But i still have this error message.
Somebody have any idea to solve this error ?
Thanks in advance
Finally, I've changed the platform target and the dll to 32 bits.
Edited by: Iveusse on Dec 15, 2011 3:17 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
the next patch level (NCo 3.0.4) will provide a fix for this problem, so the workaround will no longer be necessary then. At the moment we don't have a planned release date yet for 3.0.4, but it'll probably be before the end of the year.
Ulrich
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, I just found out some more. Looking at the actual code of the connector, I see where I think the problem is:
// SAP.Middleware.Connector.RfcConfigParameters
using System;
using System.Configuration;
using System.Reflection;
using System.Web;
using System.Web.Configuration;
static RfcConfigParameters()
{
Configuration configuration = null;
if (HttpContext.Current != null)
{
configuration = WebConfigurationManager.OpenWebConfiguration("~");
}
else
{
configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
}
ConfigurationSectionGroup sectionGroup = configuration.GetSectionGroup("SAP.Middleware.Connector");
Our code is falling over when it instantiates RfcConfigParameters and this constructor code seems to explain why - as far as I can tell, with WCF there will be no HttpContext so it acts as though this is a Windows (exe) app. That of course doesn't work as this is a web app and all our config is in web.config. Microsoft info suggests the code should be using RequestContext instead - Link: http://msdn.microsoft.com/en-us/library/aa702682.aspx
Looks like .NET Connector v3.0 is not compatible with WCF.
As an aside, we don't even want to pickup config directly from the config file (something the connector documentation says it supports) yet despite our not explicitly asking to do so the config class tries to get to config. If it weren't for that and the resulting exception we would be good to go since we're providing all the config we need directly. Not good.
Anyone on these boards have any NCO 3.0 experience?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good find Richard123456, I have seen this issue as well, but it's interesting to see the underlying issue that caused it. I found a workaround by using the ASP.NET Compatibility Mode to force the WCF solution to read the HttpContext.
There are instructions for how to enable compatibility mode at the MSDN link you had included in your post (http://msdn.microsoft.com/en-us/library/aa702682.aspx).
Basically, it involves adding the serviceHostingEnvironment tag and setting the compatibility mode to true as seen below.
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
It has a couple drawbacks, you lose some of the flexibility in that you can only use this with IIS and HTTP, but it's better than nothing at all.
HTH!
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.