SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Classic asp web service Authentication

    I'm not able to authenticate DHL webservice using MSXML2.ServerXMLHTTP object
    https://tasapi.dhl.com/facts/servlet/rpcrouter

    this is the .asp code

    <%
    strURL = "https://tasapi.dhl.com/facts/servlet/rpcrouter"
    Username="paolobettiolo"
    Password="paolo002"

    strRequestDocGenerator="<?xml version=""1.0"" encoding=""utf-8""?>" _
    & "<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:tns=""urn:DocGenerator"" xmlns:types=""urn:DocGenerator/encodedTypes"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">" _
    & "<soap:Header>" _
    & "<soap:Security>" _
    & "<soap:UsernameToken>" _
    & "<soap:Username>"& Username &"</soap:Username>" _
    & "<soap:Password>"& Password &"</soap:Password>" _
    & "</soap:UsernameToken>" _
    & "</soap:Security>" _
    & "<FACTS-Version>F.040601</FACTS-Version>" _
    & "</soap:Header>" _
    & "<soap:Body soap:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"">" _
    & "<tns:docRetrieve>" _
    & "<docName xsi:type=""xsd:string"">EU.CERTFHANDICRAFT.ENG</docName>" _
    & "</tns:docRetrieve>" _
    & "</soap:Body>" _
    & "</soap:Envelope>"

    Response.write strRequestDocGenerator
    'Response.End

    Set oXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
    oXMLHTTP.Open "POST", strURL , false, Username, Password
    oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    oXMLHTTP.send strRequestDocGenerator
    risposta = oXMLHTTP.responseText
    set oXMLHTTP = nothing
    Set newDoc = server.CreateObject("Microsoft.XMLDOM")
    newDoc.ValidateOnParse= True
    newDoc.LoadXML(risposta)

    response.write "<hr /><strong>Test:"& strURL &"</strong><br />"
    response.write risposta

    Set oXMLHTTP = nothing
    %>

    DHL HelpDesk service write me to use javascript function like this

    (function() {
    username = "paolobettiolo_USER";
    password = "paolo002_PASS";
    contentType = "text/xml";
    })();

    I test withuot success
    Any Ideas ?

    Thanks,
    Paolo
    Last edited by Stevie D; Oct 31, 2013 at 03:06. Reason: Smilies converted back to text!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •