Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
AbhijitBansode
Specialist
Specialist

Connection to a WebService from Script

Hi All,

I know we can connect to a web service without authentication using below syntax:

Forecast:

LOAD Date,

    WeatherID,

    Desciption,

    [ProbabilityOfPrecipiation/Nighttime] as Nighttime,

    [ProbabilityOfPrecipiation/Daytime] as Daytime,

    [Temperatures/MorningLow] as MorningLow,

    [Temperatures/DaytimeHigh] as DaytimeHigh

FROM [http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityForecastByZIP?ZIP=33139] (XmlSimple, Table is [ForecastReturn/ForecastResult/Forecast]);


as mentioned https://community.qlik.com/docs/DOC-1320#start=25


I've a web service with basic authentication (username and password). How do I connect with this service using "Web Files" option. I've tried different options mentioned at "Basic access authentication - Wikipedia, the free encyclopedia" but can't get it working. Any suggestion here will be much helpful.


Thanks,

Abhijit

9 Replies
rbecher
MVP
MVP

Please provide more details about the web service and your script..

- Ralf

Astrato.io Head of R&D
Frank_Hartmann
Master II
Master II

if there are any Special Characters in Usernames and Passwords the attached document might be helpful!

rbecher
MVP
MVP

URL encoding should be always taken into account when dealing with web resources..

Astrato.io Head of R&D
AbhijitBansode
Specialist
Specialist
Author

Thanks for the reply. rbecher‌ I don't have more details about the web service. I've tested the service using postman chrome extension and it works with basic authentication (Username and password).

franky_h79,thanks for the suggestion. username and password doesn't contain special characters. I've tried all the variations of the url listed in your example but it's not working yet.

Thanks,

Abhijit

rbecher
MVP
MVP

So, what is you script call then?

Astrato.io Head of R&D
AbhijitBansode
Specialist
Specialist
Author

I use "Web Files" option in load script to load the data from service:

Original URL is

https://server.domain.com:8443/AllStars/rest/allstar/qvdata

this works with postman using basic authentication. Lets consider username is 'user' and password is 'pass'

I've tried providing URLs in below formats:

https://user:pass@server.domain.com:8443/AllStars/rest/allstar/qvdata

https://user%40domain.com:pass@server.domain.com:8443/AllStars/rest/allstar/qvdata

https://user%40server.domain.com:pass@server.domain.com:8443/AllStars/rest/allstar/qvdata

https://user%40server.domain.com:8443:pass@server.domain.com:8443/AllStars/rest/allstar/qvdata

I've also tested open web service which doesn't require username and password and it generates below script when using above process:

SpotlightProblem:

LOAD

    Qtr,

    Period,

    PR,

    Active  

FROM [https://server.domain.com:8443/toolswebservices/rest/spotlight/retail/problem] (XmlSimple, Table is [SpotlightProblems/SpotlightProblem]);

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hi cabhijit

Did you retrieve data from a WebService ?

Thank you

Joaquín

AbhijitBansode
Specialist
Specialist
Author

Hi joaquinlr,

I've developed executable application using DOTNET to retrieve a data set from web service and store it in csv file to process in QV. EXE is called using EXECUTE command in QV script and it works charm.

Thanks,

Abhijit

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hi Abhijit Bansode


OK. I will think about it


Thank you.