Skip to Content
author's profile photo Former Member
Former Member

Exposing own customize rest Api through Ycommercewebservice

I have a requirement something like we have to expose our own rest api, for the same i have created a extension using "ycommercewebservice" with "" as reference. Then i have created my own controller which is extending the BaseController.While i am hitting it through "http://localhost:9001/moltcommercewebservice/v2/wsp/getwspWS" browser i got some error like "Base site not configured " then i created a site "wsp", again when i hit it getting some error like

There is no resource for path /moltcommercewebservice/v2/wsp/getwspWSUnknownResourceError

Kindly let me know how to resolve this issue.

Also hitting from " rest client" do i need to do some configuration setting.

Below is my controller class whic is for testing purpose.

@Controller @RequestMapping(value = "/v2/wsp") public class ProductGWPController extends BaseController { / @return / @RequestMapping(value = "/getwspWS", method = RequestMethod.GET) public String getWSP() { System.out.println("i am here to see you "); return "i am here to see you *"; }


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 19, 2015 at 10:51 AM

    I had similar problems, and found a few things you might want to check:

    • use https instead of http

    • url: https://localhost:9002/v2/articles/12345/

    • RequestMapping class: @RequestMapping(value = "/{baseSiteId}/articles")

    • RequestMapping method: @RequestMapping(value = "/{id}", method = RequestMethod.GET)

    • When you specify consumes = { MediaType.APPLICATION_JSON_VALUE} make sure to add the header in your client: Content-Type: application/json

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.