1

This question is similar to this one Including a service reference from a class library.

In my case I work with python and C#. In my C# ClassLibrary Project I use a service reference and a dll which provides a specific client as a class, used for calling the webservice. This code works fine if I try it in my console application:

class ws_class
{
    [DllExport("webservice", CallingConvention = CallingConvention.Cdecl)]
    [return: MarshalAs(UnmanagedType.LPWStr)]
    public static string TestExport()
    {
        //Calling request
        return response;
    }
}

Now I want to use the .dll in python using this code:

api = ctypes.cdll.LoadLibrary(path)
api.webservice.retsype = ctypes.c_wchar_p
print(api.webservice())

In other cases this code also works fine for receiving string returned by a C# Class Library.

But as soon as I use the .dll reference for the client in my C# code, it doesn't work anymore. It seems like python cannot handle this issue.

Regarding the question I mentioned above, the config files must be identical but still it won't work.

0 Answers0