In this article, I'll explain how to create a Web service in NetBeans 6. In this post, I'll discuss how to process a SOAP message before invoking a WEB service operation.
In this case, I'll use JAX-WS 2.1 with NetBeans 6.0 in combination.
Web Services Description Language (WSDL)
There are many ways to develop WEB services. One of them is to create the WSDL. First, you must understand the role of WEB services. You need to consider the input and output of each WEB service operation. In the example of this article, we only created an action with the name "Getcalculatevalues". The input includes two digits, and the result is the sum of two digits.
We will create the following two files:
webservices.wsdl
<?xml version= "1.0" encoding= "UTF-8" standalone= "yes"
<definitions xmlns:ns1= " soapwebservices.jdevelop.eu "xmlns:xsd=" Http://www.w3.org/2001/XMLSchema "xmlns:soap=" http://schemas.xmlsoap.org /wsdl/soap/"xmlns=" http://schemas.xmlsoap.org/wsdl/"xmlns:ns=" http://schemas.xmlsoap.org/soap/encoding/"Name=" Soapwebservices "targetnamespace=" "soapwebservices.jdevelop.eu"
<types>
<xsd:schema>
<xsd:import namespace= "soapwebservices.jdevelop.eu" schemalocation= "webservices.xsd"/>
</xsd:schema
</types>
<message name= "calculatevalues"
<part name= "Calculatevalues element=" ns1: Calculatevalues "/>
</message>
<message name=" Calculatevaluesresponse "
<part name=" Calculatevaluesresponse "element=" Ns1:calculatevaluesresponse "/>
</message>
<portType name=" Soapwebservices ""
<operation name= "getcalculatevalues"
<input message= "Ns1:calculatevaLues "/>
<output message=" Ns1:calculatevaluesresponse "/>
</operation>
</portType>
<binding name= "soapwebservicesportbinding" type= "ns1:soapwebservices"
<soap:binding style= " Document "transport=" Http://schemas.xmlsoap.org/soap/http "/>
<operation name=" Getcalculatevalues ">
<soap:operation soapaction= "urn:http://blog.jdevelop.eu/services/getcalculatevalues"/&g t;
<input>
<soap:body use= "literal"/>
</input>
<output>
<soap:body use= " Literal "/>
</output>
</operation>
</binding>
<service name=" Soapservice "
<port name= "webservices" binding= "ns1:soapwebservicesportbinding"
<soap:address location= " Http://blog.jdevelop.eu:80/services "/>
</port>
</service>
</definitions>