Tuesday, May 18, 2010

Creating the XSD for receiving the input WSDL in SOA Suite 11.1.1.3-part3

In this exercise we will see how we will create an xsd file and then how we will use that xsd file to create a wsdl file out of that.

First of all we will create our xsd file to accept the five input variables for credit card.

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://arpit.rahi/com"
targetNamespace="http://arpit.rahi/com" elementFormDefault="qualified">

<xsd:element name="creditcardInfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="cvvNumber" type="xsd:string"/>
<xsd:element name="f_name" type="xsd:string"/>
<xsd:element name="l_name" type="xsd:string"/>
<xsd:element name="card_no" type="xsd:string"/>
<xsd:element name="expirymonth" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

This is the schema i have created for my use case.It i very simple and as you can see i have a complex element called as creditcardInfo which is of complex type and which contain a sequence of elements which are nothing but the input for a credit card.

Now we will see how to use this xsd to generate a web service in SOA Suite 11g.

Open your jdeveloper 11.1.1.3
Create a new application



Give project name and select SOA technology



Create an empty composite and say Finish



Now if you will your jdeveloper for the new composite created you will find three swinlane

first is Exposed services
second is components and third is external reference.

Exposed services are the starting point for any application.It is exposed to the client ,components section is the one where in we design our application and orchestrate it.External reference section is for communicating with external agents like CRM,DB,file etc.


So in our scenario we need first of all an exposed service which uses our xsd file to generate a web service for the client.

go to you jdeveloper.IN the component choose SOA and drag and drop Web Service in the Exposed service swinlane.As soon as you will drop it a gui will open like this.



Now give some logical name to web service and click on Generate WSDL from schemas.

Once you will click on that following page will open



Click on search icon to find the WSDL file and then this window will come up



Click on import Schema files



Choose the XSD file that we have created



Now in the type choose choose the XSD





Now keep on saying ok





So now you can see in your jdeveloper a web service is created in exposed service.This will accept the credit card information for our project.



That is it for this exercise we will add a BPEL process in next exercise and further design our process.

No comments: