-1

I have tried to upload wsdl using advanced google rest API. In response I get html content (publisher portal). Below are the header I passed

WSO2 REST API WSDL Upload POST And below are the response header I received:

WSO2 REST API Response

I don't see wsdl is getting uploaded on publisher portal.

I have raised a question earlier about information about REST API. I see different information in different sources. I see WSO2 API documentation some API request is using curl passing postman-token and I see on a blog, google rest api is passing JSESSIONID as part of header. From where would I generate token or SessionID.

Please provide some detail around that. I would also like to see if I can upload ZIP file containing wsdl along with schemas.

Please provide appropriate URLs to post the request.

Community
  • 1
  • 1
Alwaysalearner
  • 85
  • 1
  • 1
  • 10
  • Did you follow instructions given in [this blog](https://denuwanthi.wordpress.com/2016/04/06/wso2-governance-registryusing-publisher-rest-api-to-upload-wsdlswagger/) as pointed out in http://stackoverflow.com/a/40168641/2366602 – madawa Oct 26 '16 at 04:51

1 Answers1

0

Blog [1] explains how to upload WSDLs using the publisher API.

To generate the JSESSIONID you need to authenticate first sending a POST request to the following endpoint.

https://<host>:<port>/publisher/apis/authenticate/

You can find the JSESSIONID in the response you get. authenticate response

When sending the request to upload a resource, you need to send this JSESSIONID in the header. Refer to blog [1] as it explains the whole process with screenshots.

[1] - https://denuwanthi.wordpress.com/2016/04/06/wso2-governance-registryusing-publisher-rest-api-to-upload-wsdlswagger/

madawa
  • 496
  • 6
  • 24
  • I was able to get past that and got the JSESSIONID. I followed the process and tried uploading the WSDL and got the 200 OK response, but file was not uploaded. Here are the response headers: Date: Wed, 26 Oct 2016 17:48:41 GMT Content-Encoding: gzip X-Content-Type-Options: nosniff Server: WSO2 Carbon Server X-Frame-Options: DENY Vary: Accept-Encoding Content-Type: text/html Transfer-Encoding: chunked X-XSS-Protection: 1; mode=block – Alwaysalearner Oct 26 '16 at 17:54
  • I see below inside wso2carbon.log Caused by: org.mozilla.javascript.WrappedException: Wrapped org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "wsdl_file" from null (/publisher/extensions/assets/wsdl/apis/wsdls.jag#40) (/publisher/controllers/assets-router.jag#68) cannot fit the whole exception here. – Alwaysalearner Oct 26 '16 at 21:17
  • Did you send the file with the request body? From the exception, it seems like `wsdl_file` property is null. I tested this API and it worked fine. – madawa Oct 27 '16 at 06:32
  • I uploaded the file from file tab in google rest API and give the field entry name "wsdl_file". I am not sure why it is going as null. Is there any other way to do this. I will try using curl. – Alwaysalearner Oct 27 '16 at 06:58
  • more detail, Wrapped org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found (/publisher/extensions/assets/wsdl/apis/wsdls.jag#33) (/publisher/controllers/assets-router.jag#68) – Alwaysalearner Oct 31 '16 at 18:56
  • This is a common exception regarding the content-type of your request. have you done any research before posting the exception here? – madawa Nov 01 '16 at 04:12