Unable To Use IntPtr (WindowsIdentity Token) As Input Param On WebMethod (ASMX Web Service)?
Jun 26, 2009
We're in a strange situation with a legacy winforms VB.NET 1.1 application using ASMX web services. Trying to send a user Token from a WindowsIdentity object as a parameter to a WebMethod. I will be adding a 'HACK: comment. System.Security.Principal.WindowsIdentity.GetCurrent().Token
The token is of type IntPtr, the first problem is the WSDL being generated doesn't support IntPtr with the error of 'unsupported type'I'm aware this is a big WTF question and sounds insecure, so any simple helpful alternatives are welcome but there are a lot of constraints on how we can change this system, including complications with the hosting environment. So I would just like to get our piece of data over to the web service to save a lot of other headaches.
How can i turn on debugging when trying to add a service to my VB.net app? How can i change the settings to view it remotely? I tried loading up the .asmx page in IE on that server where the file is being hosted and it just asked me to save the file-would never open it to view as a page. That is the error i get when i try to load the .asmx file from my server.
I'm writing an asmx web service in visual basic, and I would like to put in my web service an enum that should be available to the web service's callers through the wsdl. But how could that be done? I'm writing my enum in the web service class, but it's not being published in the wsdl. I've already done this kind of thing successfully using C#, but I cannot understand how this is done in VB.
Public Class NotifierAuthHeader Inherits SoapHeader Public HandlerId As Integer Public Guid As Byte() End Class
which I use in webservice in following methods:
<OperationContract()><WebMethod()> _ public Function GetTestNotifierAuthHeader() Dim testNotifierAuthHeader as NotifierAuthHeader=new NotifierAuthHeader()
[code]....
I can use GetTestNotifierAuthHeader method at client, but type of return object is..object, not NotifierAuthHeader.asmx service is 3.5 and wpf app is 4.0 c#.
I have some clients calling my asmx service and I figure out to change my asmx to a Wcf service.How can my asmx clients call to my Wcf service without modify the client application?Maybe just a few changes in the config file...I can't expect than they compile their applications.
When I try to call a [Java] web service from .NET, I am getting what appears to be a security credentials issue. CWWSS5509E: A security token whose type is [http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken] is required.Is it even picking up the credentials that I am trying to pass? At this point, I just want to make contact with the web service and get access. In my example, ServiceReference1 is a generated Web proxy class.
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim myLocateProfileBySourceSystemId As New ServiceReference1.locateProfileBySourceSystemId
I am trying to post data from vb.net application to web service asmx that is located on server! For posting data from vb.net application I am using this code:
I created a dll project in visual studio 2008, and i dont see the add web reference option, only the Service Reference option whish looks like it takes a WCF not a regular asmx web service, is that correct?
OK I am brand new to .asmx creation and I am having a hell of a time figuring out to send a URL to .asmx file. The .asmx file is expecting to receive a parameter named givenURL.The paremeter givenURL needs to be sent from Windows Forms.I need to know how I go about doing this? Do I use SOAP or can I just send it using VB? [code]
I'm building a web service to accept notifications from a company. The company informed me that the service is incorrectly structured and provided me the .asmx of a working web service. It looks like this:
I am trying to startup a simple VB.net program that has a GUI from a service. I have tried a few flavors of Process.Start and none of them allow the GUI to work. I can get the farthest using:
System.Diagnostics.Process.Start( "C:ProgramDataWatcherStartIt.bat") And from inside the batch: start C:TestTestStart.exe
Eventually I get an "Interactive Services Detection" dialog telling me that a message is trying to be displayed and when I click View the message, I see my expected dialog but the program won't run. I am Running on Win7 Home 64 bit. My Simple GUI program was written in VB.net VS2008. I set the service properties to "allow interaction with the desktop" but this does not help.Is there any way to launch a program from within a service that will allow you to interact with the desktop?
I'm in a ASP.NET application using Windows Authentication.I'm using HttpContext.Current.User.Identity.Name to get the username of the currently authenticated user, which gets me a username in the format DOMAINUSERNAME. This is working fine.Is there an easy way to convert this to a display name (e.g. "Richard Gadsden") like the one that appears on the top of my start menu in XP?If I have to, I guess I can go through System.DirectoryServices and query into ADSI, but surely there's an easier way?
I am using WindowsIdentity and WindowsPrincipal classes. Using IsInRole(String parameter) method returns with an error : "The trust relationship between this workstation and the primary domain failed."
The code works fine in different domain. I just copied the project and run in my machine, it results in error.
I'm working on creating a windows service that will send emails to a customer when they are within a month of having their submission expire. I'm using vb.net in Visual Studios 2008
Because it's a windows service it's very difficult to debug. Trying to narrow down my error I created a "sendDebugEmail" method that sends me an email if it gets to a certain line. The emails never make it past "dr = cmd.ExecuteReader()"
I'm wondering what I am doing wrong. My SQL statement should work fine. I've tested it in my SQL server database.
I've created a dummy_database that I just made in sql server as well. I added an INSERT sql statement for the dummy table i have in there just to see if i could actually access a database. All the table takes in is the line number and time it was sent. When I run my windows service that database updates just fine.[code]...
I currently have a windows service that is packaged up as an msi installer. However, during the installation i need the user to input their required filepath (to string) location. The filepath variable currently resides in my component class called MyNewService that is inherited from System.ServiceProcess.ServiceBase.
Is there anyway i can allow the user to define the filepath variable during installation?
When I try to communicate with my web service I get this error server was unable to process request. ---> Input array is longer than the number of columns in this table. [code]
I need to get the user input for where they want the files that will be produced by my windows service to be stored.
I was thinking that i could do this by reading in the user's input to a variable in the on start event of my service? this variable is then later used in my xml writer.
When I build a project in visual studio 2005, I got some errors that are like
"The assembly 'xxxx, Version=5.2.0.0, Culture=neutral, PublicKeyToken=7bd72a647a3c48e9' is not registered for COM Interop. Please register it with regasm.exe /tlb." So I followed the link http://support.microsoft.com/kb/316163 to register them with regasm.exe /tlb.
However, I got an error " Unable to locate input assembly 'microsoftbasic.dll' etc.
I've been assigned a web app written in VB using VStudio.net 2003. I am trying to configure the source on my localhost (VStudio 2008) so I can explore and learn about the current app (before I begin any real changes) and I cannot get debugging working for the web service project(s).
Symptom 1: "Unable to automatically step into the server. The remote procedure could not be debugged. This usually indicates that debugging has not been enabled on the server. See help for more information". This happens when I try to F11 (stepInto) the proxy class which invokes my actual web method.
Symptom 2: Pre-setting a breakpoint in my .asmx file code on the statement that will be invoked does not work (i.e. the debugger simply doesn't stop). Having described the situation, here's how my VStudio Solution is configured: Service1 - project created from the VB - WEB - ASP.NET Web Service Application template; this Service1 project contains my main .asmx source code I want to debug. Web.config for this project contains compilation defaultLanguage="vb" debug="true"
I have a Windows Service that needs to start other processes under a user context other than that used by the service. I've seen other posts related to this but have seen no resolutionI've tried many things and have been unsuccessful in starting the process from a Windows Service when a username, password is supplied. orking as it's a requirement of our system to do this and it worked fine until recently and only fails on Vista and Windows 7 (works on XP).
The following code is used to start the process. Dim P As New Process P.StartInfo.Domain = Domain
I have a web-app that will reside on a production server where I want to get the user's logged in computer name, circa DOMAINNAME/USERNAME Many people have told me that I must use Impersonation/Delegation in order to get this, but no details beyond that have been provided. Originally, my tests used:
If I have a variable, X, of type SqlDecimal, that was instantiated without providing a decimal value parameter to the constructor, then the .IsNull property is True: Dim X As New SqlDecimal '.Value = Null..If I have a Stored Procedure that acepts a single parameter, @SqlDecimalParameter, of type Decimal, the value of this this parameter could be NULL or a decimal value. This is how I would normally call the stored procedure:[code]It seems like the 1st example should work. Am I missing something? after all, the Sql datatypes are designed to work with SQL Server, I thought.[code]I get the following error:Failed to convert parameter value from a SqlDecimal to a Decimal.It works when X.IsNull is True.How do you set the value of the PARAM object when it can be NULL?
i've got a Class like this public Class Cart(Of Item) Public Sub New(ByVal a As Integer, ByVal ParamArray items As Item())but i do not see how to create an instance of it: Dim block_names As New Cart(Of String, 5I)i get something like "type expected" o.O