Closed tabrez-hirehal closed 2 years ago
The credentials are passed on using HTTP-Basic. See here: https://github.com/Axway-API-Management-Plus/apim-cli/wiki/2.1.10-API-Specification#2-remote-url-reference-by-file
Can you please share the APIM-CLI log file in debug? I need to see the reason why the specification can't be downloaded.
Hi Chris ,
Sorry for delay to get back . below is the debug mode logs andthough i am passing bit bucket credentials , the url is just routing to bitbucket login page , where in when i pass the same url in apimanager . it extracts the api-specification.
openjdk version "1.8.0-292" OpenJDK Runtime Environment (build 1.8.0-292-b10) OpenJDK 64-Bit Server VM (build 25.71-b10, mixed mode)
20220418-094238 Taking Backup of Existing APIMG Swagger files int-manager/ int-manager/AEM-ReadExtension/ int-manager/AEM-ReadExtension/swagger/ int-manager/AEM-ReadExtension/swagger/ReadExtension.url int-manager/AEM-ReadExtension/config/ int-manager/AEM-ReadExtension/config/MAS-APIKEY_Inbound-NoAuth_Outbound.json copied backup to /data/mas/backup/int-manager-bkp-20220418-094238.tar.gz Apimg promotion start <--------------- In AEM-ReadExtension directory -------------------------->
----------------------------------------------------------------------------------------
API-Manager CLI: 1.10.1
To report issues or get help, please visit:
https://github.com/Axway-API-Management-Plus/apim-cli
----------------------------------------------------------------------------------------
Module: API - I M P O R T (1.10.1)
----------------------------------------------------------------------------------------
2756 DEBUG nvironmentProperties| Trying to load environment properties from file: /data/Software/apim-cli-1.10.1/conf/env.properties ... not found.
2778 DEBUG nvironmentProperties| Loaded environment properties from file: /data/Software/apim-cli-1.10.1/conf/env.api-dev.properties
2943 DEBUG APIManagerAdapter| Logging in with User: 'apiadmin'
7416 DEBUG ManagerConfigAdapter| Load API-Manager configuration.
7667 INFO APIManagerAdapter| Successfully connected to API-Manager (7.7.20220228) on: https://XXXXXXXXXX:8075
7771 DEBUG rOrganizationAdapter| Load organizations from API-Manager using filter: OrgFilter [name=MAS-Internal, id=null]
8864 DEBUG nagerPoliciesAdapter| Load policies with type: REQUEST from API-Manager
10727 DEBUG nagerPoliciesAdapter| Load policies with type: RESPONSE from API-Manager
10882 INFO Utils| Loading API-Definition from: https://git.mas.gov.sg/projects/APIMG/repos/apigw-utils/raw/wsdls/BarcodedForms.wsdl?at=refs%2Fheads%2Fmaster (c_lesterchan)
10884 DEBUG Utils| NO javax.net.ssl.keyStore property.
10886 DEBUG Utils| https protocols: TLSv1.2
11012 DEBUG SpecificationFactory| Handle API-Specification: '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Bitbucket</title><script>
window.WRM=window.WRM||{};window.WRM._unparsed......', apiDefinitionFile: '/data/mas/apimg/int-manager/AEM-ReadExtension/swagger/ReadExtension.url'
11023 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.Swagger2xSpecification
11024 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.Swagger1xSpecification
11024 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.OAS3xSpecification
11024 DEBUG WSDLSpecification| No WSDL specification. Specification doesn't contain wsdl in the first 500 characters.
11024 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.WSDLSpecification
11025 DEBUG WADLSpecification| No WADL specification. Specification doesn't contain WADL namespace: wadl.dev.java.net in the first 500 characters.
11025 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.WADLSpecification
11111 ERROR ODataV2Specification| Error parsing OData specification.
org.apache.olingo.odata2.api.ep.EntityProviderException: An exception of type 'WstxUnexpectedCharException' occurred.
at org.apache.olingo.odata2.core.ep.consumer.XmlMetadataConsumer.readMetadata(XmlMetadataConsumer.java:123) ~[olingo-odata2-core-2.0.11.jar:2.0.11]
at org.apache.olingo.odata2.core.edm.provider.EdmxProvider.parse(EdmxProvider.java:51) ~[olingo-odata2-core-2.0.11.jar:2.0.11]
at org.apache.olingo.odata2.core.ep.ProviderFacadeImpl.readMetadata(ProviderFacadeImpl.java:231) ~[olingo-odata2-core-2.0.11.jar:2.0.11]
at org.apache.olingo.odata2.api.ep.EntityProvider.readMetadata(EntityProvider.java:876) ~[olingo-odata2-api-2.0.11.jar:2.0.11]
at com.axway.apim.api.apiSpecification.ODataV2Specification.parse(ODataV2Specification.java:91) [apimcli-apim-adapter-1.10.1.jar:1.10.1]
at com.axway.apim.api.apiSpecification.APISpecificationFactory.getAPISpecification(APISpecificationFactory.java:77) [apimcli-apim-adapter-1.10.1.jar:1.10.1]
at com.axway.apim.api.apiSpecification.APISpecificationFactory.getAPISpecification(APISpecificationFactory.java:57) [apimcli-apim-adapter-1.10.1.jar:1.10.1]
at com.axway.apim.apiimport.APIImportConfigAdapter.addAPISpecification(APIImportConfigAdapter.java:231) [apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.apiimport.APIImportConfigAdapter.getDesiredAPI(APIImportConfigAdapter.java:179) [apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:76) [apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:58) [apimcli-apis-1.10.1.jar:1.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0-292]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0-292]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0-292]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0-292]
at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:141) [apimcli-tool-1.10.1.jar:1.10.1]
at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:77) [apimcli-tool-1.10.1.jar:1.10.1]
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '>' (code 62) expected '='
at [row,col {unknown-source}]: [15,269]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:666) ~[woodstox-core-6.2.6.jar:6.2.6]
at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:3117) ~[woodstox-core-6.2.6.jar:6.2.6]
at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:3048) ~[woodstox-core-6.2.6.jar:6.2.6]
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2926) ~[woodstox-core-6.2.6.jar:6.2.6]
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1122) ~[woodstox-core-6.2.6.jar:6.2.6]
at org.apache.olingo.odata2.core.ep.consumer.XmlMetadataConsumer.readMetadata(XmlMetadataConsumer.java:97) ~[olingo-odata2-core-2.0.11.jar:2.0.11]
... 16 more
11131 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.ODataV2Specification
11131 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.ODataV3Specification
11131 DEBUG SpecificationFactory| Can't handle API specification with class: com.axway.apim.api.apiSpecification.ODataV4Specification
11131 ERROR SpecificationFactory| API: 'AEM-Read Extension Services' has a unkown/invalid API-Specification: '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Log in - Bitbucket</title><script>
window.WRM=window.WRM||{};window.WRM._unparsed...'
11134 ERROR AppException| Can't handle API specification. No suiteable API-Specification implementation available.
com.axway.apim.lib.errorHandling.AppException: Can't handle API specification. No suiteable API-Specification implementation available.
at com.axway.apim.api.apiSpecification.APISpecificationFactory.getAPISpecification(APISpecificationFactory.java:103) ~[apimcli-apim-adapter-1.10.1.jar:1.10.1]
at com.axway.apim.api.apiSpecification.APISpecificationFactory.getAPISpecification(APISpecificationFactory.java:57) ~[apimcli-apim-adapter-1.10.1.jar:1.10.1]
at com.axway.apim.apiimport.APIImportConfigAdapter.addAPISpecification(APIImportConfigAdapter.java:231) ~[apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.apiimport.APIImportConfigAdapter.getDesiredAPI(APIImportConfigAdapter.java:179) ~[apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:76) [apimcli-apis-1.10.1.jar:1.10.1]
at com.axway.apim.APIImportApp.importAPI(APIImportApp.java:58) [apimcli-apis-1.10.1.jar:1.10.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0-292]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0-292]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0-292]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0-292]
at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:141) [apimcli-tool-1.10.1.jar:1.10.1]
at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:77) [apimcli-tool-1.10.1.jar:1.10.1]
11134 DEBUG APIManagerAdapter| Closing cache ...
i have tried to use the same url through the curl command ,and also with post man ( earlier tried with api manager ) everythig worked . below is the curl command . Could you let me know how to pass the below data . Here the username and password is not based on http basic authentication . we need to pass the username and password in body of form-url-encoded
curl --location --request POST 'https://XXXXXXXX/api/portal/v1.4/apirepo/importFromUrl' \ --header 'Authorization: Basic XXXXXXXX=' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'username=XXXXXXXXX' \ --data-urlencode 'password=XXXXXXXXX' \ --data-urlencode 'organizationId=XXXXXXXXXXXXX' \ --data-urlencode 'url=https://XXXXXXXXXX/projects/APIMG/repos/apigw-utils/raw/wsdls/BarcodedForms.wsdl?at=refs%2Fheads%2Fmaster' \ --data-urlencode 'type=wsdl' \ --data-urlencode 'name=Read WSDL Service 2' \ --data-urlencode 'integral=false'
Hi @tabrez-hirehal, I have identified the problem and I'm about to fix this.
Thanks @cwiechmann . when this fix will be available for me to download the updated version CLI
Hi @tabrez-hirehal, Can you please test the following SNAPSHOT-Release if it works for you: https://eu.syncplicity.com/share/g9fnqsxnjh73mea/axway-apimcli-1.11.0-SNAPSHOT I hope you have access to this download link.
Hi @cwiechmann I have verified the snapshot release . Wsdl upload works fine . But there is issue with special character “@“in username or password . Is there any workaround to pass the password which has special character “@“ . It works with special characters through curl , postman and api manager console
Thanks for the feedback @tabrez-hirehal. I also fixed this problem. Please try again: https://eu.syncplicity.com/share/robmu809d4dmz0i/axway-apimcli-1.11.0-SNAPSHOT
Once you confirm, I can create a release.
Thanks @cwiechmann I will verify and post you the results .
Hi @cwiechmann This works fine as expected . accepted the passwords with'@' multiple times as well .
Thanks for your help :)
APIM-CLI version
1.10.1
API-Management version
7.7.20220228
Question
Hi Chris ,
I am working on wsdl service on boarding , my use case is to onboard the wsdl service using url , since apimg doesnt support wsdl file . i am storing the wsdl file in bitbucket so that i can use the bitbucket refernce url in apimanager to onboard it works .but when i use the same url through apimg cli but it throws error saying invalid api-sec
my query is the usernameand password for bit bucket i am passing in below format
username/password@https://bitbucketurl . [username/password@]https://bitbucketurl .
The observation is this bitbucket url has query params . the same url with query params i tried in api manager with bit bucket credentials it works but doesnt work on apimg cli .
could you let me know how this apimcli uses the url i provided , what is the right way to pass the credentials ?
i have opened axway support ticket Case 01358292 as well . but the support team referred me to report it on git hub
Regards Tabrez