Hejsan!
Håller på att integrera en kreditkontrollsfunktion.. Det har fungerat bra nu ett tag tills företagsnamnen börja innehålla & (ampersand).
Jag förstår inte riktigt varför min funktion inte tar bort &?
'HTML Decode
Function HTMLDecode(sText)
sText = Replace(sText, """, Chr(34))
sText = Replace(sText, "<" , Chr(60))
sText = Replace(sText, ">" , Chr(62))
sText = Replace(sText, "&" , Chr(38))
sText = Replace(sText, " ", Chr(32))
For I = 1 to 255
sText = Replace(sText, "&#" & I & ";", Chr(I))
Next
HTMLDecode = sText
End Function
RequestXML = "<?xml version=""1.0"" encoding=""UTF-8""?>" & _
" <SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:m0=""http://model.webservices.lindorff.no"">" & _
" <SOAP-ENV:Body>" & _
" <m:getInformation xmlns:m=""urn:DecisionMakerWebServices"" SOAP-ENV:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/"">" & _
" <user xsi:type=""xsd:string"">XXXXXX</user>" & _
" <passWord xsi:type=""xsd:string"">XXXXXXXX</passWord>" & _
" <applicant xsi:type=""m0:DmWSApplicant"">" & _
" <ssn xsi:type=""xsd:string"">?????????</ssn>" & _
" <type xsi:type=""xsd:string"">F</type>" & _
" </applicant>" & _
" <handlerName xsi:type=""xsd:string"">alpha:alle_web_co:xml:server</handlerName>" & _
" </m:getInformation>" & _
" </SOAP-ENV:Body>" & _
" </SOAP-ENV:Envelope>"
Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")
objHTTP.Open "POST", "https://www.lindorffd.com/webservices/services/DecisionMakerWebServices", False
objHTTP.setRequestHeader "Content-Length", len(RequestXML)
objHTTP.setRequestHeader "Content-Type", "text/xml; charset=UTF-8"
objHTTP.setRequestHeader "SOAPAction", "https://www.lindorffd.com/webservices/services/getInformation"
objHTTP.send(RequestXML)
on error resume next
Set foo = objHTTP.responseXML
For Each multiRef In foo.selectNodes("soapenv:Envelope/soapenv:Body/multiRef")
If multiRef.getAttribute("id") = "id1" Then
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async=false
objXML.loadXML(HTMLDecode(multiRef.selectsinglenode("//informationResult").XML))
Response.Write objXML.selectsinglenode("//info/exti/alpha/ho/CompanyInfo/Name").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ho/CompanyInfo/PersonalNbr").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ho/CompanyInfo/Address").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ho/CompanyInfo/PostalNbr").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ho/CompanyInfo/PostalText").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ba/SumPaymentRemarks/PaymentRemarks").getAttribute("value")
Response.Write objXML.selectsinglenode("//info/exti/alpha/ba/SumPaymentRemarks/Sum").getAttribute("value")
UCOK = True
End If
Next
on error goto 0
Set objHTTP = Nothing
Set foo = Nothing
Jag plockade bort lite felmeddelandehantering för att det inte skall se så stökigt ut i koden
Mvh // Paul