creating webservices with eclipse and axis
TRANSCRIPT
-
7/28/2019 Creating Webservices With Eclipse and Axis
1/17
CREATINGWEBSERVICESWITHECLIPSEUsingAPACHETOMCATandAXIS
Burhanimen,Aradiom
-
7/28/2019 Creating Webservices With Eclipse and Axis
2/17
Agenda
Creatingtheproject
CreatingtheWSDLfile(s)GeneratingJavaBeanSkeleton
TestingwithWebBrowser
GeneratingClientApplication
-
7/28/2019 Creating Webservices With Eclipse and Axis
3/17
CreatingOurProject
FirstchoosetocreatetheDynamicWebProject
-
7/28/2019 Creating Webservices With Eclipse and Axis
4/17
CustomizingProjectFacets
Intheprojectfacets,wechoosethefacetsweneed.
Herewe
only
need
Java,
and
Dynamic
Web
Module.
Nevermind
Apache
Axis2
now.
-
7/28/2019 Creating Webservices With Eclipse and Axis
5/17
CreatingWSDLFile
ThefirstthingtodowhilecreatingwebservicesiscreatingourWSDLfile. TocreateWSDLfileineclipse,chooseNew>WSDL
-
7/28/2019 Creating Webservices With Eclipse and Axis
6/17
SOAPBindingOptions
WhilecreatingnewWSDLfile,EclipsepromptsustochooseSOAPbindingoptionswhichare: Documentliteral RPCliteral RPCEncoded
Youmay
find
extended
information
about
these
WSDL
types
here
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ -
7/28/2019 Creating Webservices With Eclipse and Axis
7/17
CreatingNewTypesonWSDL
InanewlygeneratedWSDLdesign,thetypesarealldefaultasstring. Butyoumaywanttochangethemaccordingtoyourneeds. Choosenewfromthetypecomboboxandcontinue. ComplextypeaddsadditionalpropertieslikeaddingXMLSchemas. SinceTypeturnsouttobeanewclassaftergeneration,weuse
capital
-
7/28/2019 Creating Webservices With Eclipse and Axis
8/17
WSDLDesign
AftercreatingnewType,wemayneedsomeelementsforthistype. Thiselementswillturnouttobeattributesofourgeneratedclass. DesignafterRightClick>NewElementisabove.
AfterallofthecustomizationsonWSDL,wemustgeneratebindingcontentinordertohavethemodificationsappliedinthecode.
-
7/28/2019 Creating Webservices With Eclipse and Axis
9/17
GenerateBindingContent
GeneratebindingcontentoptionsarethesameasexplainedinSOAPBindingOptions.
Differentlyweshouldchoosetooverwriteexistingbindinginformation
-
7/28/2019 Creating Webservices With Eclipse and Axis
10/17
WSDLCode
Thegenerated
WSDL
code
is
above,
as
you
see
it
is
a
specially
formatted
XML
file.
-
7/28/2019 Creating Webservices With Eclipse and Axis
11/17
GeneratingJavaBeanSkeleton
AfterthecreationofourWSDLfilefinished,wemustcreateJavaBeanskeletoninordertohaveourjavasourceandclassfiles.
-
7/28/2019 Creating Webservices With Eclipse and Axis
12/17
GeneratingJavaBeanSkeletonWemustfirstchoosetomonitorwebservicetobeabletomonitorthechangesfromeclipseGUI.Clicknext.BelowscreenappearsandclickStartServer.
Becareful
to
stop
the
server
before
clickingstartserverbuttonbecauseitreturnswitherrorinthatcase.
-
7/28/2019 Creating Webservices With Eclipse and Axis
13/17
GeneratedSourceCodes
Nowwecanseegeneratedsourcecodesfromourprojectexplorer.ThegeneratedNewType.javaisabove.
-
7/28/2019 Creating Webservices With Eclipse and Axis
14/17
EgitimSOAPImplclassisourserverimplementationclasswhichweshouldimplementourserverrequirements.
-
7/28/2019 Creating Webservices With Eclipse and Axis
15/17
GeneratingClientApplication
Weshouldchoosegenerateclientfrompictureontheleftside. Clickfinishonthescreenrightside.
-
7/28/2019 Creating Webservices With Eclipse and Axis
16/17
GeneratingClientApplication
Aftergeneratingclassesofnecessary,wemustgenerateaclassthatgeneratesProjectNameProxyobjectandimplementstheclient.
-
7/28/2019 Creating Webservices With Eclipse and Axis
17/17
TestingtheApplication
TotesttheapplicationweneedtochoosetheoptionofTestwithWebBrowser. Totestwemustgiveaurllikebelow:
http://localhost:8080/egitim/services/egitimSOAP
Itistheendpointurlofourservice.
http://localhost:8080/egitim/services/egitimSOAPhttp://localhost:8080/egitim/services/egitimSOAP