Creating a SOAP Web service in NetBeans 6

Source: Internet
Author: User
Tags soap web services xmlns netbeans wsdl

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.