Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerItems.py fails to add Type: WMS services #54

Open
pnasuti-zz opened this issue Sep 30, 2016 · 3 comments
Open

registerItems.py fails to add Type: WMS services #54

pnasuti-zz opened this issue Sep 30, 2016 · 3 comments

Comments

@pnasuti-zz
Copy link

pnasuti-zz commented Sep 30, 2016

The script does not function for services of Type WMS to an ArcGIS Online or Portal for ArcGIS environment. This script executes perfectly for "Map Service" type, but not "WMS" type

CSV Line 1:
title,url,tags,type,id,thumbnail,description,snippet,extent,spatialReference,accessInformation,licenseInfo,culture
CSV Line 2:
WMS_Service,https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer?request=GetCapabilities&service=WMS,testtag,WMS,,,WMS,,,,,,

When executed directly, the script returns "0 items added". Watching network traffic, the script never executes the "addItem" call to the Portal sharing API.

@ecaldwell
Copy link
Contributor

ecaldwell commented Sep 30, 2016

It could be failing due to the extra parameters on the WMS url. Try just https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer for the url and see if it works.

@pnasuti-zz
Copy link
Author

pnasuti-zz commented Sep 30, 2016

@ecaldwell

Thanks for the quick reply! Unfortunately the same response 0 items added for the URL added as "https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer"

@ecaldwell
Copy link
Contributor

Watching the network traffic for the workflow in the UI, it appears there's a call to a proxy service to populate some additional info. The additional info gets sent with the text parameter on the addItem call. There's a whole lot of info about the WMS in there.

You could try adding some logic to the registerItems method to populate the text parameter with the required info for a WMS.

{
    "title": "WMS",
    "url": "https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer",
    "mapUrl": "https://sampleserver6.arcgisonline.com:443/arcgis/services/SampleWorldCities/MapServer/WmsServer",
    "version": "1.3.0",
    "layers": [{
        "name": "0",
        "title": "World",
        "legendURL": "https://sampleserver6.arcgisonline.com:443/arcgis/services/SampleWorldCities/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=0",
        "queryable": true
    }, {
        "name": "1",
        "title": "Continent",
        "legendURL": "https://sampleserver6.arcgisonline.com:443/arcgis/services/SampleWorldCities/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=1",
        "queryable": true
    }, {
        "name": "2",
        "title": "Cities",
        "legendURL": "https://sampleserver6.arcgisonline.com:443/arcgis/services/SampleWorldCities/MapServer/WmsServer?request=GetLegendGraphic%26version=1.3.0%26format=image/png%26layer=2",
        "queryable": true
    }],
    "copyright": "",
    "maxHeight": 4096,
    "maxWidth": 4096,
    "spatialReferences": [
        4326
    ],
    "format": null,
    "featureInfoUrl": "https://sampleserver6.arcgisonline.com:443/arcgis/services/SampleWorldCities/MapServer/WmsServer",
    "featureInfoFormat": "text/html"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants