Comments (7)
Hi @oscarAtNava.
Sorry for the late response. I just finished releasing the latest version of Castle Mock (1.19). The release contain a new REST interface for importing projects and SOAP resources. It currently only has those two services, but I will add more in the upcoming releases. I just wanted to get this version released as soon as possible so that you weren't blocked.
The REST API can be viewed with Swagger UI. There is a link to the API in the Castle Mock footer, or you can go to the following page: {CastleMock}/doc/api/rest.
The services requires either modifier or admin authorization. Either a token or basic authentication can be used to authenticate.
For more information regarding basic authentication, please see the following page: https://en.wikipedia.org/wiki/Basic_access_authentication
In your scenario, you need to use both services to import everything. The exported project file does not contain the WSDL file. That one has to be added through the resource service.
Here are two examples on how to use the services. I hope you find them useful.
Import project example:
curl -X POST "http://localhost:8080/castlemock/api/rest/core/project/import?type=SOAP" -H "accept: */*" -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: multipart/form-data" -F "[email protected];type=text/xml"
Import WSDL example:
curl -X POST "http://localhost:8080/castlemock/api/rest/soap/resource?projectId=QrTaXl&resourceType=WSDL" -H "accept: */*" -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: multipart/form-data" -F "[email protected];type="
I hope that this will resolve your problem. I wish you the best of luck with your automated Castle Mock setup. Please feel free to contact me if you have any further questions, suggestions on improvements or if you simply want to tell me how the process is going. All feedback is appreciated. :)
Best regards,
Karl Dahlgren
from castlemock.
Hi @oscarAtNava.
Ironically, there isnβt a REST interface for Castle Mock. However, the whole infrastructure in Castle Mock is built in such a way that it would be easy to add a REST interface in the future. Up until this moment, it has been down prioritised. I was waiting for someone to request it. With that being said, it should be very easy to add these functionalities as a REST interface. If you want, I can add this to Castle Mock in the beginning of next week and then create a new release. How does that sound for you?
Would it be possible for you to provide a list of suggestions on which functionalities you would like the RESR interface to provide?
Thank you.
Best regards,
Karl Dahlgren
from castlemock.
from castlemock.
Thank you Karl, I will take the new version for a spin and let you know.
from castlemock.
Hi @oscarAtNava.
I just wanted to inform you that the upcoming release 1.20 will contain some minor modifications to the REST url. Instead of using request parameters for the identifiers, we will instead be using path parameters.
You will find all the available REST services in the Swagger page in Castle Mock. I hope that this doesn't cause too much problems for you. The functionality is still the same, but the URLs has changed a little bit.
Please contact me if you face any difficulties.
Best regards,
Karl Dahlgren
from castlemock.
from castlemock.
Could you please give me the rest api for import rest xml into the latest version of castlemock
from castlemock.
Related Issues (20)
- Unable to import a rest project HOT 1
- `StrictHttpFirewall#setAllowedHeaderNames` should augment with existing `Predicate`
- Issues with JSON Path HOT 2
- Copy a particular Json object into the response HOT 1
- Pushing request json payload into the response body is failing
- Auto remove of the files HOT 1
- Building and running from maven without installed tomcat HOT 2
- Send multiple responses, with delays, to one request (Asynchronous Responses)
- Switching between different methods with a same type is broken
- tomcat jar file cannot find main method because of typo issue HOT 1
- Expression Validation popup can't pickup response body
- "ReferenceError: arguments is not defined" in react-bootstrap-table2-toolkit
- Is there a way to configure a response by matching a form request?
- Add back dedicated log block on the method page
- Docker - auto import projects and configuration HOT 1
- Internal Server Error when send Content-Type: application/soap+xml
- Import WSDL throws an exception
- Request Query match Get args Error 500
- Unable to upload RAML to a new rest project
- Cannot remove resource in REST project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from castlemock.