Professional Web Applications Themes

Calling MFC code from WebService - ASP.NET Web Services

Hi, I am trying to make data that is retrieved from old MFC code available through a WebService. I created a Winform application for test purposes and got the managed/unmanaged code to work. When I tried the same in the WebService, I got a FileNotFoundException on one of the MFC dll's. After some investigation, I added the MFC dll location to the path. Previously I tried to copy them to the bin folder but discovered that the assemblies are moved to a temporary folder, without my old MFC dll's. After modifying the path, I get an Internal Server Error. When ...

  1. #1

    Default Calling MFC code from WebService

    Hi,
    I am trying to make data that is retrieved from old MFC code available
    through a WebService.

    I created a Winform application for test purposes and got the
    managed/unmanaged code to work.
    When I tried the same in the WebService, I got a FileNotFoundException on
    one of the MFC dll's.
    After some investigation, I added the MFC dll location to the path.
    Previously I tried to copy them
    to the bin folder but discovered that the assemblies are moved to a
    temporary folder,
    without my old MFC dll's.

    After modifying the path, I get an Internal Server Error. When I enable
    Unmanaged debugging,
    it is successful in attatching to the process but nothing else, the test
    page for WebServices doesn't
    come up, I gave up after several minutes. Managed debugging works.

    When I developed my Winforms test application, I had to call AfxWinInit() to
    initialize MFC,
    is this required when the call comes from a WebService?

    If anybody has any ideas, pointers, references on the topic, any help would
    be apreciated.

    Chris


    Christopher Kimbell Guest

  2. #2

    Default Re: Calling MFC code from WebService

    I suspect the behaviour is due to your web service not having sufficient
    permissions to run unmanaged code - this is the default.

    There are 2 possible approaches:
    1. customize the security policy for your particular WS app
    2. "sandbox" the code that calls the unmanaged code in a separate assembly,
    and give that assembly the extra privilege.

    The 2 are described quite well here - together with advice on deciding on
    the best approach:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMCh09.asp[/url]

    My guess is you will still need to call AfxWinInit() from your WS.

    Richard.

    "Christopher Kimbell" <ab.c> wrote in message
    news:403d1bb4$1news.broadpark.no...
    > Hi,
    > I am trying to make data that is retrieved from old MFC code available
    > through a WebService.
    >
    > I created a Winform application for test purposes and got the
    > managed/unmanaged code to work.
    > When I tried the same in the WebService, I got a FileNotFoundException on
    > one of the MFC dll's.
    > After some investigation, I added the MFC dll location to the path.
    > Previously I tried to copy them
    > to the bin folder but discovered that the assemblies are moved to a
    > temporary folder,
    > without my old MFC dll's.
    >
    > After modifying the path, I get an Internal Server Error. When I enable
    > Unmanaged debugging,
    > it is successful in attatching to the process but nothing else, the test
    > page for WebServices doesn't
    > come up, I gave up after several minutes. Managed debugging works.
    >
    > When I developed my Winforms test application, I had to call AfxWinInit()
    to
    > initialize MFC,
    > is this required when the call comes from a WebService?
    >
    > If anybody has any ideas, pointers, references on the topic, any help
    would
    > be apreciated.
    >
    > Chris
    >
    >

    richlm Guest

Similar Threads

  1. Calling a webservice from a webservice
    By bgauvey@gmail.com in forum ASP.NET Web Services
    Replies: 2
    Last Post: April 20th, 02:02 PM
  2. Calling a webservice from within a SQL Trigger
    By Fabiano in forum ASP.NET Web Services
    Replies: 0
    Last Post: September 8th, 02:50 PM
  3. Calling COM+ in a WebService
    By Daryl Davis in forum ASP.NET Web Services
    Replies: 7
    Last Post: June 16th, 04:45 PM
  4. Webservice calling a webservice.....Error
    By Peter Nordström in forum ASP.NET Web Services
    Replies: 0
    Last Post: October 21st, 12:02 PM
  5. Replies: 0
    Last Post: July 11th, 06:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139