WSE3.0 in medium trust error!

Discussion in 'ASP .Net Web Services' started by srallen@gmail.com, Sep 5, 2006.

  1. Guest

    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!
     
    , Sep 5, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Hatcher

    Medium Level Trust and Reflection

    Paul Hatcher, Feb 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    510
    Paul Hatcher
    Feb 25, 2005
  2. Michael Howes
    Replies:
    0
    Views:
    509
    Michael Howes
    Jan 26, 2006
  3. =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=

    Does GridView.DataBind work under medium trust with custom objects

    =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=, Aug 22, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    525
    =?Utf-8?B?TWFyayBMZWlzdG5lcg==?=
    Aug 23, 2006
  4. Shukri

    database error on host with medium trust level

    Shukri, Nov 18, 2005, in forum: ASP .Net Security
    Replies:
    1
    Views:
    252
    Nicole Calinoiu
    Nov 20, 2005
  5. Linda
    Replies:
    1
    Views:
    568
    Dominick Baier
    Aug 31, 2006
Loading...

Share This Page