Menu

Feedback? Improvement suggestions?

2012-10-17
2014-08-21
  • Jacek Obarymski

    Jacek Obarymski - 2012-10-17

    I'm preparing an RC version. Feel free to suggest any improvements. Do you find the app usefull? Any feedback apreciated

     
    • Kirill

      Kirill - 2013-11-27

      Hello, I have a small suggestion.

      Your application rejects requests with Content-Type different than "text/xml".
      Can you add this workaround in the EndPoint Service (line 51):
      @Consumes({MediaType.TEXT_XML, "application/soap+xml"})

      This will allow to process "application/soap+xml" requests correctly instead of generating the 415 HTTP error.

      Thanks.

       
      • Jacek Obarymski

        Jacek Obarymski - 2013-11-28

        Yeah, thanks for suggestion. Although most of the SOAP clients I tried so far send rquests of type "text/xml" but you are right, I'll include the "application/soap+xml" media type in the next release.

         
  • Gonzalo Matheu

    Gonzalo Matheu - 2012-11-29

    Are you planning to support nested resources for REST WS?
    I would find helpful something like:
    * http://server:port/mock/endpoint/{SERVICE[i].TYPE}/{SERVICE[i].NAME}/{RESOURCE_ID[0]}/{RESOURCE_ID[1]}.../{RESOURCE_ID[N]}
    or

     
  • Jacek Obarymski

    Jacek Obarymski - 2012-11-29

    Hi Gonzlao,

    Thanks for your post.
    I understand your suggestion is closer to the nature of real RESTful webservices, however I'm trying to keep the whole thing simple so for know each nested resource of a real RESTful webservice is supposed to be mocked as a separate SERVICE[]. You can configure multiple services and each of the will have a separate URL.

    Anyway, could you elaborate a bit more? Is there any use case in your tests you are not able to address with the current API?

     
  • Gonzalo Matheu

    Gonzalo Matheu - 2012-12-11

    Sure, here is the use case that I'm trying to implement:

    This is the "ws-mock.properties" configuration:
    SERVICE[0].NAME=element
    SERVICE[0].TYPE=REST
    SERVICE[0].OPERATION[0].HTTP_METHOD=GET

    I configure my application using this URL:
    http://localhost:8080/das-mock/endpoint/REST

    And the url that the application tries to use is:
    http://localhost:8080/das-mock/endpoint/REST/data-access/element/BasicAction

    Where
    - data-access is the name of the service
    - element is the name of a method
    - BasicAction is a @Param of this method

    I think it will work for me, if it is possible to specify a name composed with '/'.
    E.g: SERVICE[0].NAME=data-access/element

    Should you have any questions or suggestions, let me know.

     
    • Jacek Obarymski

      Jacek Obarymski - 2013-03-02

      Hi Gonzlao,

      Sorry for the late answer.
      If your links are dynamically constructed it probably won't be possible to use my service. You cant compose service names with '/'.

      It's probably something I'd have to look at.

       
  • Poorna

    Poorna - 2012-12-14

    Hi,

    I don't have much experience on SOAP based services. I am currently working on REST webservices. Could you please give me sample example on how to configure the details for REST based services.

    Thanks in advance!

     
    • Jacek Obarymski

      Jacek Obarymski - 2013-03-02

      Poorna,

      Have a look at the API section, there's and example of REST service configuration:

      https://sourceforge.net/p/soaprest-mocker/wiki/api/

       
  • Rajeev Gautam

    Rajeev Gautam - 2013-03-13

    Hi Jacek,

    I liked this idea and implementation. But the problem is in my case the mock response is in Json. But this app always gives the content-type as application/xml. Which is a issue for us. I did some change in the code so you can also specify something like "SERVICE[0].OPERATION[0].DEFAULT_RESPONSE_CONTENT_TYPE=application/json"
    which is used to setup content type.
    I have changes on my machine let me know if you would like to have a look and commit.

     
  • Jacek Obarymski

    Jacek Obarymski - 2013-03-14

    Hi Rajeev

    Thanks for your interest in the project and the improvement suggestion.
    Your are right, we should add something like this.
    I've added you to the developers list, feel free to create a branch and submit your code.
    Alternatively you can send me a patch.

     
  • Jacek Obarymski

    Jacek Obarymski - 2013-03-23

    OK, I've fixed it in the 1.3.0 release.

     
  • Rajeev Gautam

    Rajeev Gautam - 2013-03-26

    Hi Jacek,

    Thanks for fixing the issue. Does the recoding request feature work for application/json type. I tried but no luck.

    Thanks,
    Rajeev

     
  • Jacek Obarymski

    Jacek Obarymski - 2013-03-27

    Hi Rajeev,

    Recorded requests are still wrapped in a recorded-requests xml tag no matter what types of requests have actually been sent.
    I'm planning to re-implement all verification resources:
    /recorded-requests
    /recorded-resource-ids
    /recorded-request-params
    so that they respond with a content type based on Accept HTTP header sent to them.

     
  • Silentgrave

    Silentgrave - 2013-11-12

    Hi,

    Sorry for my bad english.
    I deploy a test application with your project, but I do not understand how to change the response of the WS dynamically.
    I need to programmatically change the reply that "Mock" me back. Now I can only return to the answer that I set in the file response.xml, when I edit the file with an editor response.xml "Mock" does not seem to feel the difference and gives me back the old contents of the response file. xml.
    can you please post an example of code for a change of the response programmatically?
    Thanks

     
  • Silentgrave

    Silentgrave - 2013-11-13

    Hi,

    I don't use MAVEN project but i found some logic difference between my project and example project.
    Now my project works!

    thanks!

     
  • Nick Denizhenko

    Nick Denizhenko - 2014-04-18

    Hi,

    Whether it is possible to run Mock Server outside of maven build?

    Thanks!

     
  • Jacek Obarymski

    Jacek Obarymski - 2014-04-18

    Sure, Just Download the war file from http://sourceforge.net/projects/soaprest-mocker/files/ and deploy it to a servlet container.

     
    • Nick Denizhenko

      Nick Denizhenko - 2014-05-08

      Thank you for the response!
      Another question, if you don't mind:
      Is it possible to map a request to a response, or I can only set sequential list of responses for a method?

      Thanks!

       
      • Jacek Obarymski

        Jacek Obarymski - 2014-05-10

        Hi Nick,

        No, mapping requests to responses is not possible at the moment.
        Cheers.

         
  • Alina Alam

    Alina Alam - 2014-08-17

    Hi Jacek,

    I am new to the overall concept of "mocking the rest services", therefore, I have one confusion. The mocker works fine for the GET request, but would it actually DELETE, POST or PUT something when these headers are used? Or would the response be just a message telling that the particular item has been deleted successfully?

    Thanks!

     
  • Jacek Obarymski

    Jacek Obarymski - 2014-08-18

    Hi Alina,

    Your second guess is right. The mock would tell you that it received a request.
    In case of POST and PUT you could also get request body (xml or json) so you could build test assertions basing on that.
    If you are familiar with unit testing with Mockito then this is somehow analogous to .verify() when you check a mock object if some method has been invoked on it and with what parameters.

     

    Last edit: Jacek Obarymski 2014-08-18
    • Alina Alam

      Alina Alam - 2014-08-21

      Thankyou. Now it makes sense. So, the mocker will just "mock" the response that the particular item has been deleted/posted/updated in the database but in reality, no such thing would happen. I am familiar with the request body idea that you mentioned and how you can decide whether you want json content or xml.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.