- Now we'll generate the client for the newly created service by referring the ?wsdl generated by the Axis2 Server. Open File -> New -> Other... -> Web Services -> Web ServiceClient
- Paste the URL that was copied earlier into the service definition field.
- Click on the Client project hyperlink and enter Axis2WSTestClient as the name of the client project. Click OK.
- Back on the Web Services Client wizard, make sure the Web service runtime is set to Axis2 and the server is set correctly. Click Next.
- Next page is the Client Configuration Page. Accept the defaults and click Finish.
- The Clients stubs will be generated to your Dynamic Web project Axis2WSTestClient.
- Now we are going to write Java main program to invoke the client stub. Import the ConverterClient.java file to the workspace into the wtp package in the src folder of Axis2WSTestClient.
- Then select the ConverterClient file, right-click and select Run As -> Java Application. Here's what you get on the server console:
If it give endpoint exception, you can replace the code with as under
StudentWS_PortType port = service.getStudentWSPort();
port.setStudentData(std);
No comments:
Post a Comment