<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Bhakti Mehta&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/" />
<modified>2008-05-12T21:11:06Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/bhaktimehta/275</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, bhaktimehta</copyright>
<entry>
<title>Working with Metro on Glassfish v3 TP2</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2008/05/working_with_me.html" />
<modified>2008-05-12T21:11:06Z</modified>
<issued>2008-05-12T20:56:19Z</issued>
<id>tag:weblogs.java.net,2008:/blog/bhaktimehta/275.9785</id>
<created>2008-05-12T20:56:19Z</created>
<summary type="text/plain">Glassfish v3  will be the next major release of the GlassFish application server. GlassFish v3 Technology Preview 2 (TP2) is a milestone release of the GlassFish v3 Application Server. 
Metro will be available as an  Update Center module in V3 as part of the TP2. The following blog shoes how to work with Metro on V3</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>
<br>
<a href="glassfish.dev.java.net">Glassfish v3&nbsp;</a> will be the
next major release of the GlassFish
application server. The focus of the release is modularization,
enablement of non Java EE containers<br>
and embedability. GlassFish v3 builds on the strength of GlassFish v2
but takes a
completely
new approach, providing a highly modular, lightweight, extensible
architecture.<br>
<br>
GlassFish v3 Technology Preview 2 (TP2) is a milestone release
of the GlassFish v3 Application Server. You can find the TP2 glassfish
preview bundle <a
 href="https://glassfish.dev.java.net/downloads/v3-techPreview-2.html">here</a>.<br>
This page
provides a brief description of TP2, and points
to the information you need to get started. <a
 href="http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishV3TP2Content">Here</a>
is the information on what is part of TP2<br>
<br>
<a href="https://metro.dev.java.net/">Metro</a> will be available as
an&nbsp; Update Center module in V3 as part
of the TP2<br>
<br>
This is a preliminary guide on how to work with Metro in the current
development v3 builds.<br>
Note: This can be subjected to change in future.<br>
<br>
<span style="font-weight: bold;">Steps to install and run v3</span>. <br>
<br>
<pre>1. Unzip gfv3-preview2.zip downloaded from  <a
 href="https://glassfish.dev.java.net/downloads/v3-techPreview-2.html">here</a>.<br></pre>
&nbsp;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 <br>whose versions are 2.3 or 2.4. Support for<br>
JSR 109 based services is in progress and will be available after TP2.<br><br>
<pre>2. Run glassfish-v3tp2/bin/updatetool.bat <br></pre>
You get a prompt like this<br><br>
<pre>The software needed for this command (updatetool.bat) is not installed.<br>Press any key to install the necessary software, or Ctrl-C to quit.<br>After software installation is completed you may re-run this command.<br><br>Press any key to continue . . .<br><br></pre>
It downloads the necessary files<br><br>
<pre>Platform: windows-i386<br>Software repository: http://pkg.glassfish.org/dev/windows/gf3000_2000/<br>Installing pkg packages...<br>Installing: python2.4-minimal@2.4.4,0-6.564:20080425T194712Z<br>python2.4-minimal@2.4.4,0-6.564:20080425T194712Z: manifest file doesn't exist ye<br>t, fetching from server<br>python2.4-minimal@2.4.4,0-6.564:20080425T194712Z: downloading files.............<br>................................................................................<br>..........................................................................<br>python2.4-minimal@2.4.4,0-6.564:20080425T194712Z: installing files...<br>Installing: pkg@0.1.4,0-6.564:20080425T194710Z<br>pkg@0.1.4,0-6.564:20080425T194710Z: manifest file doesn't exist yet, fetching fr<br>om server<br>pkg@0.1.4,0-6.564:20080425T194710Z: downloading files...........................<br>........................................<br>pkg@0.1.4,0-6.564:20080425T194710Z: installing files...<br>Installing updatetool packages...<br>Installing: wxpython2.8-minimal@2.8.7.1,0-6.564:20080425T194728Z<br>wxpython2.8-minimal@2.8.7.1,0-6.564:20080425T194728Z: manifest file doesn't exis<br>t yet, fetching from server<br>wxpython2.8-minimal@2.8.7.1,0-6.564:20080425T194728Z: downloading files.........<br>.............................................................<br>Installing: updatetool@2.0,0-6.564:20080425T194726Z<br>updatetool@2.0,0-6.564:20080425T194726Z: manifest file doesn't exist yet, fetch<br>ng from server<br>updatetool@2.0,0-6.564:20080425T194726Z: downloading files.....................<br>................................................................<br>updatetool@2.0,0-6.564:20080425T194726Z: installing files...<br>Update Center initialization complete.</pre> <br><br>
This installs the UpdateCenter <br><br>
<pre>3.Run glassfish-v3tp2/bin/updatetool.bat again <br>and that brings up the gui like this<br>click on the Available Add-ons</pre><br><br><br><img alt="update-center.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/update-center.jpg" width="850" height="550" /> <br><br>

<pre>4. Select Metro Web Services Stack and click install<br></pre>
This will copy webservices-rt.jar,
webservices-tools.jar,webservices-api.jar and jsr109-impl.jar to <br>
glassfishv3-tp2/glassfish/modules folder. Next you can start the GF
using<br>
<pre>glassfishv3-tp2/glassfish/bin/asadmin start-domain domain1</pre><br>
<pre>5. Deploy your war like this <br>glassfishv3-tp2/glassfish/bin/asadmin deploy foo.war<br><br></pre>
You can try metro samples from <a href="https://metro.dev.java.net/">https://metro.dev.java.net/</a><br>
Please give us feedback if this works for you .&nbsp; You can file your
bugs under <a href="https://glassfish.dev.java.net/issues/">https://glassfish.dev.java.net/issues/</a>
category webservices and version v3.<br>
<br>
<span style="font-weight: bold;">Additional Information<br>
</span><a href="http://metro.dev.java.net">Project Metro</a><br>
<br>
<a href="http://wiki.glassfish.java.net/Wiki.jsp?page=V3EngineersGuide">V3
Engineers Guide</a><br>
<br>
<a
 href="http://wiki.glassfish.java.net/Wiki.jsp?page=V3FullBuildInstructions">V3
Build Instructions</a><br>
<br>
<br>
<br>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>Techtip on using WebServiceRefs</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2008/03/techtip_on_usin.html" />
<modified>2008-03-14T19:18:06Z</modified>
<issued>2008-03-14T19:12:09Z</issued>
<id>tag:weblogs.java.net,2008:/blog/bhaktimehta/275.9365</id>
<created>2008-03-14T19:12:09Z</created>
<summary type="text/plain">This is techtip on Referencing multiple webservices using application client</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[A tip on Referencing Multiple Web Services from an application client is available as an Enterprise Java Techtip <a href="http://blogs.sun.com/enterprisetechtips/entry/referencing_multiple_web_services_from">here</a>
<p>You can find more Enterprise Java Technical Tips that are posted every month at <a href="http://blogs.sun.com/enterprisetechtips/">http://blogs.sun.com/enterprisetechtips/ </a>.<p> In this tip, I talk about how you can build EJB and Servlet based webservices and use @WebServiceRefs to reference them in your application client.<p>

For more questions you can write to users@metro.dev.java.net]]>

</content>
</entry>
<entry>
<title>Developing Webservices from wsdl using Netbeans</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2008/03/developing_webs_1.html" />
<modified>2008-05-12T21:05:22Z</modified>
<issued>2008-03-05T19:31:18Z</issued>
<id>tag:weblogs.java.net,2008:/blog/bhaktimehta/275.9316</id>
<created>2008-03-05T19:31:18Z</created>
<summary type="text/plain">The following blog shows how you can easily create a Webservices
project in Netbeans from an existing wsdl.</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>
The following blog shows how you can easily create a Webservices
project in <a href="http://glassfish.dev.java.net">Glassfish v2</a> using <a href="http://www.netbeans.org">Netbeans 6.0</a> from an existing wsdl. <br>
Download Netbeans 6.0 from <a href="http://download.netbeans.org/netbeans/6.0/final/">here</a>
<br>To Start <br>
Select File-&gt;Create new Project-&gt;Web<br>
<br>
<img src="newwsfromwsdl.jpg" title="" 
 style="width: 725px; height: 520px;"><br>

Click on finish<br>
<br>
Next Right Click on WebServiceFromWsdl&nbsp; project and select new
WebService from wsdl<br>
Here is the <a
 href="http://weblogs.java.net/blog/bhaktimehta/archive/RMDemo.wsdl">wsdl</a>
and its <a
 href="http://weblogs.java.net/blog/bhaktimehta/archive/RMDemo.xsd">schema</a>
for this blog<br>
<br>
Here is how the screen looks like<br>
<img alt="selectwsdl.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/selectwsdl.jpg"
 width="728" height="649"><br>
<br>
Click on finish<br>
<br>
This is how the generated WebService Design tab looks like<br>
<img alt="design tab.jpg"
src="http://weblogs.java.net/blog/bhaktimehta/archive/design tab.jpg"
width="900" height="630" /&gt;<br>
<br>
You can implement the methods for the service by selecting the Source
tab<br>
<br>
<br>
Right Click on the WebServiceFromWsdl&nbsp; project and call Run<br>
You will see the project deployed in GF <br>
<br>
You can verify by clicking on
http://localhost:8080/WebServiceFromWsdl/RMDemoService?wsdl<br>
This is how the published wsdl will look like<br>
<br>
<img alt="publishwsdl.jpg"
 src="http://weblogs.java.net/blog/bhaktimehta/archive/publishwsdl.jpg"
 width="1665" height="797"><br>
