on 08-16-2007 7:14 AM
hi,
i try to call a SAP webservice from .Net.
Proxy
WebService.WebReference.ZWS_RESET_SAP_PASSWDService proxy = new WebService.WebReference.ZWS_RESET_SAP_PASSWDService();
NetworkCredential credentials = new NetworkCredential("benutzer", "password");
proxy.Credentials = credentials;
String s = proxy.ZbcResetUserPassword(Parameter);
If i set the user and password an exception is thrown.
Eine Ausnahme (erste Chance) des Typs "System.Security.SecurityException" ist in mscorlib.dll aufgetreten.
System.Security.SecurityException: Fehler bei der Anforderung des Berechtigungstyps System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
bei System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
bei System.Security.CodeAccessPermission.Demand()
bei System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
bei System.Net.HttpRequestCreator.Create(Uri Uri)
bei System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
bei System.Net.WebRequest.Create(Uri requestUri)
bei System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)
bei System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)
bei System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)
bei System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
bei WebService.WebReference.ZWS_RESET_SAP_PASSWDService.ZbcResetUserPassword(String Bname)
bei WebService.Form1.button1_Click(Object sender, EventArgs e)
Die Aktion, bei der ein Fehler aufgetreten ist:
Demand
Der Typ der ersten Berechtigung, bei der ein Fehler aufgetreten ist:
System.Net.WebPermission
Die Zone der Assembly, bei der ein Fehler aufgetreten ist:
Trusted
Der Thread 0xf28 hat mit Code 0 (0x0) geendet.
Das Programm "[3044] WebService.vshost.exe: Verwaltet" wurde mit Code 0 (0x0) beendet.
In the webservice the parameter for the authentification is none.
1. Do i have to create a rfc destination in sap?
2. Any ideas what's wrong?
regards
Hi wolfgang,
Please refer this article for a step by step webservice consumption in .NET
Also if the exception is because of user name and password then try to give some variables instead of string values for user name and password.
Also you can refer this thread for the same problem discussion.
http://www.thescripts.com/forum/thread525060.html
Regards
Sumit Bhutani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if i set the user and password the following error occurs.
Domain = "credentials.Domain" hat eine Ausnahme vom Typ "System.Security.SecurityException" verursacht.
Domain = "credentials.User" hat eine Ausnahme vom Typ "System.Security.SecurityException" verursacht.
Domain = "credentials.Password" hat eine Ausnahme vom Typ "System.Security.SecurityException" verursacht.
The other desciption doesn't help.
any ideas?
regards
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.