Wednesday, 26 July 2017

Create Web Service Stub or Proxy Classes - Using wsimport


Steps to Create Web Service Stub

This document gives instructions on creating web service stubs better knowas proxy classes. We will take an example and proceed with the explanation.

STEP 1:

Copy the URL link in the browser address bar and hit enter.Check if the WSDL is accessible through your network or not.

STEP 2:

Download the WSDL file in a folder and should be saved with the ".wsdl" extension.

STEP 3:

Now start to download the artifacts in a folder in your local drive.This should include the WSDL file and all the associated XSDs. The XSD files can be downloaded from the links found inside the downloaded WSDL file.

STEP 4:

Go into the WSDL file.You will see a section having the schemas.

STEP 5:

Rename the XSD Http links.Point it to the local path of the XML Schemas.

STEP 6:

Open a command prompt and check the "wsimport" tool.

STEP 7:

We will use the wsimport and the associated commands to create the stubs.Please check the snap shot below f the command prompt.The command is like:wsimport -keep -extensionThere are many associated commands. We need to use them as and when required.

STEP 8:

After the previous command we can see folders created in the same destination of the artifact files.

STEP 9:

Copy this folders in the “src” folder of your JAVA project in your IDE.It should look like this ad you are good to go.

 

No comments:

Post a Comment

Coder Magnet
CoderMagnet is full of resources from our daily development activities. It has solutions for common problematic scenarios in technologies like Java 8, AEM, JCR and also occasionally gives you tips on Blogger as well.