<br>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>Deploying SOAP 1.2 based webservice in Glassfish</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2008/01/deploying_soap_1.html" />
<modified>2008-01-29T22:20:49Z</modified>
<issued>2008-01-29T22:15:49Z</issued>
<id>tag:weblogs.java.net,2008:/blog/bhaktimehta/275.9091</id>
<created>2008-01-29T22:15:49Z</created>
<summary type="text/plain">This blog shows how to create,deploy SOAP 1.2 based services in Glassfish </summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>

<br>
The following blog shows how to create and deploy a SOAP 1.2 based
webservice in <a href="http://glassfish.dev.java.net">Glassfish v2</a>
using <a href="http://www.netbeans.org/">Netbeans
6.0</a><br>
<br>
Download and install Netbeans 6.0 from <a
 href="http://download.netbeans.org/netbeans/6.0/final/">here.</a><br>
<br>
Click on File-&gt;New Project<br>
Choose Web -&gt;WebApplication<br>
<br>
<br>
<img alt="newProject.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/newProject.jpg" width="726" height="522" /><br>
<br>
<p> Next provide the name of the Web application  <br>
choose the Java EE version as Java EE 5 <br>
</p>
<p>
<br>
<img alt="projectName.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/projectName.jpg" width="725" height="519" />
<br>
</p>
<p>Click on Finish<br>
</p>
<p>Next in the Projects tab you will see EchoTest<br>
Right Click on EchoTest and create New WebService<br><br>
<img alt="newWebService.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/newWebService.jpg" width="727" height="566" />
<br>
</p>
<p>Click Finish<br>
</p>
<p>Next we add operations to the service<br>
</p>
<p>Click the source tab in the center pane you will see the Echo.java
source code<br>
</p>
<p>Add the following operation to the source code (This can be done by
right clicking Webservices-&gt;EchoService-&gt;AddOperation)<br>
</p>
<p>&nbsp; /**<br>
&nbsp;&nbsp;&nbsp;&nbsp; * Web service operation<br>
&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp;&nbsp; @WebMethod(operationName = "echoString")<br>
&nbsp;&nbsp;&nbsp; public String echoString(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@WebParam(name = "parameter") String parameter) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return "hello" + parameter;<br>
&nbsp;&nbsp;&nbsp; }</p>
<p><br>
Add the following annotation<br>
<span style="font-weight: bold;">@javax.xml.ws.BindingType(value="http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/"&nbsp;&nbsp;&nbsp;
)<br>
</span>The above is important because the default binding supported by
JAXWS 2.0 is SOAP 1.1 over HTTP. <br>
</p>
<p>This is how the source code looks<br>
</p>
<p><img alt="sourcecode.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/sourcecode.jpg" width="1015" height="700" />
<br>
</p>
<p>Right Click on EchoTest project<br>
Do Clean and Build<br>
Do Undeploy and Deploy<br>
You will see the service is deployed at <br>
http://localhost:8080/EchoTest/EchoService?wsdl<br>
</p>
<p><span style="font-weight: bold;">Next&nbsp; step build a client</span><br>
</p>
<p>File -&gt; New Project -&gt; Web Application (Same as fig 1)<br>
</p>
<p>Name the project as EchoClient <br>
</p>
<br>
<p><img alt="echoclienttest.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/echoclienttest.jpg" width="722" height="520" />
<br>
</p>
<p>Click Finish<br>
Right click on EchoClientTest and click New Webservice Client<br>
</p>
<p>Specify the wsdllocation as shown<br>
<img alt="clientfromwsdl.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/clientfromwsdl.jpg" width="778" height="446" />
<br>
</p>
<p>Click Finish</p>
<p>Next expand&nbsp;
EchoClientTest-&gt;WebServiceReferences-&gt;EchoService-&gt;EchoService-&gt;EchoPort-&gt;echoString</p>
<p><br><img alt="expandwebservicerefs.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/expandwebservicerefs.jpg" width="1331" height="702" /><br>
</p>
<p>Drag echoString and drop after line &lt;h2&gt;<br>
</p>
<p>This is how the jsp will look<br>
</p>
<p><br>
<img alt="client.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/client.jpg" width="993" height="684" />
<br>
</p>
<p>Next Right click and call Run the EchoClientTest<br>
</p>
<p>This is what you see when you call
http://localhost:8080/EchoClientTest/<br>
</p>
<h2>Hello World!</h2>
<hr> Result = hello John Doe<br>
<br>
<br>
<span style="font-weight: bold;">Advanced Tip</span><br>
If you want to see the soap messages add the following line<br>
in <br>
GF/domains/domain1/confiig/domain.xml in java-config element<br>
&nbsp;
&lt;jvm-options&gt;-Dcom.sun.xml.ws.assembler.server=true&lt;/jvm-options&gt;<br>
<br>
Then stop the GF server and restart it<br>
<br>
Next call http://localhost:8080/EchoClientTest/<br>
You can see the following messages in GF/domains/domain1/logs/server.log<br>
Request<br>
<br>
<pre>
&lt;?xml version="1.0" ?&gt;<br>
&lt;S:Envelope xmlns:S=<span style="color: rgb(51, 51, 255);">"http://www.w3.org/2003/05/soap-envelope"</span>&gt;<br>
&nbsp; &lt;S:Body&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;ns2:echoString xmlns:ns2="http://test/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;parameter&gt; John
Doe&lt;/parameter&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/ns2:echoString&gt;<br>
&nbsp; &lt;/S:Body&gt;<br>
&lt;/S:Envelope&gt;<br>
</pre>
<br>
Response<br>
<pre>
<p>&lt;?xml version="1.0" ?&gt;<br>
&lt;S:Envelope xmlns:S=<span style="color: rgb(51, 51, 255);">"http://www.w3.org/2003/05/soap-envelope"</span>&gt;<br>
&nbsp; &lt;S:Body&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;ns2:echoStringResponse xmlns:ns2="http://test/"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;return&gt;hello John
Doe&lt;/return&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/ns2:echoStringResponse&gt;<br>
&nbsp; &lt;/S:Body&gt;<br>
&lt;/S:Envelope&gt;<br>
]<br>
</pre>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</body>]]>

</content>
</entry>
<entry>
<title>Rehash of WS Reliable Messaging (WS-RM)  in  Metro 1.0 and what&apos;s next</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/09/rehash_of_ws_re_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-09-18T18:59:29Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.8269</id>
<created>2007-09-18T18:59:29Z</created>
<summary type="text/plain">Project Tango (aka WSIT - Web Services Interoperability Technology) is now FCS (First Customer Shipment)! Tango provides the .NET 3.0 interoperability features (i.e., security, reliability, transactions) built into the Metro Web Services stack. Besides including Tango, Metro includes the core JAX-WS platform and JAXB.</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>

&nbsp;<a href="https://metro.dev.java.net/">Project Metro</a> is a new
name&nbsp; for the JAX-WS + Project Tango combination. <a
 href="http://jax-ws.dev.java.net/">JAX-WS</a> is the standardized web
services stack<br>
and <a href="https://wsit.dev.java.net/">Project Tango</a>
is the&nbsp; <a href="http://sun.com/">Sun's</a> <a
 href="http://java.sun.com/webservices/">Java
Web Services</a>
interoperability project with<br>
<a href="http://microsoft.com/">Microsoft's</a>
<a href="http://windowscommunication.net/">Windows Communication
Foundation</a>
(WCF). <br>
<br>
Project Metro is <a
 href="http://weblogs.java.net/blog/haroldcarr/archive/2007/09/tango_fcs_metro.html">released</a>
and so is the&nbsp; release of &nbsp; <a
 href="https://glassfish.dev.java.net//downloads/v2-b58g.html">GlassFish
V2 FCS (b58g)</a>.&nbsp;
<br>
GlassFish V2 Embeds the Metro 1.0 Stack within it thereby making
WebServices functionality directly<br>
&nbsp;usable from GlassFish (without the
need for any extra downloads or installations).<br>
<br>
WebServices Reliable
Messaging (WS-RM)&nbsp; is one of the enterprise features in&nbsp;
<a href="https://metro.dev.java.net/">Project Metro</a>. <br>
Now we shall have a brief rehash of&nbsp; WS-RM&nbsp; in Metro 1.0 and
what
would be the new<br>
features in upcoming releases <br>
<br>
<span style="font-weight: bold;">WS Reliable Messaging in Metro 1.0<br>
</span>WS-RM 1.0 is based on the following standards<br>
<ul>
  <li><a
 href="http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf">WS-ReliableMessaging
specification</a></li>
  <li><a href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">WS-RM
Policy Assertion</a></li>
</ul>
The programming model when developing&nbsp; webservices applications
with Metro is the same old JAXWS Programming Model and
<br>
nothing new is required to be learned.&nbsp; <br>
<br>
Adding WS-RM, Security and other Quality of Service features to
the&nbsp;
JAXWS webservice is enabled <br>
via configuration files which can be handwritten or easily edited by
Netbeans.<br>
WS-RM is enabled in
endpoints by the presence of <a
 href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">RM
policy assertions</a> in the WSDL.&nbsp;<a
 href="http://www.netbeans.org/">Netbeans
IDE</a> will&nbsp; provide
<br>
configurable settings to easily enable RM in endpoints.<br>
<br>
Here is a brief <a
 href="http://weblogs.java.net/blog/bhaktimehta/archive/2006/03/index.html">overview</a>
of WS-RM. The <a
 href="https://wsit-docs.dev.java.net/releases/m6/index.html">tutorial</a>
provides detailed instructions on how to work with Metro.<br>
This is a&nbsp; <a
 href="http://blogs.sun.com/arungupta/entry/screencast_ws3_reliable_and_interoperable">screen
cast </a>which show how to easily enable WS-RM when working with
Netbeans. For more information ,<br>
instructions on how to use Netbeans with GF are also available <a
 href="https://wsit-docs.dev.java.net/releases/m6/install.html">here. </a><br>
<br>
<span style="font-weight: bold;">Future plans for WS Reliable Messaging
1.1</span><br>
<ul>
  <li><a
 href="http://docs.oasis-open.org/ws-rx/wsrmp/200702/wsrmp-1.1-spec-cs-01.pdf">Web
Services ReliableMessaging Policy Assertion (WS-RM policy ver 1.1)</a></li>
  <li><a
 href="http://docs.oasis-open.org/ws-rx/wsrm/200702/wsrm-1.1-spec-cs-01.pdf">Web
Services Reliable Messaging ver 1.1</a></li>
</ul>
We have started working on these features on our trunk and you can get
the latest nightly and try out and give us feedback at  <a href="mailto:users@metro.dev.java.net">
   users@metro.dev.java.net</a> .<br>
<br>
<br>
<pre wrap=""><br></pre>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>Resolving  Non RM Request or Missing wsa:Action header error</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/08/resolving_non_r.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-08-24T21:57:40Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.8105</id>
<created>2007-08-24T21:57:40Z</created>
<summary type="text/plain">We have been getting bug reports where users run into the following error when interoperating with MS &quot;Non RM Request or Missing
wsa:Action header&quot;. This is how you workaround this issue
</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>

We have been getting bug reports where users run into the following
error when interoperating with MS. <br><br>
<pre>&lt;message&gt;com.sun.xml.ws.rm.RMException: WSRM3018: Non RM Request or Missing<br>wsa:Action header&lt;/message&gt;<br><br></pre>
This is a case where we are trying MS client -&gt; Sun
endpoint which is written beginning from Java and which has WS Reliable Messaging <br>(WS RM) enabled.
This is related to issue <a
 href="https://wsit.dev.java.net/issues/show_bug.cgi?id=487">487.</a><span
 style="text-decoration: underline;"> <br>
</span>Here is how&nbsp; you can&nbsp; workaround this issue.<br><code
 class="cCode"><a
 href="https://wsit.dev.java.net/source/browse/*checkout*/wsit/wsit/docs/howto/wsit-enabled-fromjava.zip."></a><br>
