Web Service ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Recently, I developed a web service on my dev box (XP SP2). On another
machine, I developed a console app that uses a method in the web service that
just returns an integer. Everything works fine in the console app.

However, if I put the same code in a code behind application for Excel 2003
using VSTO 2003, I get the following error:

System.Security.SecurityException: Request for the permission of type
System.Net.WebPermission, System, bla bla bla ... failed.

Why does the code work in a console app and not in my VSTO Excel App? More
importantly, how do I get the VSTO app to work?

Thanks,
-- John
 
Can you run the webservice locally on the same vsto machine and see what
happens? If it runs, you will need to cnfgure VSTO permissions for the
remote site

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
Peter has a good blog about this...

http://blogs.msdn.com/ptorr/archive/2003/11/22/56344.aspx

Basically, a helper assembly is loaded at run-time in order to pass the data
to/from the web service via XML. This assembly doesn't have enough
permission to execute, so you need to grant the assembly permission. He goes
on to say that you can do this by adding a rule to the policy that grants
FullTrust to the GAC path of System.dll.

This can also be done using the mmc .net configuration tool.

-- Jim


Alvin Bruney - ASP.NET MVP said:
Can you run the webservice locally on the same vsto machine and see what
happens? If it runs, you will need to cnfgure VSTO permissions for the
remote site

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



John Thompson said:
Recently, I developed a web service on my dev box (XP SP2). On another
machine, I developed a console app that uses a method in the web service that
just returns an integer. Everything works fine in the console app.

However, if I put the same code in a code behind application for Excel 2003
using VSTO 2003, I get the following error:

System.Security.SecurityException: Request for the permission of type
System.Net.WebPermission, System, bla bla bla ... failed.

Why does the code work in a console app and not in my VSTO Excel App? More
importantly, how do I get the VSTO app to work?

Thanks,
-- John
 
Back
Top