Hi,
I've got a custom assembly used in Rptsvcs that calls a web service on the
local host. When run in Report Designer, it works as planned, but when run
in Report Server, it doesn't call the web service. I have a
HelloWorld-method in the custom assembly that works, so the assembly is
working but it can't call the web service.
I have modified RSReportServer.config as follows:
<CustomAssemblies>
<Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
PublicKeyToken=xxx">
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution, Assertion"
/>
<IPermission class="System.Security.Permissions.WebPermission"
version="1">
<ConnectAccess>
<URI uri="$OriginHost$"/>
</ConnectAccess>
</IPermission>
</PermissionSet>
</Assembly>
<Default>
<PermissionSet class="System.Security.PermissionSet">
<IPermission
class="System.Security.Permissions.SecurityPermission"
version="1"
Flags="Execution"
/>
</PermissionSet>
</Default>
</CustomAssemblies>
And the policy file rssrvpolicy.config is also modified:
<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Attributes="LevelFinal"
Name="cmcs.wsclient"
Description="Codegroup generated by the .NET Configuration tool">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="file://C:/Program Files/Microsoft SQL
Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
</CodeGroup>
Any tips?
JonasI forgot to mention that I make an assert in code before the call to the web
service:
WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
webPerm.Assert();
TIA
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I've got a custom assembly used in Rptsvcs that calls a web service on the
> local host. When run in Report Designer, it works as planned, but when run
> in Report Server, it doesn't call the web service. I have a
> HelloWorld-method in the custom assembly that works, so the assembly is
> working but it can't call the web service.
> I have modified RSReportServer.config as follows:
> <CustomAssemblies>
> <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
> PublicKeyToken=xxx">
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution, Assertion"
> />
> <IPermission class="System.Security.Permissions.WebPermission"
> version="1">
> <ConnectAccess>
> <URI uri="$OriginHost$"/>
> </ConnectAccess>
> </IPermission>
> </PermissionSet>
> </Assembly>
> <Default>
> <PermissionSet class="System.Security.PermissionSet">
> <IPermission
> class="System.Security.Permissions.SecurityPermission"
> version="1"
> Flags="Execution"
> />
> </PermissionSet>
> </Default>
> </CustomAssemblies>
>
> And the policy file rssrvpolicy.config is also modified:
> <CodeGroup class="UnionCodeGroup"
> version="1"
> PermissionSetName="FullTrust"
> Attributes="LevelFinal"
> Name="cmcs.wsclient"
> Description="Codegroup generated by the .NET Configuration tool">
> <IMembershipCondition class="UrlMembershipCondition"
> version="1"
> Url="file://C:/Program Files/Microsoft SQL
> Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> </CodeGroup>
> Any tips?
> Jonas
>
>|||After some more investigation, I found out that it is the following
statement
ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
I need this to get the web services to use the callers identity. The
exception thrown is:
Request for the permission of type
System.Security.Permissions.EnvironmentPermission
As before, it works in Report Designer so the code is alright, it is the
security configuration that fails somewhere.
/Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
> I forgot to mention that I make an assert in code before the call to the
web
> service:
> WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
> webPerm.Assert();
> TIA
> Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> > Hi,
> >
> > I've got a custom assembly used in Rptsvcs that calls a web service on
the
> > local host. When run in Report Designer, it works as planned, but when
run
> > in Report Server, it doesn't call the web service. I have a
> > HelloWorld-method in the custom assembly that works, so the assembly is
> > working but it can't call the web service.
> >
> > I have modified RSReportServer.config as follows:
> >
> > <CustomAssemblies>
> > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx, Culture=neutral,
> > PublicKeyToken=xxx">
> > <PermissionSet class="System.Security.PermissionSet">
> > <IPermission
> > class="System.Security.Permissions.SecurityPermission"
> > version="1"
> > Flags="Execution, Assertion"
> > />
> > <IPermission class="System.Security.Permissions.WebPermission"
> > version="1">
> > <ConnectAccess>
> > <URI uri="$OriginHost$"/>
> > </ConnectAccess>
> > </IPermission>
> > </PermissionSet>
> > </Assembly>
> >
> > <Default>
> > <PermissionSet class="System.Security.PermissionSet">
> > <IPermission
> > class="System.Security.Permissions.SecurityPermission"
> > version="1"
> > Flags="Execution"
> > />
> > </PermissionSet>
> > </Default>
> > </CustomAssemblies>
> >
> >
> > And the policy file rssrvpolicy.config is also modified:
> >
> > <CodeGroup class="UnionCodeGroup"
> > version="1"
> > PermissionSetName="FullTrust"
> > Attributes="LevelFinal"
> > Name="cmcs.wsclient"
> > Description="Codegroup generated by the .NET Configuration
tool">
> > <IMembershipCondition class="UrlMembershipCondition"
> > version="1"
> > Url="file://C:/Program Files/Microsoft SQL
> > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> > </CodeGroup>
> >
> > Any tips?
> >
> > Jonas
> >
> >
> >
>|||I've finally gotten the report to run in Report Server, but it took a while
and a nasty config to do it. It seems that the only way to get this to work
is to change the PermissionSet for Report_Expressions_Default_Permissions in
rssrvpolicy.config to FullTrust. I've tried to create a custom PermissionSet
with CASPOL where I ended up adding all permissions and setting them to
Unrestricted="true" thinking that I could then remove one at a time to
finally get a lower priviliege permission set, but the only thing that works
is FullTrust.
Is there someone else that have experienced the same thing?
Brgds
Jonas
"Jonas" <Jonas@.nospam.pl> wrote in message
news:%23YQR7hPIGHA.2212@.TK2MSFTNGP15.phx.gbl...
> After some more investigation, I found out that it is the following
> statement
> ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
> I need this to get the web services to use the callers identity. The
> exception thrown is:
> Request for the permission of type
> System.Security.Permissions.EnvironmentPermission
> As before, it works in Report Designer so the code is alright, it is the
> security configuration that fails somewhere.
> /Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
> > I forgot to mention that I make an assert in code before the call to the
> web
> > service:
> >
> > WebPermission webPerm = new WebPermission(PermissionState.Unrestricted);
> > webPerm.Assert();
> > TIA
> >
> > Jonas
> >
> > "Jonas" <Jonas@.nospam.pl> wrote in message
> > news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
> > > Hi,
> > >
> > > I've got a custom assembly used in Rptsvcs that calls a web service on
> the
> > > local host. When run in Report Designer, it works as planned, but when
> run
> > > in Report Server, it doesn't call the web service. I have a
> > > HelloWorld-method in the custom assembly that works, so the assembly
is
> > > working but it can't call the web service.
> > >
> > > I have modified RSReportServer.config as follows:
> > >
> > > <CustomAssemblies>
> > > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx,
Culture=neutral,
> > > PublicKeyToken=xxx">
> > > <PermissionSet class="System.Security.PermissionSet">
> > > <IPermission
> > > class="System.Security.Permissions.SecurityPermission"
> > > version="1"
> > > Flags="Execution, Assertion"
> > > />
> > > <IPermission
class="System.Security.Permissions.WebPermission"
> > > version="1">
> > > <ConnectAccess>
> > > <URI uri="$OriginHost$"/>
> > > </ConnectAccess>
> > > </IPermission>
> > > </PermissionSet>
> > > </Assembly>
> > >
> > > <Default>
> > > <PermissionSet class="System.Security.PermissionSet">
> > > <IPermission
> > > class="System.Security.Permissions.SecurityPermission"
> > > version="1"
> > > Flags="Execution"
> > > />
> > > </PermissionSet>
> > > </Default>
> > > </CustomAssemblies>
> > >
> > >
> > > And the policy file rssrvpolicy.config is also modified:
> > >
> > > <CodeGroup class="UnionCodeGroup"
> > > version="1"
> > > PermissionSetName="FullTrust"
> > > Attributes="LevelFinal"
> > > Name="cmcs.wsclient"
> > > Description="Codegroup generated by the .NET Configuration
> tool">
> > > <IMembershipCondition class="UrlMembershipCondition"
> > > version="1"
> > > Url="file://C:/Program Files/Microsoft SQL
> > > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
> > > </CodeGroup>
> > >
> > > Any tips?
> > >
> > > Jonas
> > >
> > >
> > >
> >
> >
>|||Yes, I also had a heck of a time with this. We are calling a web service to
translate English to Spanish.
I ended up going the FullTrust route myself, still haven't tested on a clean
machine all the install and config steps I took.
Steve
"Jonas" <Jonas@.nospam.pl> wrote in message
news:ejM$u7RIGHA.376@.TK2MSFTNGP12.phx.gbl...
> I've finally gotten the report to run in Report Server, but it took a
> while
> and a nasty config to do it. It seems that the only way to get this to
> work
> is to change the PermissionSet for Report_Expressions_Default_Permissions
> in
> rssrvpolicy.config to FullTrust. I've tried to create a custom
> PermissionSet
> with CASPOL where I ended up adding all permissions and setting them to
> Unrestricted="true" thinking that I could then remove one at a time to
> finally get a lower priviliege permission set, but the only thing that
> works
> is FullTrust.
> Is there someone else that have experienced the same thing?
> Brgds
> Jonas
> "Jonas" <Jonas@.nospam.pl> wrote in message
> news:%23YQR7hPIGHA.2212@.TK2MSFTNGP15.phx.gbl...
>> After some more investigation, I found out that it is the following
>> statement
>> ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
>> I need this to get the web services to use the callers identity. The
>> exception thrown is:
>> Request for the permission of type
>> System.Security.Permissions.EnvironmentPermission
>> As before, it works in Report Designer so the code is alright, it is the
>> security configuration that fails somewhere.
>> /Jonas
>> "Jonas" <Jonas@.nospam.pl> wrote in message
>> news:ewR3eFOIGHA.1288@.TK2MSFTNGP09.phx.gbl...
>> > I forgot to mention that I make an assert in code before the call to
>> > the
>> web
>> > service:
>> >
>> > WebPermission webPerm = new
>> > WebPermission(PermissionState.Unrestricted);
>> > webPerm.Assert();
>> > TIA
>> >
>> > Jonas
>> >
>> > "Jonas" <Jonas@.nospam.pl> wrote in message
>> > news:%23Na2whMIGHA.376@.TK2MSFTNGP12.phx.gbl...
>> > > Hi,
>> > >
>> > > I've got a custom assembly used in Rptsvcs that calls a web service
>> > > on
>> the
>> > > local host. When run in Report Designer, it works as planned, but
>> > > when
>> run
>> > > in Report Server, it doesn't call the web service. I have a
>> > > HelloWorld-method in the custom assembly that works, so the assembly
> is
>> > > working but it can't call the web service.
>> > >
>> > > I have modified RSReportServer.config as follows:
>> > >
>> > > <CustomAssemblies>
>> > > <Assembly Name="cmcs.wsclient, Version=1.0.xxx.xxxx,
> Culture=neutral,
>> > > PublicKeyToken=xxx">
>> > > <PermissionSet class="System.Security.PermissionSet">
>> > > <IPermission
>> > > class="System.Security.Permissions.SecurityPermission"
>> > > version="1"
>> > > Flags="Execution, Assertion"
>> > > />
>> > > <IPermission
> class="System.Security.Permissions.WebPermission"
>> > > version="1">
>> > > <ConnectAccess>
>> > > <URI uri="$OriginHost$"/>
>> > > </ConnectAccess>
>> > > </IPermission>
>> > > </PermissionSet>
>> > > </Assembly>
>> > >
>> > > <Default>
>> > > <PermissionSet class="System.Security.PermissionSet">
>> > > <IPermission
>> > > class="System.Security.Permissions.SecurityPermission"
>> > > version="1"
>> > > Flags="Execution"
>> > > />
>> > > </PermissionSet>
>> > > </Default>
>> > > </CustomAssemblies>
>> > >
>> > >
>> > > And the policy file rssrvpolicy.config is also modified:
>> > >
>> > > <CodeGroup class="UnionCodeGroup"
>> > > version="1"
>> > > PermissionSetName="FullTrust"
>> > > Attributes="LevelFinal"
>> > > Name="cmcs.wsclient"
>> > > Description="Codegroup generated by the .NET Configuration
>> tool">
>> > > <IMembershipCondition class="UrlMembershipCondition"
>> > > version="1"
>> > > Url="file://C:/Program Files/Microsoft SQL
>> > > Server/MSSQL/Reporting Services/ReportServer/bin/cmcs.wsclient.dll"/>
>> > > </CodeGroup>
>> > >
>> > > Any tips?
>> > >
>> > > Jonas
>> > >
>> > >
>> > >
>> >
>> >
>>
>|||When the report is deployed and run from the web server it runs under a
different set of user credentials to when it is in debug, (Probably "Local
System" or "Network Service", which ever user is configured to run the
reporting services?).
Try explicitly setting the network credentials like so..
ws.Credentials = new NetworkCredential(Username, Password, Domain);
I actually store my username/password/domain in a Settings file, to allow it
to be changed easliy.
This works for me when calling the reporting services web service, I am using:
1. Explicit credentials of a domain user that can access the web service,
2. set the rssrvpolicy.config, Report_Expressions_Default_Permissions -->
Full_Trust
Note I am running my assembly in the gac.
Hope this helps
John
Saturday, February 25, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment