Hi guys,
I've recently started developing sharepoint tools in a new job and let's just say that it is not that simple :P
I'm currently building an assembly that needs takes a web service url (aspx) in parameters and retrieves the web service description (wsdl) and returns the name of all the exposed methods and parameters of that web service. The problem I have is that the assembly must have "Full trust" in order to run. I tried setting the web app in full trust, which works, but it is not a good practice. So now I'm trying to set the manifest of my assembly to give my assembly full trust. but I cans seem to find the right syntax to do so. Here's one I tried :
But it doesn't work. I've been serching the web for already too long :P Anyways, If this makes sense for anybody, I'm new to those sharepoint things so I know that my explanations might not be very precise, I'd be happy if someone could enlighten me about Code Access Security.Code:<?xml version="1.0" encoding="utf-8"?> <Solution xmlns="http://schemas.microsoft.com/sharepoint/"> <CodeAccessSecurity> <PolicyItem> <PermissionSet class="NamedPermissionSet" version="1" Name="AllowWebServiceCall"> <IPermission class="WebPermission" version="1" unrestricted="true"/> </PermissionSet> <Assemblies> <Assembly Name="$SharePoint.Project.AssemblyName$" Version="$SharePoint.Project.AssemblyVersion$" PublicKeyBlob="$SharePoint.Project.AssemblyPublicKeyBlob$"/> </Assemblies> </PolicyItem> </CodeAccessSecurity> </Solution>
Here's the exception I get, in attachement, I know that its only a security problem as when I set the web application trust level to "Full" it works well.
Edit: Another thing I must add, the assembly is currently deployed to the GAC which if I understands well means it i already "full trusted" But it seems that as I'm running a Sharepoint sandbox the sandbox itself can call the assembly but does not have the right permissions for the code that is executed in the DLL's methode that gets the wsdl xml from the webservice.
thanks.




Reply With Quote
