I’m having a problem that has me going out of my mind.
Here’s what’s happening:I’m
invoking a web service (WS) from an aspx page. Then that WS calls a SAP WS that is in a different machine. The first WS is published in a virtual directory in the default web site of IIS (Windows Server 2003) with Integrated Windows Authentication. The request
gets threw to the first WS successfully and when I run debug I see that I’m authenticated when I get there. The problem is when, in the first WS, I request a new set of credentials to access the SAP WS. It gives me the following exception:
Request for the permission of type ‘System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed
More specifically, it gives me the following exceptions in this line of code:
bapiVendorGetDetailService.Credentials =
New System.Net.NetworkCredential(username, password)
Domain - Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
Password - Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
Username - Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The code I use to call the first WS is this:
Dim sapWS
AsNew WSSAP.Service1 sapWS.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
Dim vendorName
AsString = sapWS.GetVendorName("0000100002")
The funny thing is that when I access the WS threw the asmx page, everything works just fine.
I don't know if what I said was confusing. I hope not because I can really use the help
goncalomarco...
0 Points
6 Posts
‘System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e...
May 09, 2008 03:53 PM|LINK
Hi,
I’m having a problem that has me going out of my mind.Here’s what’s happening: I’m invoking a web service (WS) from an aspx page. Then that WS calls a SAP WS that is in a different machine. The first WS is published in a virtual directory in the default web site of IIS (Windows Server 2003) with Integrated Windows Authentication. The request gets threw to the first WS successfully and when I run debug I see that I’m authenticated when I get there. The problem is when, in the first WS, I request a new set of credentials to access the SAP WS. It gives me the following exception:
Request for the permission of type ‘System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
More specifically, it gives me the following exceptions in this line of code:
bapiVendorGetDetailService.Credentials = New System.Net.NetworkCredential(username, password)
Domain - Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Password - Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Username - Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.The code I use to call the first WS is this:
Dim sapWS As New WSSAP.Service1
sapWS.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
Dim vendorName As String = sapWS.GetVendorName("0000100002")
The funny thing is that when I access the WS threw the asmx page, everything works just fine.
I don't know if what I said was confusing. I hope not because I can really use the help
Thanks in advance