经典ASP和Paypal API SOAP

时间:2013-05-13 22:12:06

标签: asp-classic paypal

我试图调用de GetVerifiedStatus API。 我在Windows 7上使用服务器。 任何人都可以帮助我PLZ。 这是我的代码:

Dim objXMLHTTP : set objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")
Dim strRequest, strResult, strURL

strURL = "https://svcs.paypal.com/AdaptiveAccounts/GetVerifiedStatus"

strRequest ="<?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"">" _
& "    <SOAP-ENV:Header>" _
& "         <RequesterCredentials xmlns=""urn:ebay:api:PayPalAPI""     xsi:type=""ebl:CustomSecurityHeaderType"">" _
& "         <Credentials xmlns=""urn:ebay:apis:eBLBaseComponents""    xsi:type=""ebl:UserIdPasswordType"">" _
& "              <Username>XXXX</Username>" _
& "              <Password>XXXX</Password>" _
& "              <Signature>XXXX</Signature>" _
& "              <Subject>XXXX</Subject>" _
& "         </Credentials>" _
& "         </RequesterCredentials>" _
& "     </SOAP-ENV:Header>" _
& "     <SOAP-ENV:Body>" _

& "                 <Version xmlns=""urn:ebay:apis:eBLBaseComponents"">98.0</Version>" _
& "                 <emailAddress xs:""string"">john@gmail.com</emailAddress>" _
& "                 <firstName xs:""string"">John</firstName>" _
& "                 <lastName xs:""string"">Vegas</lastName>" _
& "                 <matchCriteria xs:""string"">NAME</matchCriteria>" _
& "                 <requestEnvelope common:""RequestEnvelope"">" _
& "                     <detailLevel xs:""string"">ReturnAll</detailLevel>" _
& "                     <errorLanguage xs:""string"">en_US</errorLanguage>" _
& "                 </requestEnvelope>" _

& "     </SOAP-ENV:Body>" _
& "</SOAP-ENV:Envelope>"

objXMLHTTP.open "post", "" & strURL & "", False

objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXMLHTTP.setRequestHeader "Content-Length", Len(strRequest)

objXMLHTTP.setRequestHeader "SOAPAction", strURL

objXMLHTTP.send(strRequest)
strResult = objXMLHTTP.responseText

response.write strResult

我收到此错误:

msxml3.dll erro '800c0008'

Failed to download the specified resource

在objXMLHTTP.send(strRequest)行。 当我将我的http对象更改为MSXML2.ServerXMLHTTP时,返回一个错误,指出: 必须经过认证才能完成客户端身份验证。

韩国社交协会

1 个答案:

答案 0 :(得分:1)

您可以使用Call objXMLHTTP.send(strRequest)代替objXMLHTTP.send(strRequest)

我不确定,但你可以尝试这个,因为我从Classic ASP教程中找到了这个付款方式。

以下是该链接:http://jadendreamer.wordpress.com/2009/09/02/classic-asp-soap-request-code-example