Code Access Permissions, ServicedComponents and Web Services

  • Thread starter Anthony Christianson
  • Start date
A

Anthony Christianson

Here is the Scenario:
I have a web service that performs processing on data.
I need to call this web service from an ASP page.
I created a ServicedComponent that has the WebService Proxy and provides a
COM Interface to the ASP code to make requests to the Web Service.

ASP Code:

dim objWsProxy, strReturn
set objWsProxy = Server.CreateObject("MyApp.WSProxy")
strReturn = objWsProxy.GetHtml()

ServicedComponent Code:

[assembly: System.Security.AllowPartiallyTrustedCallers]
[ClassInterface(ClassInterfaceType.None),ProgId("MyApp.WSProxy"),Guid("79B14
4C6-4E1C-3793-9CBA-FC5DCBB6449E")]
[SecurityPermission(SecurityAction.Assert,Flags=SecurityPermissionFlag.Execu
tion)]
public class WSProxy{
private localhost.Service1 _service;
public WSProxy(){
_service = new localhost.Service1();
}

public string GetHtml()
{
return _serivice.GetHtml();
}
}


Now, before the August 2003, Cumulative Patch for Internet Explorer 6
Service Pack 1 (822925). Everything worked fine and dandy. Afterwards, I
continually got, "Execution Permission could not be acquired"

So, I created a Code Access Policy for my ServicedComponent.
caspol -m -ag All_Code -strong -file MyApp.dll -noname -noversion
FullTrust -name "My Proxy Class"
caspol -af MyApp.dll

That didnt work. So I manually went into the .NET Configuration 1.1 Utility
and Created a code access permission for my Strong Named Component.

After restarting IIS, it worked. Then after a reboot, it stopped working.
Then after fiddling with policy again but actually changing nothing. It
started working again.
Then it stopped after an IIS Reset. I am completely lost on what is going
on any more. Any advice would be greatly appreciated.

Anthony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top