WSE3.0 in medium trust error!

S

srallen

I x-posted this in the enhancements group as well, looking for some
help:

Need help with a CAS issue with WSE3.

Enable an asp.net2 webapp to use WSE3.
Create a new webservice in the app via Add New Item > WebService

Alter code for webservice so the service inherits from SoapService,
instead of the defaults, like so: (this forces your service to use
WSE3)

using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Design;
using Microsoft.Web.Services3.Messaging;

/// <summary>
/// Summary description for TestService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TestService : SoapService {

public TestService () {

//Uncomment the following line if using designed components
//InitializeComponent();
}

[WebMethod]
public string HelloWorld() {
return "Hello World";
}

}

Now attempt to call that HelloWorld method from the browser. works
fine, right?

Now edit the trust level for your IIS server to medium here:
c:\windows\..<lastest .net framework>\CONFIG\web.config

change ~line 23 to this:
<trust level="Medium" originUrl="" />

restart your IIS server via iisreset /restart

invoke your HelloWorld method again... you should get this error:
System.Security.SecurityException: That assembly does not allow
partially trusted callers.
at
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at TestService..ctor()

anyone have a clue to solve for this???

I added a StrongNameMembershipCondition into the web_mediumtrust.config
for WSE3 DLL, but this does not fix the situation!

any help would be appreciated!
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top