FW: Loading DLL from Web Service
Siegfried Heintze <[email protected]> Sun, 27 Jun 2004 12:04:07 -0600
| Newsgroups | gmane.comp.windows.devel.soap.general |
|---|---|
| Message-ID | <200406271206500.SM01156@fasolt> |
As per an earlier suggestion in the [email protected], I have the following code in my XML web service: [DllImport (@"c:\inetpub\heintze\AnalyzeResults\CaseAssessment.dll", CallingConvention=CallingConvention.Cdecl)] public static extern double addr_( ref double X, ref double Y ); [WebMethod] public double addr ( ref double X, ref double Y ){ return addr_( ref X, ref Y ); } This function addr_ just adds two numbers. It works when I call it from a console mode test client. (I'm using ref here because the C code for addr_was generated by a FORTRAN to C converted and FORTRAN likes to pass EVERYTHING by ref). As per a suggestion in the NNTP forums, I moved the DLL to the bin directory created by visual studio.net. I checked the file protections for my DLL and they are identical to the DLL deployed by Visual Studio.NET and I can access that one. Since I share this server with many other customers of the hosting service I hired, I am not at liberty to put the DLL anywhere. I get the following error when I access the service, I get the following error listed below. I asked the hosting service to use Internet Service Manager to allow execute permissions on the virtual directory I am in but this did not help. Thanks, Siegfried <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.DllNotFoundException: Unable to load DLL (c:\inetpub\heintze\AnalyzeResults\CaseAssessment.dll). at AnalyzeResults.Service1.addr_(Double& X, Double& Y) at AnalyzeResults.Service1.addr(Double& X, Double& Y) --- End of inner exception stack trace ---</faultstring> <detail /> </soap:Fault> </soap:Body> </soap:Envelope>