Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > WSE3.0 in medium trust error!

Reply
Thread Tools

WSE3.0 in medium trust error!

 
 
srallen@gmail.com
Guest
Posts: n/a
 
      09-05-2006
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.ThrowSecu rityException(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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 1.1 app breaks when moved to shared webhosting with medium trust level Andy ASP .Net 1 12-21-2006 05:40 PM
Full trust and medium trust in .net and websites Linda ASP .Net Security 1 08-31-2006 05:16 AM
Does GridView.DataBind work under medium trust with custom objects =?Utf-8?B?TWFyayBMZWlzdG5lcg==?= ASP .Net 3 08-22-2006 11:13 PM
Does WSE 2.0 work with Medium trust or stronger? Michael Howes ASP .Net 0 01-26-2006 12:16 AM
Medium Level Trust and Reflection Paul Hatcher ASP .Net 0 02-25-2005 02:12 PM



Advertisments