Sunday, July 4, 2010

Creating a WSDL Document - Part 2 of Creating your own Webservices in JDeveloper11g


I will continue the topic of Creating your own webservices in JDeveloper and extend my last post "Creating XML Schema" in this post we will look how to create a WSDL Document, define the operations that our webservice will perform  and bind it with the XML Schema.

  • Right click the same project and choose New go to Webservices > WSDL document as shown in the slide, enter the name of the WSDL document.

  • You will see the screen similar to this

  • Now here is the little tricky part we are required to work with XML schema and WSDL at the same time and actually we can work as well so, open the XML Schema and open WSDL Document, switch to wsdl and drag the WSDL to the center bottom of the screen and drop your screen will split into 2 documents as shown in the slide.

  •  Now we can see both documents, now we have to define operations of the webservice but for this we need to have a PORT so, now press the green plus sign on the Port Type section and give it a name myPortType and press OK

  • To define operations drag the "operation" from the component palette to the port type and give a name  "getCreditCardStatus" and press OK. the operation we have defined will be  available to the consumer of the webservice you can define as many as required for simple case we are keeping to one operation.

  • Now expand the port type section as you can see the Input and output parameters are available, to link them with the XML Schema types, drag the "CreditCardRequest" element from XML Schema and drop into the INPUT parameter of getCreditCardStatus Operation.
  • Repeat the same for CreditCardResponse as OUTPUT in our operation.

  • Now drag the myPortType as a whole and drop into the Bindings sections, dialog box will appear ask you to define the type of Binding choose Soap12 leave others as default.

  • Now drag and drop the Bindings into the Services section.

Thats all for Part 2 we have succesfully completed the WSDL document.

Next Step: Generate a webservice code from WSDL document.

Happy JDeveloping,

No comments:

Post a Comment