|
|
|||
Bhakti Mehta's BlogCommunity: Java Web Services and XML ArchivesWorking with Metro on Glassfish v3 TP2Posted by bhaktimehta on May 12, 2008 at 12:56 PM | Permalink | Comments (5)Glassfish v3 will be the next major release of the GlassFish application server. The focus of the release is modularization, enablement of non Java EE containers and embedability. GlassFish v3 builds on the strength of GlassFish v2 but takes a completely new approach, providing a highly modular, lightweight, extensible architecture. GlassFish v3 Technology Preview 2 (TP2) is a milestone release of the GlassFish v3 Application Server. You can find the TP2 glassfish preview bundle here. This page provides a brief description of TP2, and points to the information you need to get started. Here is the information on what is part of TP2 Metro will be available as an Update Center module in V3 as part of the TP2 This is a preliminary guide on how to work with Metro in the current development v3 builds. Note: This can be subjected to change in future. Steps to install and run v3. 1. Unzip gfv3-preview2.zip downloaded from here.This is the web distribution for v3 and does not have support for EJBs. For TP2 we will only support JAXWS deployment ie.webservices with webapps whose versions are 2.3 or 2.4. Support for JSR 109 based services is in progress and will be available after TP2. 2. Run glassfish-v3tp2/bin/updatetool.batYou get a prompt like this The software needed for this command (updatetool.bat) is not installed.It downloads the necessary files Platform: windows-i386 This installs the UpdateCenter 3.Run glassfish-v3tp2/bin/updatetool.bat again 4. Select Metro Web Services Stack and click installThis will copy webservices-rt.jar, webservices-tools.jar,webservices-api.jar and jsr109-impl.jar to glassfishv3-tp2/glassfish/modules folder. Next you can start the GF using glassfishv3-tp2/glassfish/bin/asadmin start-domain domain1 5. Deploy your war like thisYou can try metro samples from https://metro.dev.java.net/ Please give us feedback if this works for you . You can file your bugs under https://glassfish.dev.java.net/issues/ category webservices and version v3. Additional Information Project Metro V3 Engineers Guide V3 Build Instructions Developing Webservices from wsdl using NetbeansPosted by bhaktimehta on March 05, 2008 at 11:31 AM | Permalink | Comments (5)The following blog shows how you can easily create a Webservices project in Glassfish v2 using Netbeans 6.0 from an existing wsdl. Download Netbeans 6.0 from here To Start Select File->Create new Project->Web ![]() Click on finish Next Right Click on WebServiceFromWsdl project and select new WebService from wsdl Here is the wsdl and its schema for this blog Here is how the screen looks like ![]() Click on finish This is how the generated WebService Design tab looks like
You can implement the methods for the service by selecting the Source tab Right Click on the WebServiceFromWsdl project and call Run You will see the project deployed in GF You can verify by clicking on http://localhost:8080/WebServiceFromWsdl/RMDemoService?wsdl This is how the published wsdl will look like ![]() Deploying SOAP 1.2 based webservice in GlassfishPosted by bhaktimehta on January 29, 2008 at 02:15 PM | Permalink | Comments (6)The following blog shows how to create and deploy a SOAP 1.2 based webservice in Glassfish v2 using Netbeans 6.0 Download and install Netbeans 6.0 from here. Click on File->New Project Choose Web ->WebApplication ![]() Next provide the name of the Web application
Click on Finish Next in the Projects tab you will see EchoTest Click Finish Next we add operations to the service Click the source tab in the center pane you will see the Echo.java
source code Add the following operation to the source code (This can be done by
right clicking Webservices->EchoService->AddOperation) /**
This is how the source code looks
Right Click on EchoTest project Next step build a client File -> New Project -> Web Application (Same as fig 1) Name the project as EchoClient
Click Finish Specify the wsdllocation as shown Click Finish Next expand EchoClientTest->WebServiceReferences->EchoService->EchoService->EchoPort->echoString
Drag echoString and drop after line <h2> This is how the jsp will look
Next Right click and call Run the EchoClientTest This is what you see when you call
http://localhost:8080/EchoClientTest/ Hello World!Result = hello John Doe Advanced Tip If you want to see the soap messages add the following line in GF/domains/domain1/confiig/domain.xml in java-config element <jvm-options>-Dcom.sun.xml.ws.assembler.server=true</jvm-options> Then stop the GF server and restart it Next call http://localhost:8080/EchoClientTest/ You can see the following messages in GF/domains/domain1/logs/server.log Request <?xml version="1.0" ?> Response
Overview of Web Services Reliable MessagingPosted by bhaktimehta on March 31, 2006 at 01:08 PM | Permalink | Comments (0)Consequently, messages can be lost or delivered out of order. Web Services Reliable Messaging (WS RM) provides a mechanism to ensure a layer of reliability between potentially unreliable or intermittently connected networks. It provides an interoperable protocol that a RM (Reliable Messaging) Source and RM Destination use to provide Application Source and Destination a guarantee that the message that is sent will be delivered. This guarantee is known as delivery assurance. There are four basic delivery assurances that endpoints can provide AtMostOnce: Messages will be delivered at most once without duplication . It is possible some messages in a sequence may not be delivered. AtLeastOnce: Every message sent will be delivered. Some messages may be delivered more than once. ExactlyOnce : Every message sent will be delivered without duplication. InOrder: Messages will be delivered in the order that they were sent.
will provide configurable settings to easily enable RM in endpoints as shown in the screen shot below. ![]() Fig 1 Screenshot of how to configure WS RM for an endpoint using Netbeans Programming Model for Tango
![]() Fig 2 Message exchange when RM is enabled using WS RM implementation The above figure shows how the Client or Application Source sends a message for reliable delivery. When RM is enabled, Project Tango's RM Source module is plugged into the JAX-WS remoting system. The RM Source module keeps copies of messages until their receipt is acknowledged (via the exchange of protocol messages). Similarly, an RM Destination module acknowledges messages (and may buffer them for order guarantees). After guaranteeing order (if ordering enabled), the RM Destination allows the message to proceed through the JAX-WS dispatch for delivery to the Endpoint or Application Destination. Protocol Messages ![]() Fig 3 Possible application and protocol message exchanges between RM endpoints The above figure shows how the message exchange takes place between two reliable messaging endpoints once the initial preconditions are established such as resolving endpoint references, policy exchange and establishing trust.
Availability The implementation will be available by JavaOne on Java.net with support for Glassfish and Netbeans IDE. Plugfest Status We tested our WS RM implementation with Microsofts WCF at the Plugfest on March 7-9 at Redmond. We successfully interoperated in the ReliableOneWay and ReliableRoundrip scenarios both as clients and endpoints. JavaOne 2006 For more information be sure to check out the session on Reliable and Transacted Web Services between Java™ Technology-Based Project Tango and Microsoft Indigo TS-1603. Other information WS-ReliableMessaging specification WS-RM Policy Assertion JAXB 2.0 and JAX-WS 2.0 are a part of Mustang (JDK 6.0)Posted by bhaktimehta on August 08, 2005 at 04:18 PM | Permalink | Comments (2)Delivering Web Services is one of the primary themes for Mustang (Java SE 6). Our goal is that JSE will provide reasonable support for ease of development for the web services stack. This will primarily be client-side focused with a lightweight server to support callbacks. The main specifications are the Java Architecture for XML-Web Services (JAX-WS) 2.0 (formerly known as JAX-RPC) and Java Architecture for XML Binding (JAXB) 2.0. JSR 224 is defining JAX-WS 2.0. This is a major update since the JAX-RPC 1.0 specification incorporating new specifications and updates to existing standards. JAX-WS 2.0 now delegates the databinding related tasks to JAXB 2.0. JSR 222 is defining JAXB 2.0. It adds significantly to JAXB 1.0, including 100% XML schema support, the binding of Java classes to XML schema, the meeting of data binding requirements for JAX-WS 2.0, and schema evolution support. A flexible binding allows an application to bind only parts of an XML document (relevant to the application) to Java. Mustang has the webservices features integrated as of b40. You can try the latest snapshot from https://mustang.dev.java.net/ We are fixing and integrating bugs on a regular basis. Please let us know about your bugs, you can file them at There are 4 new scripts added in the jdk6.0/bin which are as follows xjc, schemagen , wsimport and wsgen /path/to/jdk6.0/bin/xjc foo.xsd -p test.foo Similarly to invoke the schema generator to generate schemas from Java sources /path/to/jdk6.0/bin/schemagen Foo.java To generate portable artifacts from wsdls and external jaxws or jaxb binding files you can use wsimport /path/to/jdk6.0/bin/wsimport stock.wsdl -b stock.xml -b stock.xjb To generate portable artifacts from Java sources you can use wsgen /path/to/jdk6.0/bin/wsgen example.Stock Javadocs for jdk6.0 Forums List of Committed bugs in the latest snapshot release More information on JAXB and JAXWS | |||
|
|