Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    [ASP.NET 2.0] Problema:System.Net.WebPermission

    Salve raga!!
    Sono un neofita dei servizi web...
    ho questo problema:
    sul mio solito server di sviluppo ho installato il framework 2.0 e gira e i siti vanno ecc..
    allora ho provato a creare un web service, tanto per intenderci ho compilato il progetto che VS2005 mi ha creato. a questo punto ho un web service che si trova in un url del tipo: http://192.168.2.254/WebService/WebService.asmx

    Quando però cerco di interrogarlo tramite un PC della rete tramite un'applicazione Windows .NET Frmwrk 2.0 (in vb) mi da il seguente errore:

    System.Security.SecurityException was unhandled
    Message="Richiesta di autorizzazione di tipo 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' non soddisfatta."
    Source="mscorlib"
    StackTrace:
    in System.Security.CodeAccessSecurityEngine.Check(Obj ect demand, StackCrawlMark& stackMark, Boolean isPermSet)
    in System.Security.CodeAccessPermission.Demand()
    in System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
    in System.Net.HttpRequestCreator.Create(Uri Uri)
    in System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
    in System.Net.WebRequest.Create(Uri requestUri)
    in System.Web.Services.Protocols.WebClientProtocol.Ge tWebRequest(Uri uri)
    in System.Web.Services.Protocols.HttpWebClientProtoco l.GetWebRequest(Uri uri)
    in System.Web.Services.Protocols.SoapHttpClientProtoc ol.GetWebRequest(Uri uri)
    in System.Web.Services.Protocols.SoapHttpClientProtoc ol.Invoke(String methodName, Object[] parameters)
    in TestWebService2005.dk.iter.webservices.GoogleServi ce.GoogleSearch(String QueryString, Int32 Offset, String strLicenseKey)
    in TestWebService2005.Form1.Button1_Click(Object sender, EventArgs e)
    in System.Windows.Forms.Control.OnClick(EventArgs e)
    in System.Windows.Forms.Button.OnClick(EventArgs e)
    in System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
    in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in System.Windows.Forms.ButtonBase.WndProc(Message& m)
    in System.Windows.Forms.Button.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    in System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    in System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    in System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    in System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
    in System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
    in System.Windows.Forms.Application.Run(ApplicationCo ntext context)
    in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
    in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
    in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
    in TestWebService2005.My.MyApplication.Main(String[] Args)
    in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    in Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
    in System.Threading.ThreadHelper.ThreadStart_Context( Object state)
    in System.Threading.ExecutionContext.runTryCode(Objec t userData)
    in System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
    in System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state)
    in System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
    in System.Threading.ThreadHelper.ThreadStart()


    Da cosa dipende?

    Grazie
    Ciao
    *** Rachele TI AMO DA MORIRE!!! ***

  2. #2
    Io faccio così:

    Creo un'applicazione windows con vs.net 2005
    Aggiungo un riferimento web all'applicazione specificando l'url del servizo.
    Poi scrivo:
    codice:
    Dim m as MyReference.MyService
    Msgbox(m.HelloWorld)

    Il Sistema mi si blocca sulla seconda riga dando l'errore specificato prima.
    *** Rachele TI AMO DA MORIRE!!! ***

  3. #3
    Ho risolto!!!

    il problema risiedeva nel fatto che il progetto veniva aperto da un'unita di rete (questo perchè i sorgenti delle applicazioni li metto nel server) se l'eseguibile risiede in locale, anche se la richiesta al webservice è via rete, funziona tutto ok.

    Ciao
    *** Rachele TI AMO DA MORIRE!!! ***

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.