cancel
Showing results for 
Search instead for 
Did you mean: 

JCA compliant raw socket adapter

Former Member
0 Kudos

Hi there,

does anyone know if there is a JCA compliant adapter that works with XI or can be made to work with XI?

to say it technically, what I want is an adapter that takes my message and sends it like that:


...
Socket s = new Socket("123.456.789.111", 7);
MyWriter out = new MyWriter(s.getOutputStream());
out.writeMessage("Some message.");
String str = in.getACKMessage();
 
...
...
public synchronized void writeMessage(String message) throws SomeException
    {
        myWriter.write(' ');
        myWriter.write(message);
        myWriter.write(' ' + "r");
        myWriter.flush();            
    }

and of course I need an according reader.

Doesn't sound to difficult but I can't find an example implementation.

regards,

anton

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Anton, If i understood right, if you intend to extract data from a XI message and write it a socket or read data from a socket server, you can do it with Java Proxies.

Or you can write the logic to read/write from/to a socket using Java Socket APIs, import them into XI as an Imported Archive and then call these methods. To parse XI message, you can use DOM or SAX parser APIs. May be, you can explore this option as well

Regards

Saravana

Former Member
0 Kudos

hi saravana,

thanks for your kind answer. I quickly had a look on the weblog you wrote on this issue and think this might be a feasible solution.

Being not too knowledged in XI practical issues what I do ask myself though is this: What do I loose implementing it the way you suggest in comparison to using/creating a 'full blown' socket adapter?

There is obviously some advantage to using the JCA over using Java provies like monitoring adapter status, coherent reusability, monitoring features, logging features, etc...

Basically what I think is that the HTTP adapter isn't much more like a raw socket adapter only imposing some restriction on the anatomy of the content, reading/writing some HTTP header fields and separating body from header in a standardized way. And I can customize it in a standardized way within XI, reuse it and see it in some monitors and logs.

Am I wrong with this?

anton

Answers (0)