Sunday October 08, 2006
J2SE Web Services
To create a web service you don't need to have an Application server (or Web server) installed. This is an illustration how the simple web service can be created in Netbeans5.5 Java Project. I was inspired by a Robert Eckstein and Rajiv Mordani's article about JAX-WS 2.0 With the Java SE 6 Platform and Petr Blaha's blog: Developing Web services for Mustang in Netbeans.
Now in Netbeans5.5 there is a JAX-WS 2.0 technology integrated, which
enables you to create and consume web services in Netbeans projects.
What is actually supported is :
What's is not supported yet is Web
Service Creation in raw Java
Application (J2SE Project).
This is a simple workaround how simply this feature can be achieved in
Netbeans5.5.
package geometricalws;(Notice that except of @WebService annotation, @WebMethod and @WebParam annotations are used to annotate web service operations and their parameters.
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService(name="Circle", serviceName="CircleService", portName="CirclePort")
@SOAPBinding(style=SOAPBinding.Style.RPC)
public class CircleFunctions {
@WebMethod(operationName="area")
public double getArea(@WebParam(name="r")double r) {
return java.lang.Math.PI * (r * r);
}
@WebMethod(operationName="circumference")
public double getCircumference(@WebParam(name="r")double r) {
return 2 * java.lang.Math.PI * r;
}
}
package geometricalws;(see that the URL address for web service and an instance of CircleFunction class should be specified in publish method)
import javax.xml.ws.Endpoint;
public class Main {
public static void main(String[] args) {
String wsAddress = "http://localhost:8765/GeometricalWS/CircleFunctions";
Endpoint.publish(
wsAddress,
new CircleFunctions());
System.out.println("Web service was published successfuly.\n"+
"WSDL URL: "+wsAddress+"?WSDL");
// this is the way to make the local web server running until the process is killed
while (true) {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>SOAP Response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<ans:area xmlns:ans="http://x/">
<r>10.0</r>
</ans:area>
</soapenv:Body>
</soapenv:Envelope>
<?xml version="1.0" encoding="UTF-8"?>This is the excelent article comparing various (SOAP) binding styles: http://www-128.ibm.com/developerworks/webservices/library/ws-whichwsdl/
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<ans:areaResponse xmlns:ans="http://x/">
<return>314.1592653589793</return>
</ans:areaResponse>
</soapenv:Body>
</soapenv:Envelope>

Posted at 01:30PM Oct 08, 2006 by Milan Kuchtiak in NetBeans | Comments[26]
Posted by Geertjan on October 10, 2006 at 08:49 PM CEST #
thx
Posted by online radyo on April 02, 2008 at 08:08 PM CEST #
thx
Posted by bedava radyo on April 02, 2008 at 08:08 PM CEST #
thx
Posted by canli radyo dinle on April 02, 2008 at 08:09 PM CEST #
thanks ;)
Posted by canli tv izle on April 02, 2008 at 08:09 PM CEST #
thanks
Posted by powerfm on April 02, 2008 at 08:09 PM CEST #
Thanks for this
Posted by youtube on June 16, 2008 at 05:23 PM CEST #
thnx
Posted by Driver indir on September 26, 2008 at 09:27 PM CEST #
Thank you very much for this information. I like this site
Posted by evden eve nakliyat on October 09, 2008 at 11:39 AM CEST #
Thank you very much for this information. I like this site
Posted by ankara evden eve on October 09, 2008 at 11:40 AM CEST #
Thank you very much for this information. I like this site
Posted by ankara nakliyat on October 09, 2008 at 11:40 AM CEST #
Thank you very much for this information. I like this site
Posted by evden eve on October 09, 2008 at 11:40 AM CEST #
Thank you very much for this information. I like this site
Posted by nakliye on October 09, 2008 at 11:41 AM CEST #
Thank you very much for this information. I like this site
Posted by ankara evden eve nakliyat on October 09, 2008 at 11:41 AM CEST #
Thank you very much for this information. I like this site
Posted by nakliyat on October 09, 2008 at 11:42 AM CEST #
thanks you site admins wery good
Posted by seks shop on October 17, 2008 at 09:15 PM CEST #
http://www.batteryfast.co.uk/toshiba/pa3128u-grey.htm toshiba pa3128u grey battery,
http://www.batteryfast.co.uk/toshiba/pa3191u-grey.htm toshiba pa3191u grey battery,
http://www.batteryfast.co.uk/toshiba/te2000-grey.htm toshiba te2000 grey battery,
http://www.batteryfast.co.uk/acer/batcl32.htm acer batcl32 battery,
http://www.batteryfast.co.uk/acer/batcl32l.htm acer batcl32l battery,
http://www.batteryfast.co.uk/acer/btp-as2000.htm acer btp-as2000 battery,
http://www.batteryfast.co.uk/acer/btp-73e1.htm acer btp-73e1 battery,
http://www.batteryfast.co.uk/acer/travelmate-370.htm acer travelmate 370 battery,
http://www.batteryfast.co.uk/acer/travelmate-380.htm acer travelmate 380 battery,
http://www.batteryfast.co.uk/acer/batelw80l8h.htm acer batelw80l8h battery,
http://www.batteryfast.co.uk/acer/batelw80l8.htm acer batelw80l8 battery,
Posted by Mark Oiness on October 24, 2008 at 07:11 AM CEST #
Great Job!
Posted by Electronic Cigarette on November 24, 2008 at 07:59 AM CET #
http://www.netzurna.com
http://www.kelebekcafe.net
http://www.dorukchat.net
http://www.kelebekcafe.org
http://www.mirclider.org
http://www.mirclider.net
http://www.mirclider.com
http://www.gevezechat.org
http://www.dorukchat.org
http://www.onursan.org
http://www.cinselchat.org
Posted by mirc on December 07, 2008 at 06:35 PM CET #
http://www.mynetchat.org
http://www.kizlarlachat.org
http://www.dorukfm.org
http://guzelsozler.mirclider.com
http://blog.mirclider.com
http://arge.mirclider.com
http://video.mirclider.com
Posted by kelebek on December 07, 2008 at 06:36 PM CET #
A laser system <a href="http://www.dali-cnc.com/laser-machine.asp">laser machine</a> can be used as a stand-alone machine guidance display or as a component of a complete automatic grade control system. When a laser beam strikes the receiver <a href="http://www.dali-cnc.com/vinyl-cutter.asp">vinyl cutter</a> vinyl cutter, the operator then puts the machine in automatic mode to conduct machine control. If the contractor uses the system <a href="http://www.dali-cnc.com/china-cnc-router.asp">china CNC router</a> china CNC router for visual guidance, then the operator would compensate with manual adjustments called for by the system <a href="http://www.dali-cnc.com/engraving-machine.asp">engraving machine</a> engraving machine. Projects conducive to using lasers without machine <a href="http://www.dali-cnc.com/cnc-machines.asp">CNC machines</a> CNC machines automation include placing pads, performing formwork, setting foundations or footings, achieving depth control for sub-base excavation and conducting finish grade work. Laser systems can control as many pieces of equipment as needed, provided there is line of sight to the laser and the same grade or elevation is required.
Posted by Tamper evident labels on December 10, 2008 at 10:32 AM CET #
Rings, anklets, neck laces, pendants, bracelets etc are some of the black pearl jewelry http://www.worldchen.com/fashion-jewelry-suppliers.html fashion jewelry suppliers available for buying. Black pearl jewelry http://www.worldchen.com/stainless-steel-bangle.html stainless steel bangle is suitable for wearing in certain occasions. It really suits people who are really fair as black is in sharp contrast to their body color. Black pearl pendants http://www.worldchen.com/stainless-steel-pendant.html stainless steel pendant with diamond, silver supports are available. In certain watches black pearls are added in the chain to give aesthetic and charming look. These watches are more of a jewelry item. Black pearl jewelry http://www.worldchen.com/stainless-steel-necklace.html stainless steel necklace is suitable for weddings. There are black wedding or bridal jewelry collections targeting people who are marrying shortly.
Necklaces of black pearls http://www.worldchen.com/stainless-steel-earring.html stainless steel earring are made more attractive with usage of silver, carbon and some other ribbons. Jewel houses have good collection of black pearls. In olden ages pearls were very precious than some of other precious stones. In this 21st century the price may have changed but the charm of the pearls are still appealing. Black pearl jewelry http://www.worldchen.com/titanium-jewelry-wholesale.html titanium jewelry wholesale can make you look pleasant for any occasion.
Posted by Electronic Cigarette Supplier on December 10, 2008 at 10:35 AM CET #
http://www.tiffanysjewelry.co.uk
http://www.idealtest.net
Posted by tiffanys jewelry on February 09, 2009 at 09:10 AM CET #
http://www.magicplast.com/yuz-estetigi/2.html
http://www.magicplast.com/smartlipo.html
http://www.magicplast.com/burun-estetigi-burun-ameliyati/index.php
http://www.hemenarac.com
http://www.kardeslerrentacar.com
http://www.otokiraliyorum.net
http://www.magicsacekimi.com
http://www.yazgulu.com
http://www.yazgulu.com.tr
http://www.yazgulu.info
http://www.teknettasarim.com
http://www.burun-estetigi.info
http://www.estetikistanbul.info
Posted by minibüs kiralama on May 08, 2009 at 12:51 PM CEST #
http://www.magicplast.com/yuz-estetigi/2.html
http://www.magicplast.com/smartlipo.html
http://www.magicplast.com/burun-estetigi-burun-ameliyati/index.php
http://www.hemenarac.com
http://www.kardeslerrentacar.com
http://www.otokiraliyorum.net
http://www.magicsacekimi.com
http://www.yazgulu.com
http://www.yazgulu.com.tr
http://www.yazgulu.info
http://www.teknettasarim.com
http://www.burun-estetigi.info
http://www.estetikistanbul.info
Posted by minibüs kiralama on May 08, 2009 at 12:53 PM CEST #
<p>You are right, I believe that there will be many readers like you</p>
<p><A href="http://www.bestlouisvuitton.com/chanel-bags-chanel-cambon-c-234_255.html">Chanel Cambon</A>?<A href="http://www.discount-christianlouboutin.com/christian-louboutin-c-13.html">Christian Louboutin</A>?<A href="http://www.bestlouisvuitton.com/chanel-bags-c-234.html">Chanel Bags</A> <A href="http://www.bestlouisvuitton.com/chanel-bags-chanel-clutches-c-234_244.html">Chanel Clutches</A> <A href="http://www.discount-christianlouboutin.com/jimmy-choo-c-14.html">Jimmy Choo</A>
</p>
<p><A href="http://www.bestlouisvuitton.com/chanel-bags-chanel-denim-handbags-c-234_245.html">Chanel Denim Handbags</A>?<A href="http://www.discount-christianlouboutin.com/manolo-blahnik-c-15.html">Manolo Blahnik</A> <A href="http://www.bestlouisvuitton.com/chanel-bags-chanel-nappa-handbags-c-234_249.html">Chanel nappa handbags</A></p>
<p><A href="http://www.discount-christianlouboutin.com/yves-saint-lauret-c-16.html">Yves Saint Lauret</A>?<A href="http://www.buylouboutin.com/christian-louboutin-boots-c-67.html">Christian Louboutin Boots</A> <A href="http://www.yitingbuy.com/gucci-handbags-c-138_140.html">Gucci Handbags</A></p>
<p><A href="http://www.discount-christianlouboutin.com/">discount christianlouboutin</A><A href="http://www.buylouboutin.com/manolo-blahnik-c-68.html">Manolo Blahnik</A> <A href="http://www.yitingbuy.com/gucci-bags-c-138.html">Gucci Bags</A>?<A href="http://www.yitingbuy.com/gucci-handbags-c-138_140.html"></A></p>
<p><A href="http://www.buylouboutin.com/jimmy-choo-c-72.html">Jimmy Choo</A>? <A href="http://www.yitingbuy.com/gucci-wallets-c-138_139.html">Gucci Wallets</A>?<A href="http://www.bestlouisvuitton.com/louis-vuitton-bags-c-200.html">Louis Vuitton Bags</A></p>
<p><A href="http://www.buylouboutin.com/yves-saint-lauret-c-73.html">Yves Saint Lauret</A>? <A href="http://www.buylouboutin.com/yves-saint-lauret-c-73.html">YSL</A>?<A href="http://www.buylouboutin.com/">Christian Louboutin</A>?</p>
<p><A href="http://www.bestlouisvuitton.com/">http://www.bestlouisvuitton.com/</A></p>
<p><A href="http://www.buylouboutin.com/">http://www.buylouboutin.com/</A></p>
<p><A href="http://www.yitingbuy.com/">http://www.yitingbuy.com/</A></p>
<p><A href="http://www.discount-christianlouboutin.com/">http://www.discount-christianlouboutin.com/</A></p>
<p> </p>
Posted by dfgdf on October 05, 2009 at 08:58 AM CEST #