</code><br>
Consider you have a service like this<br>
<pre>@WebService
 public class MyFooImpl {&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;<span style="color: rgb(0, 0, 153);"> @WebMethod(action="doFoo")</span>
&nbsp;&nbsp;&nbsp; public int doFoo(int bar, int zot) {
&nbsp;    .....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>    }<br>}<br><br></pre>
Make sure&nbsp; you specifiy the action in @WebMethod annotation.
Without<br>
the action&nbsp; in the @WebMethod annotation, empty Action&nbsp;
appears in the<br>
application messages..<br>
&nbsp; <br>
For a complete running sample check the following sample in <code
 class="cCode"><a
 href="https://wsit.dev.java.net/source/browse/*checkout*/wsit/wsit/docs/howto/wsit-enabled-fromjava.zip.">wsit-enabled-fromjava
sample.</a><br>
<br>
</code>You need to set the AS_HOME to the installation of<a
 href="https://glassfish.dev.java.net/"> Glassfish v2.</a><br>
Call the following targets<br><br>
<pre>ant server
ant client run</pre>
<br>
This will show the demo with Sun client talking to Sun endpoint.
Next&nbsp; if you want to try the C# client<br>
Follow instuctions from&nbsp; <a
 href="https://wsit-docs.dev.java.net/releases/m5/WCFClient2.html">here.
</a>This shows you&nbsp; how to generate the artifacts using svcutil,
build the c# client and call Client.exe<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>WS-Reliable Messaging and Session Support (Part3)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/06/wsreliable_mess_2.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-06-07T18:23:05Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.7587</id>
<created>2007-06-07T18:23:05Z</created>
<summary type="text/plain">This is the third part of tri series blogs where in Part 1 we showed
one way of supporting sessions with WS Reliable Messaging. Mike showed in his blog WS Reliable Messaging and Session Support Part 2
what are the problems with this approach and we now
conclude with a third part where we have tried to fix some of these
problems</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>
This is the third part of tri series blogs where in Part 1 we showed
one way
of supporting sessions with<br>
WS Reliable Messaging. Mike showed in his <a
 href="http://weblogs.java.net/blog/mikeg/archive/2006/08/wsreliable_mess.html">blog</a>&nbsp;
WS Reliable Messaging and Session Support Part 2<br>
what are the
problems with this approach and we now
conclude with a third part where we have tried to fix some of these
problems .<br>
<br>
Sessions are unique
ids used to identify a client. They would help
maintain state for each client. <br>
In this sample you will see how
sessions can be supported with WS Reliable Messaging (WS RM) . <br>
WS
RM&nbsp; is one of the
enterprise features in Project <a
 href="http://weblogs.java.net/blog/haroldcarr/archive/2006/02/an_overview_of_1.html">Tango
</a>which is <a href="http://sun.com/">Sun's</a> <a
 href="http://java.sun.com/webservices/">Java Web Services</a>
<br>
interoperability project with <a href="http://microsoft.com/">Microsoft's</a>
<a href="http://windowscommunication.net/">Windows Communication
Foundation</a> (WCF).<br>
<br>
The following snippets of code show how the JAX-WS Endpoint
implementation which is RM enabled
<br>
supports sessions . <br>
<br>
This is the<a
 href="http://weblogs.java.net/blog/bhaktimehta/archive/RMDemo.wsdl">
wsdl</a> which shows RM is enabled in the endpoint by the presence of <a
 href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">WS-RM
Policy Assertions.</a><br>
Here is endpoint implementation class<br>
<pre style="background-color: rgb(204, 204, 204);">@WebService(endpointInterface="rmdemo.server.RMDemo")<br><br>public class RMDemoImpl {<br><br>....<br><br>}</pre>
<br>
<br>
As shown in part 1 JAX-WS uses annotations defined by Common
Annotations for the Java
Platform (<a href="http://www.jcp.org/en/jsr/detail?id=250">JSR 250</a>),<br>
to inject the Web ServiceContext and declare lifecycle methods. Web
ServiceContext holds the<br>
context
information pertaining to a request being served. With JAX-WS Web
Service all you need to do is <br>
mark a field or method
with @Resource.&nbsp; From the WebServiceContext,&nbsp; <a
 href="http://download.java.net/jdk6/docs/api/javax/xml/ws/handler/MessageContext.html">MessageContext</a>
pertaining <br>
to the the current request can be accessed. <br>
<br>
<pre style="background-color: rgb(204, 204, 204);">&nbsp;&nbsp;@Resource<br>&nbsp;&nbsp;private javax.xml.ws.WebServiceContext context;<br></pre>
<br>
As mentioned above WebServiceContext exposes&nbsp; the <a
 href="http://download.java.net/jdk6/docs/api/javax/xml/ws/handler/MessageContext.html">MessageContext</a>&nbsp;
for the request being served when this method is called .<br>
The session&nbsp;
is obtained from the MessageContext using a jax-ws property
"com.sun.xml.ws.session"<br>
<span style="font-weight: bold;"><br>
</span>
<pre style="background-color: rgb(204, 204, 204);">&nbsp; private Hashtable getSession() {<br>      return (Hashtable)context.getMessageContext()<br>                .get("com.sun.xml.ws.session");<br><br>   }<span
 style="font-weight: bold;"><br></span></pre>
<br>
The following getter&nbsp; method returns the String associated
with each request . <br>Correspondingly the setter method&nbsp; 
stores the Strings for each session in the
HashTable respectively.<br>
<br>
<pre style="background-color: rgb(204, 204, 204);"> private String getSessionData() {<br>     Hashtable sess = getSession();<br>     String ret = (String)sess.get("request_record");<br>     return ret != null ? ret : "";<br> }<br><br>&nbsp; private void setSessionData(String data) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hashtable session = getSession();<br>      session.put("request_record", data);<br>&nbsp; }</pre>
<br>
These addString method and getResult method are exposed by our RM
endpoint and are same as Part 1 .<br> The method addString&nbsp; takes a 
String
as entered by a user and adds it to the Strings stored in the session
data for that session.<br>
The getResult will return all the strings entered by the user during
that session.<br>
<br>
<span style="font-weight: bold;">
<pre style="background-color: rgb(204, 204, 204);"><span
 style="font-weight: normal;">&nbsp; @WebMethod</span><br
 style="font-weight: normal;"><span style="font-weight: normal;">&nbsp; public void addString(String s )</span><!--<br style="font-weight: normal;">--><span
 style="font-weight: normal;"><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;setSessionData(getSessionData() + " " + s);</span><br
 style="font-weight: normal;"><br style="font-weight: normal;"><span
 style="font-weight: normal;">&nbsp; } </span><br
 style="font-weight: normal;"><br style="font-weight: normal;"><span
 style="font-weight: normal;">&nbsp; @WebMethod</span><br
 style="font-weight: normal;"><span style="font-weight: normal;">&nbsp; public String getResult() {</span><br
 style="font-weight: normal;"><span style="font-weight: normal;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; return getSessionData();&nbsp; </span><br
 style="font-weight: normal;"><br style="font-weight: normal;"><span
 style="font-weight: normal;">&nbsp; }</span></pre>
