Sriks
Sriks

Reputation: 678

How can I create Endpoint for WebService?

How can I create an Endpoint for a web service? I am a beginner to the web services world.

I have got the WSDL and I would like to create a web service based on that WSDL. I have used Apache CXF to generate client stubs. What would be the next steps to test it as a service?

How can I create EndPoints?

How can I mimic the WSDL soapbind address locally and test it?


Let me clarify the Question. Looks like there is confusion. Thanks @Buhake Sindi for point it out.

I have got the WSDL and generated the Client stubs by using Apache CXF Framework in Eclipse. I need to test the WebService client code whether its working or not. How to test this approach now? My WSDL URL is not working at this moment.

How to test my client stub(from generated Impl Class)?

Do I need to create any Endpoints to mimic the WSDL URL(which is not running now)?

Hope the Question is clear now...

Upvotes: 5

Views: 4693

Answers (2)

Charu Khurana
Charu Khurana

Reputation: 4551

You can test client code even without creating web service implementation also. Are you aware of SoapUI tool? Use that to import the wsdl to create a project.

It gives you the option to create a mock service also along with the request. You can run that mock service and test your client against that service without writing any service code. I use it for testing all the time. Also you can create Success, Failure, and Fault response to test different scenarios. Mock service will also show you the request received by the service. This feature works like a charm. Let me know if you need help in setting up mock service in SoapUI.

You may follow this link to get started: http://www.soapui.org/Getting-Started/mock-services.html

Upvotes: 1

bmargulies
bmargulies

Reputation: 100051

You run wsdl2java from CXF to generate server-side stubs. Then you fill in the code in the stubs. Then you set up a service to deploy.

There is no mechanism I know if that will create mock services. What would you expect them to do?

See the samples from the CXF distribution, particularly the wsdl-first samples.

A better approach would be to use JMock to mock the client side SEI, and not try to come up with a dummy service.

Upvotes: 0

Related Questions