Sei sulla pagina 1di 17

CREATINGWEBSERVICESWITH ECLIPSE

UsingAPACHETOMCATandAXIS

Burhanimen,Aradiom

Agenda
Creatingtheproject CreatingtheWSDLfile(s) GeneratingJavaBeanSkeleton TestingwithWebBrowser GeneratingClientApplication

CreatingOurProject

FirstchoosetocreatetheDynamicWebProject

CustomizingProjectFacets

Intheprojectfacets,wechoosethefacetsweneed. HereweonlyneedJava,andDynamicWebModule.NevermindApacheAxis2now.

CreatingWSDLFile

ThefirstthingtodowhilecreatingwebservicesiscreatingourWSDLfile. TocreateWSDLfileineclipse,chooseNew>WSDL

SOAPBindingOptions

WhilecreatingnewWSDLfile,EclipsepromptsustochooseSOAPbindingoptions whichare:
Documentliteral RPCliteral RPCEncoded

YoumayfindextendedinformationabouttheseWSDLtypeshere

CreatingNewTypesonWSDL

InanewlygeneratedWSDLdesign,thetypesarealldefaultasstring. Butyoumaywanttochangethemaccordingtoyourneeds. Choosenewfromthetypecomboboxandcontinue. ComplextypeaddsadditionalpropertieslikeaddingXMLSchemas. SinceTypeturnsouttobeanewclassaftergeneration,weuse capital

WSDLDesign

AftercreatingnewType,wemayneedsomeelementsforthistype. Thiselementswillturnouttobeattributesofourgeneratedclass. DesignafterRightClick>NewElementisabove. AfterallofthecustomizationsonWSDL,wemustgeneratebindingcontentinordertohavethe modificationsappliedinthecode.

GenerateBindingContent

GeneratebindingcontentoptionsarethesameasexplainedinSOAP BindingOptions. Differentlyweshouldchoosetooverwriteexistingbindinginformation

WSDLCode

ThegeneratedWSDLcodeisabove,asyouseeitisaspeciallyformattedXMLfile.

GeneratingJavaBeanSkeleton

AfterthecreationofourWSDLfilefinished,wemustcreateJavaBeanskeletoninorderto haveourjavasourceandclassfiles.

GeneratingJavaBeanSkeleton
Wemustfirstchoosetomonitor webservicetobeabletomonitorthe changesfromeclipseGUI. Clicknext.Belowscreenappearsand clickStartServer. Becarefultostoptheserverbefore clickingstartserverbuttonbecauseit returnswitherrorinthatcase.

GeneratedSourceCodes

Nowwecanseegeneratedsourcecodesfromourprojectexplorer.Thegenerated NewType.javaisabove.

EgitimSOAPImplclassisourserverimplementationclasswhichwe shouldimplementourserverrequirements.

GeneratingClientApplication

Weshouldchoosegenerateclientfrompictureontheleftside. Clickfinishonthescreenrightside.

GeneratingClientApplication

Aftergeneratingclassesofnecessary,wemustgenerateaclassthatgeneratesProjectNameProxy objectandimplementstheclient.

TestingtheApplication

TotesttheapplicationweneedtochoosetheoptionofTestwithWebBrowser. Totestwemustgiveaurllikebelow:
http://localhost:8080/egitim/services/egitimSOAP Itistheendpointurlofourservice.

Potrebbero piacerti anche