> For the complete documentation index, see [llms.txt](https://community-test.logicnets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://community-test.logicnets.com/release-9/design-considerations-and-frameworks/frameworks/web-services-framework/webservice-requestresponse-validation.md).

# Webservice Request/Response Validation

## Description

The LogicNets WebService Framework (WSF) offers tools that allow you to validate the requests and responses of inbound web service calls based on an Open API-based specification (<https://www.openapis.org/>) you create. You can write these specifications with online tools like Swagger (<https://swagger.io/>) and upload them to your Web Service project documents folder with names like *api.yaml* or *api.json*.

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-7b0dd6ef4eda5722392b825757e101d1e669e347%2F85e7cb10-f718-402a-a75b-b107f8f4d0a0.png?alt=media)

**Used With:** WebService Framework

## Details

Users with the role *openapi* in their WSF project can download the specification at *https\://\[host/company]/WSFExample/openapi/spec*.

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-fe4119c6dd875fc4e5b1556109207a85ec2529d9%2F4fd691ae-b1cf-45a3-9685-4421e2a91cef.png?alt=media)

You can also access an interactive user interface at *https\://\[host/company]/WSFExample/openapi/apidoc*.

You can validate the input request and the generated output response against the specification by passing a special header with the request:

* LN-INFO-REQUEST: WSF-VALIDATION-REQUEST,WSF-VALIDATION-RESPONSE or
* LN-INFO-REQUEST: WSF-VALIDATION-REQUEST or
* LN-INFO-REQUEST: WSF-VALIDATION-RESPONSE

The system can enforce validation with each request, and you configure this on the *General* tab in the SystemConfiguration module:

![](https://2802811211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdFhfexCjZ5JMhwGzzywq%2Fuploads%2Fgit-blob-13cfe21bf3f0c942cea6f70f304921b1ee72c21b%2Fc430d1b6-4adf-455c-afaf-33a0e6c27b9c.png?alt=media)

If the request or response is invalid, the system returns a 422 HTTP status code.

## Example

Download the example project attached to this topic, import it into your Designer, and publish it. Use the following requests to test:

**Valid Requests Using Curl**

curl --location '<https://trunk.logicnets.local/logicnets/WSFExample/function\\_1>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'LN-INFO-REQUEST: WSF-VALIDATION-REQUEST,WSF-VALIDATION-RESPONSE' \ --header 'Cookie: \_\_Secure-pin=3C8A6FC65D5734316F90FE45CFA59AE6FC68D8F42389C76B6600FA14F77DD81D'

**Invalid Request Examples Using Curl**

curl --location '<https://trunk.logicnets.local/logicnets/WSFExample/function\\_2>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'LN-INFO-REQUEST: WSF-VALIDATION-REQUEST,WSF-VALIDATION-RESPONSE' \ --header 'Cookie: \_\_Secure-pin=1661B33C417B027BB51D8AC819B7B756CC57B082AEF04563EE692F8AB1EA3B5D'

curl --location '<https://trunk.logicnets.local/logicnets/WSFExample/function\\_1>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'LN-INFO-REQUEST: WSF-VALIDATION-REQUEST,WSF-VALIDATION-RESPONSE' \ --header 'Cookie: \_\_Secure-pin=8FA00CB8A88607F23BF266393DD0EB7A54333D797968C042B0849D4C2DC041A1' \ --data '{ "answer": "question expected" }'

## Attachments

* [WSFExample.zip](https://github.com/logicnets/community-portal/tree/release-9/docs/.gitbook/assets/18dslf-WSFExample.zip)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://community-test.logicnets.com/release-9/design-considerations-and-frameworks/frameworks/web-services-framework/webservice-requestresponse-validation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
