Layer7 API Developer Portal: Upload a WSDL using PAPI

book

Article ID: 195986

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

When trying to upload a WSDL to a SOAP service using PAPI in API Explorer you receive the below error:

 

{
"httpStatusCode": 415,
"errorCode": -1,
"devErrorMessage": "Content type 'text/xml;charset=utf-8' not supported",
"userErrorMessage": "There was an issue on the server."
}

Cause

API Explorer sends the request using the wrong content type

Environment

Release : 4.5

Component : API PORTAL

Resolution

A WSDL can be uploaded using the /api-management/1.0/apis/{uuid}/assets API. However, as API Explorer sends the wrong content-type header you will need to use an external tool to test, such as CURL.

The correct Content-type is Multipart/form-data

For example:

curl -i -X POST \
   -H "Content-Type:multipart/form-data" \
   -H "Origin:{Origin}" \
   -H "Authorization: Bearer {token}" \
   -F "[email protected]\"./petstore.wsdl\";filename=\"petstore.wsdl\"" \
 'https://{portal host}/api/api-management/apim/api-management/1.0/apis/{uuid}/assets'