Web Service Proxy Generator
Permission of type System.Net.WebPermission failed
Gravatar is a globally recognized avatar based on your email address. Permission of type System.Net.WebPermission failed
  Frits van den Munckhof
  All
  Feb 1, 2020 @ 08:47am

Hi Rick,

I have an VFP-application that uses a proxy-class made with your Web Service Proxy Generator. When I run it on the server I get an "OLE IDispatch exception code 0 from wwDotNetBridge: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=" .... " failed" error.

When I copy the complete application to my laptop it runs fine. Do you recognize the error and do you know a solution?

TIA, Frits van den Munckhof

Gravatar is a globally recognized avatar based on your email address. re: Permission of type System.Net.WebPermission failed
  Frits van den Munckhof
  Frits van den Munckhof
  Feb 1, 2020 @ 09:04am

Some more information: the only difference I can imagine is that when running the APP on the server it uses 3 dll's on the server (authoriserproxy.dll, wwipstuff.dll and wwdotnetbridge.dll) that were copied there. On my laptop these dll's are of course local to the laptop.

Gravatar is a globally recognized avatar based on your email address. re: Permission of type System.Net.WebPermission failed
  Rick Strahl
  Frits van den Munckhof
  Feb 1, 2020 @ 10:34pm

Take a look here:

Cannot load CLR Instance Error

By default .NET applications can't run from a network share unless the LoadFromRemoteSources setting is enabled.

There's a lot more info in the Web Connection documentation:

Web Connection for Cannot Load CLR Instance Error

Your error is different but it sounds like some of your DLLs are on the network so still effected by this.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Permission of type System.Net.WebPermission failed
  Frits van den Munckhof
  Rick Strahl
  Feb 19, 2020 @ 05:57am

Hi Rick,

Thanks for your excellent support as always. The problems are solved. I want to give you feedback. The Caspol suggestions worked to get rid of the permission-item. Than I ran into another problem which perhaps you can find a solution for in a future release. I describe it below.

I called a webservice method ActivateCard which needed a Value-tag of type long. In the calling VFP-code this value was calculated as 27.50 * 100 (=2750, which is an integer). But in fact the proxyclass saw a numeric instead of a long and generated a very cryptic errormessage: "Procedure canceled". If this would have been a more descriptive message (for example: "Incorrect datatype for Value") it would have been a lot easier to debug this problem. Because of this "procedure canceled" message I spent quite some time "barking up the wrong tree".

It's a mere suggestion to build in some datatype-checking into the framework. But I really admire the work you did and the excellent support you give. You always point me in the right direction when I'm a bit overwhelmed by the documentation.

Frits

Gravatar is a globally recognized avatar based on your email address. re: Permission of type System.Net.WebPermission failed
  Rick Strahl
  Frits van den Munckhof
  Feb 19, 2020 @ 12:49pm

Unfortunately there's not much that can be done about the errors. wwDotnetBridge basically makes dynamic calls against the .NET code, so the method that is called depends on the type of the parameters you pass. IOW, if you pass a certain type like a long vs. and int32 - that changes the way the method is looking for a target to execute against.

When these dynamic calls fail, they fail because .NET couldn't find a method to call that matches the parameters you're passing. In short, .NET doesn't know what you wanted to call and there's no information available other than a generic error that it couldn't find the method (or property) you were trying to access. Hence there's nothing that can tell you what the target method actually looks like or which parameter didn't work.

Long story short - I would love better errors for this too, but it's not really possible.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Permission of type System.Net.WebPermission failed
  Frits van den Munckhof
  Rick Strahl
  Feb 20, 2020 @ 12:31am

Hi Rick,

Thanks that you looked into it. I will try to remember that when calling a webservice methode I can't be as "loose" about datatypes as I am used to in VFP 😉.

All the best!

© 1996-2024