</span><br>
Full source code for the <a
 href="https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-rm/javaone-2006-demo/rmdemo/server/RMDemoImpl.java?rev=1.7&amp;view=log">RMDemoImpl.java</a>&nbsp;
is here.<br>
<br>
<big><span style="font-weight: bold;">Advantages</span></big><br>
Here the Session is created every time a new CreateSequence request is
received and gets terminated everytime there is a <br>TerminateSequence
request. This way the resource management issue as mentioned by Mike is
addressed.<br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<span style="font-weight: bold;"><big>Client Code</big><br>
</span></span></span><a
 href="https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-rm/javaone-2006-demo/rmdemo/client/DemoClient.java?rev=1.4&amp;view=markup">Here</a>
is the source code for the client. The client enters&nbsp; various
input Strings and finally hits carriage <br>
return to terminate the client application and all the Strings received
so far for that client will be returned by
the 
server.<span style="font-weight: bold;"><span style="font-weight: bold;"><span
 style="font-weight: bold;"><br>
</span><br>
</span></span>Sample will be bundled in the wsit workspace and this is
the <a
 href="https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-rm/javaone-2006-demo/rmdemo/client/DemoClient.java?rev=1.4&amp;view=markup">README</a>
to run the samples.<span style="font-weight: bold;"><span
 style="font-weight: bold;"><br>
<br>
</span></span><br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><big><span
 style="font-weight: bold;">Additional sources of information</span></big><br>
<br>
<a style="font-weight: bold;" href="http://wsit.dev.java.net">WSIT
website</a><br>
</span></span>Check this website for latest source code,
samples,documentation<span style="font-weight: bold;"><span
 style="font-weight: bold;"><br>
<div style="margin-left: 40px;"><br>
</div>
<a href="http://java.sun.com/javaee/glassfish"><b>Project GlassFish
Open Source App Server</b></a><br>
</span></span>All WSIT technologies can be installed on this FREE app
server<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<br>
<b><a href="http://websvc.netbeans.org/wsit">Netbeans IDE Module</a>:<br>
</b></span></span>All WSIT technologies available today can be
configured visuall
using this Netbeans module.<span style="font-weight: bold;"><span
 style="font-weight: bold;"><br>
<ul>
  <ul>
  </ul>
</ul>
<a style="font-weight: bold;"
 href="http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf">WS-ReliableMessaging
specification</a><br>
<br>
</span></span><a style="font-weight: bold;"
 href="http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html">Maintaining
Session With JAX-WS</a><span style="font-weight: bold;"><span
 style="font-weight: bold;"><br>
</span></span><br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<ul>
  <ul>
  </ul>
 </ul>
</span>
</span>
<div id="a005290more">
</div>
<br>
<br>
<br>
<br>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>Woodstox in Glassfish v2</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/06/woodstox_in_gla_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-06-01T19:07:09Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.7516</id>
<created>2007-06-01T19:07:09Z</created>
<summary type="text/plain">Starting with GF v2 b49 woodstox is now integrated as part of Glassfish
along with sjsxp</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>

<br>
</span>Starting with <a href="https://glassfish.dev.java.net/downloads/v2-b49.html">GF v2 b49</a>, <a href="http://woodstox.codehaus.org/">Woodstox</a>
is now integrated as part of <a href="https://glassfish.dev.java.net//">Glassfish</a>
along with <a href="https://sjsxp.dev.java.net/">sjsxp</a> so that users have the benefit of additional performance improvements which woodstox provides.<br>
sjsxp is the default parser in glassfish. This is a preliminary integration with Woodstox and testing is still in progress so let us know if you run into issues.<br> Here is some more information from <a href="http://weblogs.java.net/blog/spericas/">Santiago</a> regarding Woodstox in his <a href="http://weblogs.java.net/blog/spericas/archive/2007/06/woodstox_rocks.html">blog Woodstox rocks Glassfish v2</a>
<p>To enable Woodstox we need to
use the following<br>
<br>
<span style="font-weight: bold; text-decoration: underline;">Client
side
</span><br>
<br>
These three system properties will need to be added on client side when
you want to enable Woodstox. <br>
-Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
<br>
-Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
<br>
-Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory
<br>
<br>
<br>
<br>
<span style="text-decoration: underline; font-weight: bold;">Server
side
</span><br>
<br>
Similarly on server side we can use standard JAXP API's system
properties to turn Woodstox on for entire GF. So GF process needs to be
execed with the following system properties:
<br>
<br>
-Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory
<br>
-Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory
<br>
-Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory
<br>
<br>
In glassfish, the admin console provides easy way to set system
properties as show in Fig 1 (you can do the same by editing domain.xml)
<br>
<br>
<br>
<img alt="admin-console-sys-props.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/admin-console-sys-props.jpg" width="1678" height="867" /><br>
<br>
<span style="font-style: italic;"><small>Fig 1&nbsp; Modifying system
properties using admin console http://localhost:4848</small><br>
<br>
</span>You can try it out and give us feedback at<br>
<a href="mailto:%20dev@wsit.dev.java.net">dev@wsit.dev.java.net</a><br>
<a href="mailto:dev@glassfish.dev.java.net">dev@glassfish.dev.java.net</a><br>
<br>
<br>
</body>]]>

</content>
</entry>
<entry>
<title>Obtaining and analyzing thread dumps</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/05/obtaining_and_a.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-05-25T21:09:24Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.7509</id>
<created>2007-05-25T21:09:24Z</created>
<summary type="text/plain">Most of run into bugs where tests &quot;hang&quot;. Here are some nice tools and tips I found to obtain and analyze thread dumps. </summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body>

Most of us run into bugs where tests "hang". Here are some nice tools and
tips I found to obtain and analyze thread dumps. I am sure there may be
other tools so if you know of some good ones feel free to add.<br>
<br>
<a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html"
 style="font-weight: bold;">Jstack</a><br>
<b>jstack</b>
prints Java stack traces of Java threads for a given Java
process or core file or a remote debug server. However jstack is not
available for Windows platforms or on
the Linux platform.<br>
<br>
<a href="http://www.adaptj.com/root/main/stacktrace"><span
 style="font-weight: bold;">Stacktrace</span></a><br>
Stacktrace has great features which include<br>

1.  Thread dump for Java processes running as a <em>Windows
service</em> (like Tomcat, for example), started with <em>javaw.exe</em>
or embedded inside another process.<br>

2.  Thread
dump for any applet running inside any browser (Apple, IBM and Sun JDKs
for Windows and Mac OS X). StackTrace is known to work with IE,
Firefox, Safari and Mozilla. <br>
and many other features..
</p>
<br><p>
I usually get the java process id using <a
 href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html">jps</a><br>
<br>
<span style="font-weight: bold;">Control Break/ kill&nbsp; options</span><br>
<p>On UNIX platforms you can send a signal to a program by using the
kill
command. This is the quit signal, which is handled by the JVM.
For example, on Solaris you can use the command <b>kill -QUIT
process_id</b>,<br> where process_id is the process number
of your Java program.
<p>Alternatively you can enter the key sequence <b>&lt;ctrl&gt;\ </b>in
the window where the Java program was started. Sending this signal
instructs a signal handler in the JVM, to recursively print out all the
information on the threads <br>and monitors inside the JVM.
<br>
To generate a stack trace on Windows platforms, enter the key
sequence <b>&lt;ctrl&gt;&lt;break&gt;</b> in the window where
the Java program is running, or click the Close button on the window.

<p>Byron Nevins has also pointed in his <a
 href="http://blogs.sun.com/foo/entry/how_to_get_thread_dumps">blog </a>how
to obtain thread dumps in <a href="glassfish.dev.java.net">Glassfish.</a><br>
<br>
<b><a href="https://tda.dev.java.net/"><span style="font-weight: bold;">TDA</span></a></b><br>
This is a great utility I found for analyzing thread dumps.<br><p>

I especially liked the ability to filter the threads display to be able
to ignore e.g. idle threads.. Also as you can see in Fig 1 The three
pane view is really helpful<br>
<br>
<p>
<img alt="tda.jpg" src="http://weblogs.java.net/blog/bhaktimehta/archive/tda.jpg" width="1680" height="610" />
<i> Fig 1 : Using TDA to analyze thread dumps </i>
<br>
<br>
<b> </b>
</body>]]>

</content>
</entry>
<entry>
<title>Update to Developing Webservices using Glassfish AS 9.1 and JDK 6</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/01/update_to_devel.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-01-24T20:10:16Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.6402</id>
<created>2007-01-24T20:10:16Z</created>
<summary type="text/plain">In the previous  blog &quot;Developing Webservices using Glassfish AS 9.1 and JDK 6 &quot;  we tried running glassfish-samples using Glassfish v2  using JDK 6.
We walked through what was different when trying with JDK 6 and I mentioned to use a temporary
work-around . However this bug is now fixed since Glassfish v2 b31 .
So here is the updated blog.</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<body lang="en-US" dir="ltr">

<p>In the previous&nbsp; <a
 href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/01/developing_webs.html">blog</a>&nbsp;
we tried running glassfish-samples using <a
 href="https://glassfish.dev.java.net/public/downloadsindex.html">Glassfish
