How to connect Adobe Air client side with Java VM Debug Interface? - apache-flex

I'd like to know if/how would it be possible to connect Adobe Air application to Java VM Debug Interface? I have some objects residing on server side and don't want to change the code there and server already allows to do remote debugging.
Here's the information about JPDA:
http://www.j2ee.me/j2se/1.3/docs/guide/jpda/architecture.html
Greatly appreciate for your advice in advance.

Be very careful about opening the remote debugging interface to the Internet. That could be a huge security problem.
Security considerations aside, only a single debugger process can attach to the JVM at the same time.
You should really look at some of the more regular remoting protocols, such as SOAP or REST over HTTP(S) to talk to your server. This is not more work (probably less) than trying to shoe-horn JPDA into something it was not meant to do.

Related

Can two java applications talk over javelin web sockets?

I'm developing a distributed Java application that implements state machines in a master -> slave/s configuration.
I would like the master to be able to communicate with each slave asynchronously. To my novice eye, Javelin Websockets looks like a nice lightweight solution to implementing SSL connections for it.
I'm currently struggling a little with it as all of the examples I've found so far are for Javascript in a web page talking to a server. Which isn't really what I'm trying to achieve. I want a persistent connection where each Java application can asynchronously send messages either way.
Before I end up wasting time I was wondering if anyone could tell me if what I want to do is possible, and if so, are they able to point me at any code examples that use a Java application on each end, rather than a web page talking to a backend?
Thanks for any help.
Brad
Yes, two Java applications can talk over Javalin WebSockets. From the perspective of a web server it doesn't matter if the WebSocket client is Java based or JavaScript/Browser based. Javalin itself uses https://github.com/TooTallNate/Java-WebSocket for WebSocket integration testing.

MSMQ access from mainframe? REST API maybe?

I need to put and get messages to/from our remote MSMQ, but because we will do the put s from our mainframe, we need a way that can be implemented in COBOL(or PL/1 maybe). My questions are;
1) Is it possible to enable HTTP GET/POST requests to put/get messages without WCF implementations? That is, we need to be simply able to make requests as in
http://our_server:port/msmq/queue1?operation=put&message=test_message&...
2) Is there any other way to access and put messages into MSMQ from mainframe?
Any suggestions will be appreciated
Thanks in advance
EDIT
I think I couldn' t tell what I want exactly. I have data on mainframe and I want to put these data into a MSMQ which is running on a Windows machine. IBM WebsphereMQ has WebSphere MQ bridge for HTTP so that it accepts HTTP requests and puts the requests' payload into queue. Does MSMQ have such a feature?
Thanks again :)
You can use the EZAPI interface programs to manage the traffic natively in your COBOL programs or use one of the many variants of MSMQ to WebsphereMQ or JMS.
The EZAPI stuff will let you do the direct http puts, but you will need to manage it all.
Why not just hook the MSMQ into whatever queueing software you have on the mainframe and make it work the way it was intended?
If your mainframe applications are running in CICS, then HTTP client requests are just API calls. Where I work, we've been doing this in COBOL applications since 2006.

ways of making a communication between a webserver to a windows application in .NET

I need to find the most efficient way to communicate from an asp.net web server and a windows C++ application. The windows application does not have any permission to access the database of the asp.net web server.
When the user presses a button, that action with some bytes should be received by the C++ application.
In return, after processing the data on the C++ application, it will send back the result to the web server.
The only way I can think of at the moment is as following:
The asp.net web server will have two web service methods:
the C++ application will call that web service for a method for an interval. if there is a change, then the C++ application will process.
after the C++ application finished its process, it will call a method on that web service to inform about the result.
Any other ways to solve this kind of communication?
Thanks in advance.
If the C++ Application is also on Windows, named pipes would be a good solution. They can be configured to be durable so they can queue messages if either side is not ready to receive the message and they are quite easy to use. They basically look like files that you can read or write from and the data appears on the other side of the "pipe".
Take a look at the documentation (C++) here: http://msdn.microsoft.com/en-us/library/aa365781(v=VS.85).aspx
On the ASP.NET side you would use .NET API's. Here's a nice example to get you started: http://msdn.microsoft.com/en-us/library/bb546085.aspx (This example includes both client and server code.)
Named pipes would be a great solution if the C++ application is located in the same physical server as the ASP.NET application. In that case the OS would be just moving memory between processes for you so it could be very quick.
Additionally, I would configure the C++ Application as a Windows Service so it's always available and can be restarted when the server it's running on is restarted. If keeping it running is very important you could integrate Performance Counters and then have your ops team monitor the counters to make sure it is operating within expected thresholds.
The C++ application can also make a simple GET or POST request with enough information that the webserver can handle in case you don't want to expose a webservice.
You could use network sockets. It's been a long time since I have done anything with them so I can't be much help. Research Winsock (aka Windows Sockets API).
You could use WCF services and connect to them using your C++ client. You will have to research consuming WCF services from C++ client.
As #parapura suggested you could use simple HTTPRequest get & post methods. You could create your own http handler for these request to customize the response.
As you suggested you could use simple web services.

OPC Service Processing and Monitoring

I'm writing a windows service that will be used for some data processing. The service will connect to an OPC (KepWare) service and will monitor specific items through event handlers. It will also have to write back to the OPC data item when necessary; however, the data to be written back will have to come from a windows mobile handheld device.
I'm just getting perplexed on the design aspect of this system. I'm trying to make sure that I design this in an abstract manner in order to make it scalable and easily maintainable. However, I'm just stuck on how to communicate with the service in order to tell it write this value to the OPC server. I'm thinking WCF is the way to go but I'm not exactly sure how to write it where I can obtain a reference to my connected OPC object when the client makes the call? Should I be writing a WCF library and host it inside the windows service or should I be going down a different route?
Thanks in advance
You should read up on the fundamentals of OPC-DA and OPC-Xi (also known as OPC .NET 3.0). The OPC Foundation has simple documentation available for free: look for the "specifications" that are available to non-members.
The KepWare server should support both (depending on the KepWare server you are using). OPC Xi is WCF-based and will be the easiest way for you to talk to it. However, that particular communication channel needs to be open and enabled for it to work.
If you don't have that, then you need to fall back to OPC-DA which is DCOM based. You can find .NET OPC client libraries that will help you with this. There are some free and some commercial ones out there from different companies.

Tools for hacking Flex data connections

I'm in the process of building a test plan for validating the security of our Flex/J2EE application. I believe we have some issues with trusting the Flex application too much, but I need to be able to quantify those issues.
The ideal way would be a way to show me making data service calls outside of the application. Are there tools or instructions for how one might go about doing this? I really don't want to find these things out after we release to our beta customers. :)
Charles is an excellent HTTP debugging proxy which can parse AMF data and display it as a tree. You can also set "breakpoints" to intercept a HTTP call and modify the AMF data in either the request or response.
http://www.charlesproxy.com/
Fiddler on Windows is great for monitoring http connections.
First, give the port on which Flex communicates to the J2EE server, then using Ethereal or Wireshark you can watch if it use an encrypted channel :-)

Resources