Im trying to call de GetVerifiedStatus API.
Im using a server with Windows 7.
Can anyone help me plz.
This is my code:
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
Im receiving this error:
msxml3.dll erro '800c0008'
Failed to download the specified resource
At objXMLHTTP.send(strRequest) line.
When I changed my http object to MSXML2.ServerXMLHTTP, returns a error that said:
A certified is necessary to complete the client authentication.
Tks.
You can use Call objXMLHTTP.send(strRequest) instead of objXMLHTTP.send(strRequest)
I am not sure but you can try this because i found this from Classic ASP tutorial for payment gatway.
Here is the link for that: http://jadendreamer.wordpress.com/2009/09/02/classic-asp-soap-request-code-example
Related
I'm trying to register a new user in an SQL Server DB, from Classic ASP
I appreciate the Classic ASP is antiquated, but I familiar with it and it does the job I need to to (generally).
Here's the code...
<%
Set rs = CreateObject("ADODB.Recordset")
Set con = Server.CreateObject("ADODB.Connection")
con.ConnectionString="Provider=SQLOLEDB;" & _
"Server=Server\SQLEXPRESS;" & _
"Uid=IUSR;" & _
"Pwd=Pwd;" & _
"Database=DB"
con.Open
username="username"
password="password"
tsql="CREATE TABLE #newUserTable(UserID int); " & vbCrLf & _
"DECLARE #responseMessage NVARCHAR(50); " & vbCrLf & _
"DECLARE #userID INT; " & vbCrLf & _
"IF EXISTS (SELECT TOP 1 UserID FROM [dbo].[UserLogins] WHERE LoginName='" & username & "') " & vbCrLf & _
"BEGIN " & vbCrLf & _
"SET #responseMessage='User already exists' " & vbCrLf & _
"END " & vbCrLf & _
"ELSE " & vbCrLf & _
"BEGIN " & vbCrLf & _
"DECLARE #salt UNIQUEIDENTIFIER=NEWID(); " & vbCrLf & _
"BEGIN TRY " & vbCrLf & _
"INSERT INTO dbo.UserLogins (LoginName,PasswordHash,Salt) " & vbCrLf & _
"OUTPUT INSERTED.UserID INTO #newUserTable " & vbCrLf & _
"VALUES ('" & username & "',HASHBYTES('SHA2_512', '" & password & "'+CAST(#salt AS NVARCHAR(36))),#salt); " & vbCrLf & _
"SET #responseMessage=" & vbCrLf & _
"CAST((SELECT userID FROM #newUserTable) AS NVARCHAR(50)); " & vbCrLf & _
"END TRY " & vbCrLf & _
"BEGIN CATCH " & vbCrLf & _
"SET #responseMessage=ERROR_MESSAGE() " & vbCrLf & _
"END CATCH " & vbCrLf & _
"END " & vbCrLf & _
"SELECT #responseMessage AS N'responseMessage'; " & vbCrLf & _
"DROP TABLE #newUserTable"
'response.write tsql & "<hr />"
rs.open tsql, con
response.write rs("responseMessage")
rs.close
%>
When I attempt to add an existing user, I get the expected User already exists response, but when I attempt to add a new user, I get Item cannot be found in the collection corresponding to the requested name or ordinal which suggests that rresponseMessage doesn't exist. If I output the tsql to the browser (replacing vbCrLf with "") and run it in SQL Server, I get the userID returned as responseMessage as I would expect.
Can anyone suggest why this might be, and how I can correct it?
Change your last command to SELECT #responseMessage AS N'responseMessage' (instead of the Drop).
You can also try using "SET NOCOUNT ON" to avoid count messages messing your results.
Also, you don't need to add vbCrLf to TSQL
Your code should look like this:
tsql="SET NOCOUNT ON; " & _
"CREATE TABLE #newUserTable(UserID int); " & _
"DECLARE #responseMessage NVARCHAR(50); " & _
"DECLARE #userID INT; " & _
"IF EXISTS (SELECT TOP 1 UserID FROM [dbo].[UserLogins] WHERE LoginName='" & username & "') " & _
"BEGIN " & _
"SET #responseMessage='User already exists' " & _
"END " & _
"ELSE " & _
"BEGIN " & _
"DECLARE #salt UNIQUEIDENTIFIER=NEWID(); " & _
"BEGIN TRY " & _
"INSERT INTO dbo.UserLogins (LoginName,PasswordHash,Salt) " & _
"OUTPUT INSERTED.UserID INTO #newUserTable " & _
"VALUES ('" & username & "',HASHBYTES('SHA2_512', '" & password & "'+CAST(#salt AS NVARCHAR(36))),#salt); " & _
"SET #responseMessage=" & _
"CAST((SELECT userID FROM #newUserTable) AS NVARCHAR(50)); " & _
"END TRY " & _
"BEGIN CATCH " & _
"SET #responseMessage=ERROR_MESSAGE() " & _
"END CATCH " & _
"END " & _
"DROP TABLE #newUserTable" & _
"SELECT #responseMessage AS N'responseMessage'; "
How do I get my Asp.net webapi to return the correct response for a pdf form submit?
To keep the response inside of the pdf application you must return an FDF formatted file.
The key to get this to work is that you cannot just return a string. You must first encode it to a memory stream and the header must be set to application/vnd.fdf.
Here is the example code:
Public Function PostValue(<FromBody()> ByVal value As MyPDFFieldsObject) As HttpResponseMessage
Dim fdfmessage As String = "%FDF-1.2" & vbCrLf & _
"1 0 obj <<" & vbCrLf & _
"/FDF <<" & vbCrLf & _
"/Status (Submitted Successfully!)" & vbCrLf & _
">>" & vbCrLf & _
">>" & vbCrLf & _
"endobj" & vbCrLf & _
"trailer" & vbCrLf & _
"<</Root 1 0 R>>" & vbCrLf & _
"%%EOF"
Dim result As HttpResponseMessage = New HttpResponseMessage(HttpStatusCode.OK)
Dim stream As New MemoryStream(Encoding.UTF8.GetBytes(fdfmessage))
stream.Position = 0
result.Content = New StreamContent(stream)
result.Content.Headers.ContentType = New MediaTypeHeaderValue("application/vnd.fdf")
Return result
End Function
Hi im doing a ASP contact form and for some reason i keep getting this.
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/confirmation.asp, line 10
800401f3
I think that theres something wrong with my SMTP, please any help would be grateful.
<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments
strEmail = request.form("Email")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName")
strSubject = request.form("Subject")
strComments = request.form("Comments")
DIM Mailer,strMsgHeader, qryItem, strMsgInfo
Set Mailer = Server.CreateObject("smtpout.secureserver.net")//this line might be wrong.
Mailer.FromName = "Web Designs"
Mailer.FromAddress= "carlos#example.net"
Mailer.ReplyTo = strEmail
Mailer.RemoteHost = "mail.example.net"
Mailer.AddRecipient "", ""
Mailer.Subject = "Online Inquiry"
strMsgHeader = "This mail message was sent from the Online Form" & vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
vbCrLf & "First Name: " & Request.Form("FirstName") & _
vbCrLf & "Last Name: " & Request.Form("LastName") & _
vbCrLf & "Subject: " & Request.Form("Subject") & _
vbCrLf & "Comments: " & Request.Form("Comments")
IF Mailer.SendMail THEN
Response.Write strFirstName & ",<br>"
Response.Write "Your message has been successfully sent."
ELSE
Response.Write "The following error occurred while sending your message: " & Mailer.Response
END IF
%>
It seems you mix up the 'send email library' and your SMTP configuration.
the Mailer should look like
Set Mailer = Server.CreateObject("CDO.Message")
(although this could depend on your IIS version)
To configure your SMTP you should use this object:
Set cdoConfig = CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(cdoSMTPServer) = "smtpout.secureserver.net"
Edit: example code: CDO Classic ASP form not working
I have the following script in a classic asp page:
<%
Response.Write "<script language=""vbscript"">" & vbcrlf
'----------------------------------
Response.Write "sub window_onload" & vbcrlf
'Response.Write "On Error Resume Next" & vbcrlf
Response.Write " dim t1 " & vbcrlf
Response.Write " set xfile = AXFFileDownload.XFRequest " & vbcrlf
Response.Write " AXFFileDownload.AddFile ""c:\contalfinger\tester.mdb"", ""http://" & Request.servervariables("LOCAL_ADDR") & application("portinternet") & "/transfert_fichiers/FZ" & kteur & ".mdb" & chr(34) & vbcrlf
Response.Write " If Err.number <> 0 Then " & vbcrlf
Response.Write " msgbox(""You may not have SA-XFile installed."") " & vbcrlf
Response.Write " End IF " & vbcrlf
'Response.Write " call contalMSN.faireDirectory(""c:\contalfinger"") " & vbcrlf
Response.Write " t1=contalMSN.wait(2) " & vbcrlf
Response.write " AXFFileDownload.Start" & vbcrlf
'Response.Write " call contalMSN.faireCMD(""c:\tmp\fichier2.eml"") " & vbcrlf
'Response.Write " window.close() " & vbcrlf
Response.Write " window.location.href=""loginfinger.asp" & chr(34) & vbcrlf
Response.Write "end sub" & vbcrlf
Response.Write "</script>" & vbcrlf
%>
The problem is that the mdb file on the server has 336KB but when it is downloaded to the client computer it's reduce to 2KB and can't be open due to following error message: Unrecorignised database format.
This script was working before we change server.
Any help will be reallly appreciated.
Thank you
Ok I found it. I had to modify the file found in the below path:
C:\Windows\System32\inetsrv\config\applicationhost.config
<add fileExtension=".mdb" allowed="false" /> for <add fileExtension=".mdb" allowed="true" />
This my code
Dim verifyUrl As String = Request.Url.GetLeftPart(UriPartial.Authority) & Page.ResolveUrl("~/verify.aspx?ID=" & sGUID)
mail.Body = "<html>" & _
"<head>" & _
"<meta http-equiv=""Content-Language"" content=""fr"">" & _
"<meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1252"">" & _
"</head>" & _
"<body>" & _
" <p>Hello, <%UserName%>. You are receiving this email because you recently created a new account at my" & _
"site. Before you can login, however, you need to first visit the following link:</p>" & _
"<p> //////Here put an href whit the value verifyUrl ///// </p>" & _
"</body>" & _
"</html>"
mail.Body = mail.Body.Replace("<%VerifyUrl%>", verifyUrl)
mail.Body = mail.Body.Replace("<%UserName%>", nom)
Try for long time to put an like <a href"<%verifyUrl%>"</a> but this not work well................
Please help me to enter this simple html line!!!
Thanks in advance!!
You can use this:
<a href='<%VerifyUrl%>'>Click Here</a>