Possible repost - Hainvg problems finding info on running remote applications

R

Rich Wallace

Hi all,

I have a third party application on about 7 different servers throughout our
environment that all do the same thing, just for different divisions. I'd
like to be able to create an application that I can run from my desktop that
will execute the 'remote' application but have the app run on its server
rather than the typical outcome of calling the EXE from the remote system,
but the app running on my PC. I also need the ability to receive a return
value when the application has finished running with a HRESULT if possible.

Does anyobdy have any ideas on how to do this or maybe some examples??

TIA
-Rich
 
N

Nick Malik

let me reword your request, so that you can tell me if I'm reading you
correctly...

Your environment has seven installations of the same third party
application.

You want to write a client, in VB.NET, that can perform the capabilities of
the third-party application by sending data to a remote server, and having
that server perform the operation, and send you back an HRESULT.

Well, if you want to get back an HRESULT, I assume that this is a COM+
application, right? So, the easy answer is to create a remote proxy for
each of the seven machines and install them locally, then write your app to
pick the object it wants before invoking a method on it. Not easy to write,
hard to install, and not that scalable.

On the other hand, you could implement a web service in .NET that will run
on each of the remote machines. (since they are the same app, you'd only
have to write it once). The web service would provide all the effort of
taking the call from the outside, performing any validation and
authentication needed, submit the request to the third-party app, get a
response, and package it for return.

Then, the client is easy, since it is a webservice consumer. You simply
give it a list of URLs to pick from, and it can invoke the same call on any
of them. If you really want to get adventurous, you could set up a UDDI
server and get your URLs from there.

Web services can make life so much easier.

--- Nick
 
R

Rich Wallace

I had actually thought about the WS route but wasn't sure if there was
another way that could have been as easy or maybe easier. Thank you for the
response sir!

-Rich
 
R

Rich Wallace

Ran into an issue....I wrote the web service using the following code:

<WebMethod()> Public Sub LaunchImport(ByVal sServer As String, ByVal sPath
As String)

Dim oXmlWrt As New XmlTextWriter("C:\Diag.xml", New
System.Text.ASCIIEncoding())
Dim sWinMgt As String

With oXmlWrt
.Formatting = Formatting.Indented
.Indentation = 4
.WriteStartDocument()
.WriteStartElement("LaunchImport")

Try

sWinMgt = "winmgmts://" & sServer & ""

'connect to processes
Dim Process = GetObject(sWinMgt).Get("Win32_Process")

'start app
Dim iPid As Integer
Dim RetVal = Process.Create(sPath, Nothing, Nothing, iPid)

.WriteElementString("Success", "Operation was successful")

Catch ex As Exception
.WriteElementString("Failure", ex.Message)
Finally
.WriteEndElement()
.WriteEndDocument()
.Flush()
.Close()
End Try

End With

End Sub

I used some code I borrowed from a vbs script I was working on during the
conceptual phase, and the application that I call does pop up and run as
expected when I run the script, but when I make the call from the Web
Service, the application starts a process on the server but never 'launches'
displaying the UI. I can see the executable running as a process in Task
Manager, but the third party app was written in a way where the screen needs
to physically load before the program will run as required.

Any ideas??

TIA
-Rich
 
R

Rich Wallace

Can anybody help on this at all please?

Rich Wallace said:
Ran into an issue....I wrote the web service using the following code:

<WebMethod()> Public Sub LaunchImport(ByVal sServer As String, ByVal sPath
As String)

Dim oXmlWrt As New XmlTextWriter("C:\Diag.xml", New
System.Text.ASCIIEncoding())
Dim sWinMgt As String

With oXmlWrt
.Formatting = Formatting.Indented
.Indentation = 4
.WriteStartDocument()
.WriteStartElement("LaunchImport")

Try

sWinMgt = "winmgmts://" & sServer & ""

'connect to processes
Dim Process = GetObject(sWinMgt).Get("Win32_Process")

'start app
Dim iPid As Integer
Dim RetVal = Process.Create(sPath, Nothing, Nothing, iPid)

.WriteElementString("Success", "Operation was successful")

Catch ex As Exception
.WriteElementString("Failure", ex.Message)
Finally
.WriteEndElement()
.WriteEndDocument()
.Flush()
.Close()
End Try

End With

End Sub

I used some code I borrowed from a vbs script I was working on during the
conceptual phase, and the application that I call does pop up and run as
expected when I run the script, but when I make the call from the Web
Service, the application starts a process on the server but never 'launches'
displaying the UI. I can see the executable running as a process in Task
Manager, but the third party app was written in a way where the screen needs
to physically load before the program will run as required.

Any ideas??

TIA
-Rich
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top