v2&nbsp; </a>using
<a href="https://jdk6.dev.java.net/">JDK 6.</a><br>
We walked through what was different when trying with JDK 6 and I
mentioned to use a temporary <br>
work-around of putting javaee.jar in $AS_HOME/lib/endorsed..<br>
However this <a
 href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=1290">bug</a>
is now fixed since <a
 href="https://glassfish.dev.java.net/public/downloadsindex.html">Glassfish
v2 b31 </a>.<br>
<p>The latest Glassfish v2 installs webservices-api.jar in
$AS_HOME/lib/endorsed. and hence we do not need to put javaee.jar there.</p><br>
So here is the updated blog.<br><p>
<a href="https://glassfish-samples.dev.java.net/"></a></p>
<span style="font-weight: bold;"><big>Steps to run the sample with
JDK 6</big><br>
</span><br>
<p><span style="font-weight: bold;">Install JDK 6 from </span><a
 href="http://download.java.net/jdk6/binaries/"
 style="font-weight: bold;">http://download.java.net/jdk6/binaries/</a><br>
<br>
</p>
<p><big><span style="font-weight: bold;"><small>Install&nbsp; GlassFish
v2</small><br>
</span></big></p>
<p>You can install&nbsp; the latest nightly or the latest promoted v2
build from<a
 href="https://glassfish.dev.java.net/public/downloadsindex.html">
https://glassfish.dev.java.net/public/downloadsindex.html</a><br>
Follow these <a
 href="https://glassfish.dev.java.net/downloads/v2-b28.html">instructions</a>
to unbundle and configure glassfish .<br>
<br>
<a href="https://glassfish.dev.java.net/public/downloadsindex.html"> </a></p>
<span style="font-weight: bold;">Check the version of JDK used by
Glassfish to be JDK 6.0<br>
<br>
</span>For those users who have
already installed GlassFish and wish to change the JDK version. That's
equally simple. The JDK path is
stored in one location : <br>
<ol>
  <li> Check the following file where AS_HOME is the location where
Glassfish is installed
    <pre>&lt;$AS_HOME&gt;/config/asenv.conf for AS_JAVA</pre>
  </li>
  <li> Modify&nbsp; $AS_JAVA to point to JDK 6 if that is not
already set
    <pre>AS_JAVA="location of JDK 6" </pre>
  </li>
</ol>
<br>
<span style="font-weight: bold;">Download the&nbsp; glassfish-samples
from the following site </span><a
 href="https://glassfish-samples.dev.java.net/"
 style="font-weight: bold;">https://glassfish-samples.dev.java.net/</a><br>
<br>
<ol>
  <li> Run :
    <pre> java -jar javaee5-samples-installer-1.0-b09.jar</pre>
  </li>
  <li> Edit : &lt;location of samples&gt;/bp-project/build.properties
to point to $AS_HOME for e.g </li>
</ol>
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; javaee.home="location of Glassfish"</pre>
<ol>
  <li value="4"> Check the java version on the client side <br>
  </li>
</ol>
<pre>      /usr/glassfish-samples/javaee5/webservices %java -version
      java version "1.6.0-rc"
      Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
      Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode, sharing)</pre>
<br>
<span style="font-weight: bold;"></span><span style="font-weight: bold;">Start
Appserver</span><br>
<pre>/usr/glassfish/bin %$AS_HOME/bin/asadmin* start-domain domain1</pre>
<br>
<span style="font-weight: bold;"><br>
</span><span style="font-weight: bold;">Run the Sample</span>
<ol>
  <li>
    <pre>/usr/glassfish-samples/javaee5/webservices/hello-jaxws %ant</pre>
  </li>
This is how the output looks like on the client side
</ol>
<pre style="margin-left: 40px;">/usr/glassfish-samples/javaee5/webservices/hello-jaxws %ant
<div style="margin-left: 40px;"></div>
Buildfile: build.xml
<div style="margin-left: 40px;"></div>
<br>init:
<div style="margin-left: 40px;"></div>
<br>compile-deploy-service:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [echo] /usr/glassfish
<div style="margin-left: 40px;"></div>
<br>get-artifacts-unix:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] parsing WSDL...
<div style="margin-left: 40px;"></div>
<br>
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] generating code...
<div style="margin-left: 40px;"></div>
<br>get-artifacts-windows:
<div style="margin-left: 40px;"></div>
<br>get-artifacts:
<div style="margin-left: 40px;"></div>
<br>compile-client:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp; [javac] Compiling 1 source file to /usr/glassfish-samples/javaee5/webservices
<div style="margin-left: 40px;"></div>
hello-jaxws/build
<div style="margin-left: 40px;"></div>
<br>run-client-unix:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] Hello result = Hello Administrator!
<div style="margin-left: 40px;"></div>
<br>run-client-windows:
<div style="margin-left: 40px;"></div>
<br>run-client:
<div style="margin-left: 40px;"></div>
<br>all:
<div style="margin-left: 40px;"></div>
<br>BUILD SUCCESSFUL
<div style="margin-left: 40px;"></div>
Total time: 13 seconds</pre>
<p><br>

Please note: <br>
As seen in the following sample.<br>
<b>Clients should set the fololowing property to run with JDK 6</b><br>
<pre>&nbsp;&lt;sysproperty key="java.endorsed.dirs" value="${javaee.home}/lib/endorsed"/&gt; </pre>
<br>
</p>
<b>Also for ant tasks like wsimport,xjc :</b><br>
<br><p>
The solution is to copy $AS_HOME/lib/endorsed/webservices-api.jar
to $JAVA_HOME/jre/lib/endorsed.<br>
<p>Neither jvmargs nor sysproperty will work in this case <br>because by the time ant loads this class it would have already loaded the 2.0 classes <br>and we did not get the chance to override the 2.0 classes with 2.1 classes.



</body>]]>

</content>
</entry>
<entry>
<title>Developing Webservices using Glassfish AS 9.1 and JDK 6</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2007/01/developing_webs.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2007-01-02T19:08:58Z</issued>
<id>tag:weblogs.java.net,2007:/blog/bhaktimehta/275.6233</id>
<created>2007-01-02T19:08:58Z</created>
<summary type="text/plain">This blog will show how to develop, run and deploy JAX-WS  based webservices with Glassfish v2 Milestone 3 build using JDK 6.</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<html>
<head>
  <meta http-equiv="CONTENT-TYPE"
 content="text/html; charset=windows-1252">
  <title>Developing Webservices using Glassfish AS 9.1 and JDK 6</title>
  <meta name="GENERATOR" content="StarOffice 8  (Win32)">
  <meta name="CREATED" content="20061218;15120232">
  <meta name="CHANGED" content="20061218;15190239">
</head>
<body lang="en-US" dir="ltr">

<p>This blog will show how to develop, run and deploy
JAX-WS&nbsp; based webservices with <a
 href="https://glassfish.dev.java.net/public/downloadsindex.html">Glassfish v2 Milestone 3 build </a>using
<a href="https://jdk6.dev.java.net/">JDK 6.</a><br>
It will demonstrate step by step instructions using the
hello-jaxws sample from the following <a
 href="https://glassfish-samples.dev.java.net/">
glassfish-samples.</a><br>
</p>
<p><span style="font-weight: bold;"><big>What is different when trying
with JDK 6?<br>
<br>
</big></span>JDK 6.0 has&nbsp; JAXB/JAX-WS 2.0 versions of the apis.<br>
In the latest Glassfish v2 we are integrating the implementation
classes
compliant with JAXB/JAX-WS 2.1 versions <br>
of the apis which are present in&nbsp; javaee.jar .<br>
<br>
So when we run with Glassfish and JDK 6.0 (without
putting anything in
the &lt;AS HOME&gt;/lib/endorsed directory), <br>
the
APIs/Annotation classes for JAX-WS 2.0 and JAXB 2.0 will be picked
up instead of JAX-WS 2.1 and JAXB 2.1. <br>
</p>
<p>To avoid this we need to use the endorsed standards to override the
2.0 apis by
putting javaee.jar in $AS_HOME/lib/endorsed. <br>
<span style="font-weight: bold;">This is a temporary workaround for now
and this issue will be fixed soon.<br>
</span></p>
<p><span style="font-weight: bold;"><big>Steps to run the sample with
JDK 6</big><br>
</span></p>
<p><span style="font-weight: bold;">Install JDK 6 from </span><a
 href="http://download.java.net/jdk6/binaries/"
 style="font-weight: bold;">http://download.java.net/jdk6/binaries/</a><br>
<br>
</p>
<p><big><span style="font-weight: bold;"><small>Install&nbsp; GlassFish
v2 Milestone 3</small><br>
</span></big></p>
<p>Install&nbsp; from<a
 href="https://glassfish.dev.java.net/public/downloadsindex.html">
https://glassfish.dev.java.net/public/downloadsindex.html</a><br>
Follow these <a
 href="https://glassfish.dev.java.net/downloads/v2-b28.html">instructions</a>
to unbundle and configure glassfish .<br>
<br>
<a href="https://glassfish.dev.java.net/public/downloadsindex.html"> </a></p>
<span style="font-weight: bold;">Check the version of JDK used by
Glassfish to be JDK 6.0<br>
<br>
</span>For those users who have
already installed GlassFish and wish to change the JDK version. That's
equally simple. The JDK path is
stored in one location : <br>
<ol>
  <li> Check the following file where AS_HOME is the location where
Glassfish is installed
    <pre>&lt;$AS_HOME&gt;/config/asenv.conf for AS_JAVA</pre>
  </li>
  <li> Modify&nbsp; $AS_JAVA to point to JDK 6 if that is not
