Re: Problemes with custom Webservices and security.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Tako (mi_at_e.mail.com)
Date: 12/09/04

  • Next message: yvfong: "RE: obfuscate web part dll"
    Date: Thu, 9 Dec 2004 09:37:07 +0100
    
    

    Noble Lesmana wrote:
    > Hi,
    >
    > Before I can do much help with your problem here, I need to see what
    > you're trying to do in you finally block. However, I suspect that you
    > do something that generates exception in your finally block. When the
    > exception is thrown, the ASP.NET will redirect your client to the
    > error page. Hence, you will never get the 'return "hello"' line
    > executed.

        At the end was a problems with the CatchAccessDeniedException from
    SPSite class :)

    >
    > You can try putting another try/catch block inside your finally block.
    >
    > As for the security issues, I suggest that you enable the
    > impersonation of security context. You can add:
    >
    > <identity impersonate="true"/>
    >
    > inside the web.config of your web service application.
    >
    > Then you should disable anonymous access in the IIS setting. Then you
    > can use windows authentication to enforce your client to login with
    > the security context that has permission to create site.
    >
    > Thank you.
    >
    >
    > "Tako" wrote:
    >
    >>
    >> I have a very strange problem:
    >>
    >> I have a client that calls a Webservice, this Webservice calls a
    >> DLL that uses de object model to create sites in SPS2003.
    >> If the user that uses the client hasnīt rights to create sites
    >> then the DLL throws a exception, this exception is catched by the
    >> Webservice, but then some strange happens.
    >>
    >> The code is something like that
    >>
    >> try
    >> call to dll
    >> catch
    >> somecode A
    >> finally
    >> somecode B
    >> end try
    >>
    >> return "hello"
    >>
    >> The call to dll generates a exception that itīs traped by
    >> "catch" then "somecode A" is executed, after that the "finally" part
    >> is executed ("somecode B") But then the Webservice never executes
    >> 'return "hello"', nevers executes code outsite the try statement.
    >>
    >> Then the client throws a connection exception (http error 401).
    >>
    >> It seems that the Webservice redirects itself to a page where
    >> the user does not have permissions and generates this connection
    >> error.
    >>
    >> Why happens this? I catch the security exception so I donīt know
    >> why the SPS redirects the Webserviceīs call to another place
    >> Any suggestion?
    >>
    >> Thank you very much mucho


  • Next message: yvfong: "RE: obfuscate web part dll"

    Relevant Pages

    • Re: Code design ideas?
      ... app and the webservice, etc. ... Errors of type 1 should be handled by the client side. ... Usually it is the Message of the Exception. ... severity levels: warning and error. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: WSE 2.0 and structured Exceptionhandling
      ... all Webservice inherit from a base webservice class ... This Document is then passed along to the SoapException. ... On the client, I've created a WebServiceInvokationException which unwraps ... >> When I throw an exception on the server side, ...
      (microsoft.public.dotnet.framework.webservices.enhancements)
    • RE: Problemes with custom Webservices and security.
      ... that generates exception in your finally block. ... the ASP.NET will redirect your client to the error page. ... security context. ... > I have a client that calls a Webservice, ...
      (microsoft.public.sharepoint.portalserver.development)
    • Re: Returing Exception Message
      ... If you are using MS Visual Studio and implement your WebService, ... and throw the exception on the client ... All I need is for the exception handling routine to behave like it ... >>> would if one sub called another sub on the client. ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: howto get exception information from asp.net webservice, without try and catch
      ... Typically the client of your webservice is not a human, so passing back HTML makes little sense. ... The SOAP protocol includes error handing with SoapFaults, so you should let the web service framework map the error on your side to the SoapFault back to the client. ... thrown exception anymore. ...
      (microsoft.public.dotnet.framework.aspnet)