Today, MetaService-java hit Jolie's SVN. You can find it in /trunk/support/metaservice-java. Basically, MetaService-java is a Java API abstraction layer for interacting with MetaService, so that you can use it as if it were a Java object.
This project was born for two reasons:
- it will be part of a solution for the integration of Java enterprise web applications with Service-Oriented Computing;
- it is a good example of how to implement an API abstraction layer to MetaService from an Object-oriented language, so its source code could be a useful reading for the Plasma::Service developers.
I'll let the code (and its comments) and a simple example speak for themselves. They're in Java, but they should be pretty easy to understand even for people non-proficient with it. Example follows.
MetaService metaService = new EmbeddedMetaService(); // Create a MetaService instance.
// Set up access to a SOAP Web Service.
MetaServiceChannel myWebService = metaService.addRedirection(
"MyWebService", // Resource name to assign
"socket://www.mywebservice.com:80/", // Service location
Value.create( "soap" ), // Protocol to use
Value.create( "My metadata" ) // Descriptive metadata
);
// Done! Let's communicate with it.
myWebService.send( "getNameById", Value.create( 4 ) );
Value response = myWebService.recv();
System.out.println( response.strValue() ); // Will print the name.
The API is still to be refined, but pretty much usable already. =)
Friday, October 10, 2008
Thursday, October 2, 2008
Local socket support in JOLIE
This fall looks good so far! A lot of JOLIE sub-projects are taking shape, and are going better than anticipated. But I'm blogging about something which has just landed on JOLIE's svn.
JOLIE now supports local sockets (a.k.a. unix sockets). How to use them? Let's see it by comparison; a communication interface over tcp/ip sockets is exposed like the following:
Let's switch that to a local socket:
That's it! Use the localsocket scheme in the Location URI, and supply the right path to it.
JOLIE now supports local sockets (a.k.a. unix sockets). How to use them? Let's see it by comparison; a communication interface over tcp/ip sockets is exposed like the following:
inputPort MyInputPort {
Location: "socket://localhost:9000"
Protocol: soap
Interfaces: MyInterface
}Let's switch that to a local socket:
inputPort MyInputPort {
Location: "localsocket:/tmp/mylocalsocket"
Protocol: soap
Interfaces: MyInterface
}That's it! Use the localsocket scheme in the Location URI, and supply the right path to it.
Subscribe to:
Posts (Atom)
