[progress Communities] [progress Openedge Abl] Forum Post: Re: Connect To Webservice Using...

  • Thread starter Thread starter Jorrit
  • Start date Start date
Status
Not open for further replies.
J

Jorrit

Guest
Hi Many, Even with the information in de post you send me i still cant connect to the webservice. Can you please help me? The admnistrator of the website send me how they connect to te webservice in .net C# see image attached: This is my code used from the post above: var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function encode64(input) { input = escape(input); var output = ""; var chr1, chr2, chr3 = ""; var enc1, enc2, enc3, enc4 = ""; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) > 4); enc3 = ((chr2 & 15) > 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); chr1 = chr2 = chr3 = ""; enc1 = enc2 = enc3 = enc4 = ""; } while (i < input.length); return output; } var username = 'domain\username'; var password = 'password'; var siteAuth = username + ":" + password; var encodedSiteAuth = encode64(siteAuth); //rbv_api.println(encodedSiteAuth); var url = "webservice_URL....."; var header = { "Authorization” : “Basic " : encodedSiteAuth}; //rbv_api.println(header); var data = null; var method = "POST"; var contentType = "application/xml; charset=UTF-8"; var request = rbv_api.sendJSONRequest(url, data, method, contentType, username, password, null); //rbv_api.println(request); When i debug the code i still get the error: HTTP Error 401: HTTP call failed: Unauthorized (line #64) Thanks in advance, Regards Jorrit

Continue reading...
 
Status
Not open for further replies.
Back
Top