WSDL program

Make a project in Netbeans.Develop an Simple WSDL document in rpc/literal using NetBeans WSDL Designer

WSDL program

WSDL program


Project Requirement

Make a  project in Netbeans.Develop an Simple WSDL document in rpc/literal using NetBeans WSDL Designer.Create a operation for calculator named int add(int x, int y)

  • Develop  a web project
  • Take a WSDL file
  • Develop code for WSDL file

Create Project

  • Make a new web project
  • Give the project name as WSDL-project as given in below in Figure.1.

WSDL program

Figure. 1

  • Now select the server as the glassfish as give below in Figure. 2.

WSDL program

Figure. 2

Create WSDL file

  • Right-click on the project node WSDL-project -> New -> File/Folder
  • Then select xml. From xml tab select WSDL Document as given below in Figure.3.

WSDL program


  • Give the file name  as WSDL1 for the WSDL-project. as given below in Figure.4.

WSDL program


Click on the Browser Button and Select  the folder WSDL-project as given below in Figure5

WSDL program


  • Now in figure below change the input and output part name as given below in Figure.6.

WSDL program

  • Give the input Message part name as x   with element or Type as xsd:int
  • Give the input Message part name as y   with element or Type as xsd:int
  • Give the output Message part name as result  with element or Type as xsd:int

   As given below in Figure.7

WSDL program


  • Now Click   on the Next
  • In the next step give Binding name as WSDL1Binding
  • Binding type as SOAP
  • Binding subtype as RPC Literal as shown below in Figure.8

WSDL program


  • It  generates the WSDL  file as given in WSDL tab as shown below in Figure. 9.

WSDL program
     Figure. 9

  • In the source view click
  • You will  find source generated

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="WSDL1" targetNamespace=""
  xmlns:xsd="" xmlns:tns="" xmlns:plnk="" xmlns:soap="">
  <message name="addRequest">
  <part name="x" type="xsd:int"/>
  <part name="y" type="xsd:int"/>
  <message name="addResponse">
  <part name="result" type="xsd:int"/>
  <portType name="WSDL1PortType">
  <operation name="add">
  <input name="input1" message="tns:addRequest"/>
  <output name="output1" message="tns:addResponse"/>
  <binding name="WSDL1Binding" type="tns:WSDL1PortType">
  <soap:binding style="rpc" transport=""/>
  <operation name="add">
  <input name="input1">
  <soap:body use="literal" namespace=""/>
  <output name="output1">
  <soap:body use="literal" namespace=""/>
  <service name="WSDL1Service">
  <port name="WSDL1Port" binding="tns:WSDL1Binding">
  <soap:address location="http://localhost:${HttpDefaultPort}/WSDL1Service/WSDL1Port"/>
  <plnk:partnerLinkType name="WSDL1">
  <!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
  <plnk:role name="WSDL1PortTypeRole" portType="tns:WSDL1PortType"/>

Download Code