already set
    <pre>AS_JAVA="location of JDK 6" </pre>
  </li>
</ol>
<br>
<span style="font-weight: bold;">Download the&nbsp; glassfish-samples
from the following site </span><a
 href="https://glassfish-samples.dev.java.net/"
 style="font-weight: bold;">https://glassfish-samples.dev.java.net/</a><br>
<br>
<ol>
  <li> Run :
    <pre> java -jar javaee5-samples-installer-1.0-b08.jar</pre>
  </li>

  <li> Edit : &lt;location of samples&gt;/bp-project/build.properties
to point to $AS_HOME for e.g 

    <pre> javaee.home="location of Glassfish"</pre>
   </li>

  <li> Check the java version on the client side <br>
  <pre> /usr/glassfish-samples/javaee5/webservices %java -version
       java version "1.6.0-rc"
       Java(TM) SE Runtime Environment (build 1.6.0-rc-b104)
       Java HotSpot(TM) Client VM (build 1.6.0-rc-b104, mixed mode,   sharing)</pre>
   </li>
</ol>
<br>
<span style="font-weight: bold;">Add javaee.jar to
$AS_HOME/lib/endorsed<br>
<br>
</span>As mentioned earlier this extra step will be required for
running with JDK 6.0<span style="font-weight: bold;"><br>
<br>
</span>
<ol>
  <li>
    <pre>mkdir -p $AS_HOME/lib/endorsed</pre>
  </li>
  <li>
    <pre>mv $AS_HOME/lib/javaee.jar $AS_HOME/lib/endorsed</pre>
  </li>
</ol>
<span style="font-weight: bold;">Start Appserver</span><br>
<pre>/usr/glassfish/bin %$AS_HOME/bin/asadmin* start-domain domain1</pre>
<br>
<span style="font-weight: bold;"><br>
</span><span style="font-weight: bold;">Run the Sample</span>
<ol>
  <li> Modify &lt;location&nbsp; of
samples&gt;/javaee5/webservices/hello-jaxws/build.xml to point to<br>
$AS_HOME/lib/endorsed/javaee.jar in classpath. Currently the samples
point to j2ee.jar in the build.xml</li>
Replace references of j2ee.jar with location of javaee.jar<br>

<pre style="margin-left: 40px;">&lt;path id="classpath"&gt;
&nbsp;&nbsp;&nbsp; &lt;pathelement location="${javaee.home}/lib/endorsed/javaee.jar"/&gt;
&nbsp;&nbsp;&nbsp; &lt;pathelement location="${classesdir}"/&gt;
&lt;/path&gt;<br><br>and<br> &lt;target name="compile-deploy-service" depends="init"&gt;<br>     &lt;mkdir dir="${classesdir}"/&gt;<br>     &lt;echo message="${javaee.home}"/&gt;<br>     &lt;javac<br>         srcdir="./src"<br>         includes="endpoint/**"<br>         destdir="${autodeploydir}"<br>         classpath="${javaee.home}/lib/endorsed/javaee.jar"<br>     /&gt;<br>...<br>&lt;/target&gt;<br><br></pre>

  <br>
  <li> Run:
    <pre>/usr/glassfish-samples/javaee5/webservices/hello-jaxws %ant</pre>
  </li>
  <br>
</ol>
This is how the output looks like on the client side<br>
<pre style="margin-left: 40px;">/usr/glassfish-samples/javaee5/webservices/hello-jaxws %ant
<div style="margin-left: 40px;"></div>
Buildfile: build.xml
<div style="margin-left: 40px;"></div>
<br>init:
<div style="margin-left: 40px;"></div>
<br>compile-deploy-service:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [echo] /usr/glassfish
<div style="margin-left: 40px;"></div>
<br>get-artifacts-unix:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] parsing WSDL...
<div style="margin-left: 40px;"></div>
<br>
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] generating code...
<div style="margin-left: 40px;"></div>
<br>get-artifacts-windows:
<div style="margin-left: 40px;"></div>
<br>get-artifacts:
<div style="margin-left: 40px;"></div>
<br>compile-client:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp; [javac] Compiling 1 source file to /usr/glassfish-samples/javaee5/webservices
<div style="margin-left: 40px;"></div>
hello-jaxws/build
<div style="margin-left: 40px;"></div>
<br>run-client-unix:
<div style="margin-left: 40px;"></div>
&nbsp;&nbsp;&nbsp;&nbsp; [exec] Hello result = Hello Administrator!
<div style="margin-left: 40px;"></div>
<br>run-client-windows:
<div style="margin-left: 40px;"></div>
<br>run-client:
<div style="margin-left: 40px;"></div>
<br>all:
<div style="margin-left: 40px;"></div>
<br>BUILD SUCCESSFUL
<div style="margin-left: 40px;"></div>
Total time: 13 seconds</pre>
<br>
<br>
<br>
<br>
<br>
<br>
<p><br>
<br>
</p>
<p><br>
<br>
</p>
</body>
</html>]]>

</content>
</entry>
<entry>
<title>WS-Reliable Messaging and Session Support (Part2)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2006/08/wsreliable_mess.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-08-21T23:29:29Z</issued>
<id>tag:weblogs.java.net,2006:/blog/bhaktimehta/275.5401</id>
<created>2006-08-21T23:29:29Z</created>
<summary type="text/plain">This is Part 2 in a series of articles on supporting sessions using WS-ReliableMessaging. In this blog Mike Grogan will demonstrate the problems with the approach taken in Part 1

</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[This is Part 2 in a series of articles on supporting sessions using WS-ReliableMessaging. In this <a href="http://weblogs.java.net/blog/mikeg/archive/2006/08/wsreliable_mess.html">blog</a> <a href="http://weblogs.java.net/blog/mikeg/">Mike Grogan </a>compares HttpSessions and ReliableSessions and demonstrates the problems with the approach taken in <a href="http://weblogs.java.net/blog/bhaktimehta/archive/2006/08/ws_reliable_mes_1.html">Part 1</a>
<br>

<p>
Technorati:<a href="http://technorati.com/tag/wsit" rel="tag">WSIT </a><a href="http://technorati.com/tag/tango" rel="tag">Tango</a>]]>

