vb.net - .NET 1.1 WSDL - Unable to use IntPtr (WindowsIdentity.Token) as input param on WebMethod (ASMX Web Service) -


We are using a inherited winforms VB.NET 1.1 application ASMX web services which are in a strange situation. Trying to send a user identity from a WindowsIdentity object as a parameter for a webmeter. I would like to add a 'hack: comment'.

  System Security. Principal. Windows Identity GetCurrent () Token type is IntPtr, the first problem is that the WSDL is being generated, does not support interpetric with the 'unsupported type' error.  

I know this is a big WTF question and looks insecure, so any simple helper option is welcome but there are many obstacles on how to change the system, including complications with hosting environment. So I like to get my data in the web service to save a lot of other headaches. Error generation from WSDL:

Problem 1

Error generation from WSDL:

  The method can not be reflected in userClass.TestSendIntPtr. - & gt; There was an error showing 'token' - & gt; System.IntPtr is an unsupported type.  

An alternative approach (enhances the WTF factor) - The INTERPRTR is trying to move around the issue, it is inserted to INOPT only in one system. Use of IOSstream

  BinaryFormatter.Serialize ()  

On the winforms service at App and BF.Deserialize (). But this leads to a new strange issue.

Define the signature of the web service system in this fashion:

  Public class UserService Inherits System.Web.Services.WebService & lt; WebMethod () & gt; _ Public Function UserToken (IoSon Stream Stream as System). As a boolean, new strange issue arises as a compilation error on the client end, such as 'System.IO' merit.  

Problem 2

  value type 'in the form of a system IO.Stream 'can not be changed to' USERSERVICE.Stream '.  

So the answer to any question, or the equivalent alternative approach would be great ...

If any intersport will not work due to a lack of support in WSDL, then use a longer time instead. Intepets are integer and lengthy and variable. You can pass one of these values ​​(preferably long) around the value and convert it back to the other end.

Change long

  longer as a dim value = token. ToInt64 ()  

long-term convert

  IntPtr = new IntPtr (value) in the form of a slow token  

One thing you should pay attention to is that a token is valid only in the address space of the process which is worth. If you are passing values ​​through a web service that resides in another process, there will be no possible value in the token. It will have the same physical address but you will not be able to query the values ​​of that token.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -