8000 FAQ · castlemock/castlemock Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Karl Dahlgren edited this page Jul 13, 2020 · 8 revisions

Table Of Content

I get an error when I upload my WSDL file. Why?

WSDL files can be quite tricky to parse and we notice that a lot of WSDL files are structured differently. For that reason, we have experienced issues with parsing WSDL files. We are more than happy to help you to figure out why Castle Mock is unable to parse your WSDL file. However, the WSDL file NEEDS TO be obfuscate and minimized before before sending it to us. We will NOT accept any WSDL files that can be connected or associated with a company, organization or government. Please send the WSDL file as an attachment and not as a link.

How do I load project files directly after the Docker container is initiated?

There are two ways to achieve this:

  1. Docker volume: Create a Docker volume and store the Castle Mock files outside the Docker container. More information and example can be found on the following wiki page: https://github.com/castlemock/castlemock/wiki/Docker#persistence
  2. REST API: Use Castle Mock's REST API to import projects once the Docker container is initiated. The REST API documentation can be found within Castle Mock by going to the following address: http://{CONTAINER IP}:8080/castlemock/doc/api/rest. The 'Import project' service can be found under the 'Core' and takes the project type (soap/rest) and the file that you wish to import. You also need to provide a basic authorization header for authorization. The basic authorization header value is the username and password combined with a colon (:) with a Base64 encoding (More information about basic authorization can be found here: https://en.wikipedia.org/wiki/Basic_access_authentication).

Example

The following example uploads a SOAP project with the username 'admin' and password 'admin':

curl -X POST "http://{CONTAINER IP}:8080/castlemock/api/rest/core/project/soap/import" 
-H "accept: /" 
-H "Authorization: Basic YWRtaW46YWRtaW4=" 
-H "Content-Type: multipart/form-data" 
-F "file=@project-soap-QrTaXl.xml;type=text/xml"

Disable SSL and TLS certificate validation

Castle Mock will by default validate the SSL/TLS certificate when connecting to external resource, such as when downloading WSDL or forwarding to another endpoint. Connecting to resource that has an invalid certificate will be rejected and fail. However, in certain scenarios you might want to disable to certificate validation, such as when testing internal environments. The certificate validation can therefore be disabled by setting the following variable to false: http.sslverify.

Example:

-Dhttp.sslverify=false

Max size for uploaded files

The max size for files being uploaded to Castle Mock is currently 20MB. It was previously using the implementation default value which is 1MB, but has been overridden to 20MB since 1.38.

You can still increase the max size if 20MB isn't enough for you. This is done by providing the following property as a JVM argument: server.upload.max-size

Example:

 server.upload.max-size=50MB
Clone this wiki locally
0