</content>
</entry>
<entry>
<title>WS Reliable Messaging and Session Support (Part1)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2006/08/ws_reliable_mes_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-08-02T22:31:03Z</issued>
<id>tag:weblogs.java.net,2006:/blog/bhaktimehta/275.5290</id>
<created>2006-08-02T22:31:03Z</created>
<summary type="text/plain">Sessions are unique ids used to identify a client. They would help maintain state for each client.
In this sample you will see how sessions can be supported with WS Reliable Messaging (WS RM) .</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>WS Reliable Messaging and Session Support</title>
</head>
<body style="color: rgb(0, 0, 0);" alink="#ee0000" link="#0000ee"
vlink="#551a8b">
This sample was shown as a demo in the session <span
style="font-weight: bold;">"</span>Reliable and Transacted Web
Services between <br>
Java™ Technology-Based Project Tango and Microsoft
Indigo" TS-1603 at&nbsp; <a href="http://java.sun.com/javaone/sf/">Javaone
2006</a>.<br>
<br>
This is a part of tri series blogs where in Part 1 we will show one way
of supporting sessions with<br>
WS Reliable Messaging. Then Mike will show in his blog what are the
problems with this approach and we will<br>
conclude with a third part where we have tried to fix some of these
problems .<br>
<br>
<big><span style="font-weight: bold;"></span></big>Sessions are unique
ids used to identify a client. They would help
maintain state for each client. <br>
In this sample you will see how
sessions can be supported with WS Reliable Messaging (WS RM) . <br>
WS
RM&nbsp; is one of the
enterprise features in Project <a
href="http://weblogs.java.net/blog/haroldcarr/archive/2006/02/an_overview_of_1.html">Tango
</a>which is <a href="http://sun.com/">Sun's</a> <a
href="http://java.sun.com/webservices/">Java Web Services</a>
<br>
interoperability project with <a href="http://microsoft.com/">Microsoft's</a>
<a href="http://windowscommunication.net/">Windows Communication
Foundation</a> (WCF).<br>
<br>
The following snippets of code show how the JAX-WS Endpoint
implementation which is RM enabled
<br>
supports sessions . <br>
<br>
This is the<a href="http://weblogs.java.net/blog/bhaktimehta/archive/RMDemo.wsdl">
wsdl</a> which shows RM is enabled in the endpoint by the presence of <a
href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">WS-RM
Policy Assertions.</a><br>
Here is endpoint implementation class<br>
<pre style="background-color: rgb(204, 204, 204);">@WebService(endpointInterface="rmdemo.server.RMDemo")<br><br>public class RMDemoImpl {<br><br>....<br><br>}</pre>
<br>
We create a HashTable of&nbsp; SessionIds&nbsp; as the keys and Strings
which
are entered by the clients as the values.<br>
<pre style="background-color: rgb(204, 204, 204);">private final HashTable&lt;String,String&gt; sessionTable = <br>
&nbsp;&nbsp;&nbsp;&nbsp;new HashTable&lt;String, String&gt;();</pre>
<br>
JAX-WS uses annotations defined by Common Annotations for the Java
Platform (<a href="http://www.jcp.org/en/jsr/detail?id=250">JSR 250</a>),<br>
to inject the Web ServiceContext and declare lifecycle methods. Web
ServiceContext holds the<br>
context
information pertaining to a request being served. With JAX-WS Web
Service all you need to do is <br>
mark a field or method
with @Resource.&nbsp; From the WebServiceContext,&nbsp; <a
href="http://download.java.net/jdk6/docs/api/javax/xml/ws/handler/MessageContext.html">MessageContext</a>
pertaining <br>
to the the current request can be accessed. More information
on how MessageContext&nbsp; can be used to <br>
share metadata is explained in this <a
href="https://jax-ws.dev.java.net/articles/MessageContext.html">article</a>.
<br>
<br>
<pre style="background-color: rgb(204, 204, 204);">&nbsp;&nbsp;@Resource<br>&nbsp;&nbsp;private javax.xml.ws.WebServiceContext context;<br></pre>
<br>
As mentioned above WebServiceContext exposes&nbsp; the <a
href="http://download.java.net/jdk6/docs/api/javax/xml/ws/handler/MessageContext.html">MessageContext</a>&nbsp;
for the request being served when this method is called .<br>
The session id
is obtained from the MessageContext using a jax-ws property
"com.sun.xml.ws.sessionid"<br><span style="font-weight: bold;"><br>
</span>
<pre style="background-color: rgb(204, 204, 204);">&nbsp;&nbsp;private String getSessionId() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  return (String)context.getMessageContext()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .get("com.sun.xml.ws.sessionid");<br>&nbsp; }<pre><span
style="font-weight: bold;"></span></pre><span
style="font-weight: bold;"><br></span></pre>
<span style="font-weight: bold;"></span><br>
The following getter&nbsp; method returns the String associated
with each request . Correspondingly the setter method&nbsp; <br>
stores the Strings for each session in the
HashTable respectively.<br>
<br>
<pre style="background-color: rgb(204, 204, 204);"> private String getSessionData() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String id = getSessionId();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String ret = sessionTable.get(id);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ret!= null ? ret : "";<br>&nbsp; }<br><br>&nbsp; private void setSessionData(String data) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sessionTable.put(getSessionId(), data);<br>&nbsp; }</pre>
<br>
These addString method and getResult method are exposed by our RM
endpoint. The method addString&nbsp; takes a <br>
String
as entered by a user and adds it to the Strings stored in the session
data for that session.<br>
The getResult will return all the strings entered by the user during
that session.<br>
<br>
<span style="font-weight: bold;">
<pre style="background-color: rgb(204, 204, 204);"><span
style="font-weight: normal;">&nbsp; @WebMethod</span><br
style="font-weight: normal;"><span style="font-weight: normal;">&nbsp; public void addString(String s )</span><!--<br style="font-weight: normal;">--><span style="font-weight: normal;"></span><span
style="font-weight: normal;">
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;setSessionData(getSessionData() + " " + s);</span><br
style="font-weight: normal;"><br style="font-weight: normal;"><span
style="font-weight: normal;">&nbsp; } </span><br
style="font-weight: normal;"><br style="font-weight: normal;"><span
style="font-weight: normal;">&nbsp; @WebMethod</span><br
style="font-weight: normal;"><span style="font-weight: normal;">&nbsp; public String getResult() {</span><br
style="font-weight: normal;"><span style="font-weight: normal;"></span><span
style="font-weight: normal;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; return getSessionData();&nbsp; </span><br
style="font-weight: normal;"><br style="font-weight: normal;"><span
style="font-weight: normal;">&nbsp; }</span></pre>
</span>This example is a good demonstration of how <a
href="http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf">InOrder
delivery
assurance</a> (i.e messages are delivered in<br>
the order that they are
sent)&nbsp; in WS Reliable Messaging works. If the ordered
delivery would not work<br>
right then the strings stored in the session
would not have
been in the right order. <br>
Full source code for the <a href="http://weblogs.java.net/blog/bhaktimehta/archive/RMDemoImpl.java">RMDemoImpl.java</a>&nbsp;
is here.<br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<span style="font-weight: bold;"><big>Client Code</big><br>
</span></span></span><a href="http://weblogs.java.net/blog/bhaktimehta/archive/DemoClient.java">Here</a>
is the source code for the client. The client enters&nbsp; various
input Strings and finally hits carriage <br>
return to terminate the client application and all the Strings received
so far for that client will be returned by
the <br>
server.<span style="font-weight: bold;"><span style="font-weight: bold;"><span
style="font-weight: bold;"><br>
</span><br>
</span></span>Sample will be bundled in the <a
href="https://wsit.dev.java.net/source/browse/wsit/wsit/samples/">samples</a>
folder.<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<br>
<big><span style="font-weight: bold;">Instructions to run the sample</span></big><br>
<br>
</span></span>Please follow the<a
href="https://wsit.dev.java.net/source/browse/wsit/wsit/samples/ws-rm/javaone-2006-demo/rmdemo/README">
Readme</a> to setup and run the sample. <br>
<br>
For any questions or feedback
on the sample please write to <a href="mailto:users@wsit.dev.java.net">users@wsit.dev.java.net</a><span
style="font-weight: bold;"><span style="font-weight: bold;"><br>
</span></span><br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><big><span
style="font-weight: bold;">Additional sources of information</span></big><br>
<span style="font-weight: bold;"></span><br>
<a style="font-weight: bold;" href="http://wsit.dev.java.net">WSIT website</a><br>
</span></span>Check this website for latest source code,
samples,documentation<span style="font-weight: bold;"><span
style="font-weight: bold;"><br>
<div style="margin-left: 40px;"><br>
</div>
<a href="http://java.sun.com/javaee/glassfish"><b>Project GlassFish Open Source App Server</b></a><br>
</span></span>All WSIT technologies can be installed on this FREE app
server<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<br>
<b><a href="http://websvc.netbeans.org/wsit">Netbeans IDE Module</a>:<br>
</b></span></span>All WSIT technologies available today can be
configured visuall
using this Netbeans module.<span style="font-weight: bold;"><span
style="font-weight: bold;"><br>
<br>
<a href="http://weblogs.java.net/blog/bhaktimehta/archive/TS-1603.pdf"><span style="font-weight: bold;">Slides for TS
1603</span></a><br>
<span style="font-weight: bold;"></span></span></span>Reliable and
Transacted Web
Services between Java™ Technology-Based Project Tango and Microsoft
Indigo<br>
&nbsp;at Javaone 2006 <span style="font-weight: bold;"><span
style="font-weight: bold;"><br>
<ul>
<ul>
</ul>
</ul>
<a style="font-weight: bold;"
href="http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf">WS-ReliableMessaging
specification</a><br>
<br>
</span></span><a style="font-weight: bold;"
href="http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html">Maintaining
Session With JAX-WS</a><span style="font-weight: bold;"><span
style="font-weight: bold;"><br>
</span></span><br>
<span style="font-weight: bold;"><span style="font-weight: bold;"><br>
<ul>
<ul>
</ul>
<br>
<br>
<b><br>
</b><br>
<br>
</ul>
<br>
<br>
<br>
</span>
</span>
</body>
</html>

]]>

