|
|
||
Doug Kohlert's BlogApril 2005 ArchivesJAX-RPC 2.0 EAPosted by kohlert on April 26, 2005 at 05:43 PM | Permalink | Comments (0)The JAX-RPC 2.0 SI has been re-architectured since 1.1. The new architecture will make it easier to add new capabilities in the future. The new architecture allows for: Multiple Transports - EA currently supports HTTP Multiple Encodings - EA supports XML as text. - The next EA will include MTOM/XOP and Fast Infoset Multiple Protocols - EA supports SOAP 1.1 - The next EA will include SOAP 1.2 The next EA due out before JavaOne will also have a dynamic runtime. This means no more stubs/ties, serializers, deserializers etc. All artifacts generated by the JAX-RPC SI will be 100% portable to other JAX-RPC 2.0 implementations. I will blog about this again when the next release is available. Arun Gupta has blogged about how the current JAX-RPC 2.0 EA can be deployed ontop of JWSDP 1.5. You can read his blog at: JAX-RPC 2.0 EA on JWSDP 1.5
You can dowload the current EA at: here.
JAX-RPC 2.0 Standard Implementation Early AccessPosted by kohlert on April 07, 2005 at 06:05 PM | Permalink | Comments (0)The JAX-RPC 2.0 Standard Implementation Early Access has just been released to the JAX-RPC project and you can download it here. I would like to highlight some of the new features available in this release here.
JAXB data binding You can access the standalone early access of JAXB 2.0 at the JAXB Project on Java.net.
Metadata
@WebService(targetNamespace="http://duke.org", name="AddNumbers")
@SOAPBinding(style=SOAPBinding.Style.RPC, use=SOAPBinding.Use.LITERAL)
public class AddNumbers {
@WebMethod(operationName="add", action="urn:addNumbers")
@WebResult(name="return")
public int addNumbers(
@WebParam(name="num0")int number1,
@WebParam(name="num1")int number2) throws RemoteException, AddNumbersException {
if (number1 < 0 || number2 < 0) {
throw new AddNumbersException("Negative number cant be added!",
"Numbers: " + number1 + ", " + number2);
}
return number1 + number2;
}
}
JAXB 2.0 also defines a number of annotations that can be used to customize the mapping of Java types to XML Schema.
Customizations
Improved Handler Framework Handler chains can now be configured on a per-port, per-protocol, or per-service basis.
Dynamic Client
Dynamic Server
Asynchronous Clients
private void invokeSynchronous() throws RemoteException{
int number1 = 10;
int number2 = 20;
System.out.println("\nInvoking synchronous addNumber():");
int result = port.addNumbers(number1, number2);
System.out.printf("The result of adding %d and %d is %d\n", number1, number2, result);
}
Here is the same operation invoke asynchronously using polling.
private void invokeAsyncPoll() throws InterruptedException, ExecutionException{
int number1 = 10;
int number2 = 20;
System.out.println("\nInvoking Asynchronous Polling addNumbersAsync():");
javax.xml.rpc.Response
And here it is using the the callback mechanism.
private void invokeAsyncCallback() throws InterruptedException{
int number1 = 10;
int number2 = 20;
System.out.println("\nInvoking Asynchronous Callback addNumbersAsync():");
AddNumbersCallbackHandler callbackHandler = new AddNumbersCallbackHandler();
Future> response = port.addNumbersAsync(number1, number2, callbackHandler);
Thread.sleep(2000);
AddNumbersResponse output = callbackHandler.getResponse();
System.out.printf("The result of adding %d and %d is %d\n", number1, number2, output.getReturn());
}
Please send feedback to the JAXB 2.0 and JAX-RPC 2.0 forum
| ||
|
|