1

I am new to web project. So I am learning new things related to it. Yesterday I ask question about how to call method as below. Actually I have a webservice having one WADL file in it. Can I create the object of the class which is running on JBOSS server?

From that I got one reply that u use wadl2java tool which will consume your Application.wadl file and generate java stubs. You can use these generated java classes to invoke the methods on the object deployed in JBoss server.

Accordingly I generate Java Stub which is interface from WADL using wadl2java. But now I want to access the methods from URL of browser. How can I call it?

I have tried in this way.... http://localhost:8080/prjname/rest/methodName

Is it right way to call method from URL?

Please advice

Thanks

1 Answer 1

3

This is what we call standard URL for web services, there is no automatic generated URLs or fixed or predefined URLs to call them.. you have to define URL structure for your project in codebase, you have to declare base url in your web.xml of project (http://localhost:8080/prjname) and further on your java classes and methods (/rest/methodName) using path annotations.

Sign up to request clarification or add additional context in comments.

2 Comments

I tried to access the method from the URL but I am getting certain errors in the browser like: HTTP Status 405 - Method Not Allowed, HTTP Status 401 - Unauthorized. Why it is so?
Ok, have you defined request method of the web service you are calling? Like Post or Get? The same method you defined you will have to use to call web service. Read about Poster (addons.mozilla.org/en-US/firefox/addon/poster) to call web service using required method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.