</content>
</entry>
<entry>
<title>Overview of Web Services Reliable Messaging</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2006/03/overview_of_web_1.html" />
<modified>2008-06-24T19:17:03Z</modified>
<issued>2006-03-31T21:08:29Z</issued>
<id>tag:weblogs.java.net,2006:/blog/bhaktimehta/275.4424</id>
<created>2006-03-31T21:08:29Z</created>
<summary type="text/plain">In the real world, challenges are encountered in delivering messages. There can be network/connection problems. 
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.</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Community: Java Web Services and XML</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>WS-Reliable Messaging</title>
</head>
<body>
In the real world, challenges
are encountered in
delivering messages. There can be network/connection problems.
<br>
Consequently, messages can be lost or delivered out of order. Web
Services&nbsp; Reliable Messaging (WS RM) provides <br>
a mechanism to
ensure a layer of reliability
between potentially unreliable or intermittently connected
networks.&nbsp; <br>
It&nbsp; provides an interoperable protocol that a
RM (Reliable Messaging) Source and RM&nbsp; Destination
use to provide<br>
Application Source and Destination a guarantee that the
message that is sent will be delivered. <br>
This guarantee is known as
delivery assurance.<br>
<br>
There are four basic delivery assurances that endpoints can provide<br>
<br>
<span style="font-weight: bold;">AtMostOnce</span>: <br>
Messages will be delivered at most once without duplication . It is
possible some messages in a sequence may not be<br>
delivered.<br>
<span style="font-weight: bold;">AtLeastOnce</span>:<br>
Every message sent will be delivered. Some messages may be delivered
more than once.<br>
<span style="font-weight: bold;">ExactlyOnce :</span><br>
Every message sent will be delivered without duplication.<br>
<span style="font-weight: bold;">InOrder:</span><br>
Messages will be delivered in&nbsp; the order that they were sent.<br>
<br>
<span style="font-weight: bold;"><br>
</span>
<table border="0" width="80%">
<tbody>
<tr width="100%">
<td width="85%">WS RM is one of the enterprise features in
Project <a
href="http://weblogs.java.net/blog/haroldcarr/archive/2006/02/an_overview_of_1.html">Tango
</a>which is <a href="http://sun.com/">Sun's</a> <a
href="http://java.sun.com/webservices/">Java
Web Services</a>
interoperability project with <a href="http://microsoft.com/">Microsoft's</a>
<a href="http://windowscommunication.net/">Windows Communication
Foundation</a>
(WCF).</td>
<td width="15%"> <img alt="duke_tango_sm.jpg"
src="http://weblogs.java.net/blog/bhaktimehta/archive/duke_tango_sm.jpg"
style="width: 115px; height: 92px;"></td>
</tr>
</tbody>
</table>
<span style="font-weight: bold; font-style: italic;"></span><span
style="font-style: italic;"></span>
In Project Tango, RM is enabled in
endpoints by the presence of <a
href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">RM
policy assertions</a> in the WSDL.&nbsp;<span
style="font-weight: bold; font-style: italic;"></span><a
href="http://www.netbeans.org/">Netbeans
IDE</a> <br>
will&nbsp; provide
configurable settings to easily enable RM in endpoints as shown in the
screen shot
below.<br>
<br>
<span style="font-weight: bold;"></span><br>
<br>
<img
alt="Screenshot showing how to enable WS RM in Netbeans Tango module"
src="http://weblogs.java.net/blog/bhaktimehta/archive/screen-shot.png"
style="width: 1072px; height: 800px;"><br>
<span style="font-weight: bold;"><br>
</span><span style="font-style: italic;">Fig 1 Screenshot of how to
configure WS RM for an endpoint using Netbeans<br>
<br>
</span><span style="font-weight: bold;">Programming Model for Tango</span>
<br>
<ul>
<li>Developer writes Producers/Consumers using JAX-WS 2.0 apis. </li>
<li>Developer/Deployer supplies config files which would be wsdls
containing Policy assertions to enable/control Tango
components. </li>
<li>Config file can be written by hand or easily produced by Tango
Netbeans
Module as shown in Fig 1.</li>
</ul>
<span style="font-weight: bold;">Message exchanges when RM is enabled</span><br>
&nbsp;
<span style="font-weight: bold;"></span><img
alt="This figure shows how the messages are exchanged between RMSource and RM Destination when RM is enabled"
src="http://weblogs.java.net/blog/bhaktimehta/archive/RM-Model.jpg"
style="width: 485px; height: 312px;"><br>
<span style="font-style: italic;">Fig 2 Message
exchange when RM is enabled using WS RM
implementation</span><br>
<br>
The above figure shows how the Client or Application Source sends a
message for reliable delivery. <span
style="font-weight: bold; font-style: italic;"></span><br>
When RM is
enabled, Project Tango's RM Source module is plugged into
the JAX-WS remoting system. <br>
The RM Source module keeps copies
of&nbsp;
messages until their receipt is acknowledged (via the exchange of&nbsp;
protocol <br>
messages).&nbsp; Similarly, an RM Destination module
acknowledges
messages (and may buffer them for order guarantees). <br>
After
guaranteeing order (if ordering enabled), the RM Destination allows
the message to proceed through the <br>
JAX-WS dispatch for delivery to the
Endpoint or Application Destination.
<br>
<br>
<br>
<span style="font-weight: bold;">Protocol Messages<br>
<img
alt="The above figure shows the exchanges of protocol messages and application messages between reliable messaging endpoints"
src="http://weblogs.java.net/blog/bhaktimehta/archive/message-exchange.jpg"
style="width: 428px; height: 417px;"><br>
</span><span style="font-style: italic;">Fig 3 Possible application and
protocol message exchanges between RM endpoints<br>
<br>
</span>The above figure shows how the message exchange takes place
between two
reliable messaging endpoints <br>
once the initial preconditions&nbsp; are established such as resolving
endpoint references, policy
exchange and establishing trust.<br>
<span style="font-weight: bold;"></span>
<ol>
<li>The RM Source requests creation of a new Sequence by initiating a
<br>
CreateSequence/CreateSequenceResponse handshake.<br>
</li>
<li>The RM Destination creates the Sequence by returning a
CreateSequenceResponse <br>
with globally unique identifier.This sequence id would be used to
identify<br>
the
sequence and will be sent in all the following messages.<br>
</li>
<li>The RM Sources begins sending messages with MessageNumber 1 .</li>
<li>After 3 messages it sends LastMessage token.</li>
<li>The 2nd message is lost in transit</li>
<li>The RM Destination acknowledges receipt of message numbers 1 and
3 in
response to LastMessage.</li>
<li>The RM Source retransmits 2nd message which has the same sequence
identifier<br>
and message number so that the RM Destination can recognize
it as
equivalent of earlier message.<br>
The RM Source also includes an
AckRequested so
RM Destination can expedite
the acknowledgement. </li>
<li>RM Destination receives the second transmission and
acknowledges
the receipt of messages 1,2 ,3. </li>
<li>The RM Source receives the acknowledgement and sends Terminate
Sequence to RM Destination.<br>
The RM Destination receives
TerminateSequence and reclaims resources
associated with the Sequence</li>
</ol>
<span style="font-weight: bold;"><br>
</span><span style="font-weight: bold;">Availability</span><br>
The implementation will be available by
<a href="http://java.sun.com/javaone">JavaOne</a> on Java.net with
support for <a href="https://glassfish.dev.java.net/">Glassfish </a>
and
<a href="http://www.netbeans.org/">Netbeans IDE.</a><br>
<br>
<span style="font-weight: bold;">Plugfest Status</span><br>
We tested our WS RM implementation with Microsofts WCF at the <a
href="http://groups.yahoo.com/group/soapbuilders/message/10603">Plugfest</a>
on March 7-9 at Redmond. <br>
We successfully interoperated in the
ReliableOneWay and ReliableRoundrip scenarios both as clients and
endpoints. <br>
<br>
<span style="font-weight: bold;">JavaOne 2006</span>
<br>
For more information be sure to check out the session on <span
style="font-weight: bold;"><br>
Reliable
and Transacted Web Services between Java™ Technology-Based Project
Tango and Microsoft Indigo</span> <span style="font-weight: bold;">TS-1603</span>.<br>
<br>
<span style="font-weight: bold;">Other information</span><br>
<a
href="http://specs.xmlsoap.org/ws/2005/02/rm/ws-reliablemessaging.pdf">WS-ReliableMessaging
specification</a><br>
<a href="http://specs.xmlsoap.org/ws/2005/02/rm/WS-RMPolicy.pdf">WS-RM
Policy Assertion</a><br>
<br>
<br>
</body>
</html>

]]>

</content>
</entry>
<entry>
<title>JAXB 2.0 and JAX-WS 2.0 are  a part of Mustang (JDK 6.0)</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/bhaktimehta/archive/2005/08/jaxb_20_and_jax_1.html" />
<modified>2008-01-02T17:42:16Z</modified>
<issued>2005-08-09T00:18:47Z</issued>
<id>tag:weblogs.java.net,2005:/blog/bhaktimehta/275.3069</id>
<created>2005-08-09T00:18:47Z</created>
<summary type="text/plain">To enable reasonable support for ease of development  for the web services stack JAXB 2.0 and JAX-WS 2.0 are now a part of the JSE 6.0 platform</summary>
<author>
<name>bhaktimehta</name>

<email>Bhakti.Mehta@Sun.COM</email>
</author>
<dc:subject>Community: JDK</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/bhaktimehta/">
<![CDATA[<p>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 (<a href="http://weblogs.java.net/blog/kohlert/archive/2005/05/jaxrpc_20_renam.html">formerly known as JAX-RPC</a>) and Java Architecture for XML Binding (JAXB) 2.0.</p>

<p><a href="http://jcp.org/en/jsr/detail?id=224">JSR 224</a> 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.</p>

<p><a href="http://jcp.org/en/jsr/detail?id=222">JSR 222</a> 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.</p>

<p>Mustang has the webservices features integrated as of b40. You can try the latest snapshot from <a href="https://mustang.dev.java.net/">https://mustang.dev.java.net/</a></p>

<p>We are fixing and integrating bugs on a regular basis. Please let us know about your bugs, you can file them at<br />
<a href="http://bugs.sun.com/bugdatabase/index.jsp">http://bugs.sun.com/bugdatabase/index.jsp</a></p>

<p>There are 4 new scripts added in the jdk6.0/bin which are as follows xjc, schemagen , wsimport and wsgen<br />
To run the JAXB schema compiler  you can  invoke the xjc as</p>

<p>/path/to/jdk6.0/bin/xjc foo.xsd -p test.foo</p>

<p>Similarly to invoke  the schema generator to generate schemas from Java sources</p>

<p>/path/to/jdk6.0/bin/schemagen Foo.java</p>

<p>To generate portable artifacts from wsdls and external jaxws or jaxb binding files you can use wsimport</p>

<p>/path/to/jdk6.0/bin/wsimport stock.wsdl -b stock.xml -b stock.xjb</p>

<p>To generate portable artifacts from Java sources you can use wsgen</p>

<p>/path/to/jdk6.0/bin/wsgen example.Stock</p>

<p><strong>Javadocs for jdk6.0</strong><br />
The javadocs are located at<br />
<a href="http://www.java.net/download/jdk6/doc/api/">http://www.java.net/download/jdk6/doc/api/</a></p>

<p><strong>Forums</strong><br />
<a href="http://forums.java.net/jive/forum.jspa?forumID=25">http://forums.java.net/jive/forum.jspa?forumID=25</a></p>

<p><strong>List of Committed bugs in the latest snapshot release</strong><br />
<a href="https://mustang.dev.java.net/MustangCommittedBugs.html">https://mustang.dev.java.net/MustangCommittedBugs.html</a></p>

<p><strong>More information on JAXB and JAXWS</strong></p>

<p>    *  <a href="https://jaxb2-sources.dev.java.net/">JAXB</a><br />
    *  <a href="https://jax-ws-sources.dev.java.net/source/browse/jax-ws-sources/">JAXWS</a></p>]]>

</content>
</entry>

</feed>