Good people,
Hello. Our webservice is not working. We should be receiving information via an HTTP POST. However, nothing is working. Below are the code files. Let me know what you think. Thanks in advance for any help or information you can provide. (By the way, some information (e.g. class names, connection strings, etc...) has been removed or changed in order to hide any sensitive information.
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class hbcertification
Inherits System.Web.UI.Page
Public strBody As String = ""
Public sqlInsertStr As String = ""
Public errStr As String = ""
Public txn_id, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone, payer_email, Price, key, invoice, payment_date, mc_fee, buyer_ip As String
Dim myConn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionInfo"))
'*******************************************************************************************
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
strBody += "Test email
sent.Customer name: " & Request("first_name") & " " & Request("last_name")
strBody += "Reg Key: " & Request("key") & "Transaction ID: " & Request("txn_id") & "Tran Type: " & Request("txn_type")
updateFile(Server.MapPath("log.txt"), strBody)
txn_id = Request("txn_id")
first_name = Request("first_name")
last_name = Request("last_name")
address_street = Request("address_street")
address_city = Request("address_city")
address_state = Request("address_state")
address_zip = Request("address_zip")
address_country = Request("address_country")
address_phone = Request("address_phone")
payer_email = Request("payer_email")
Price = Request("Price")
key = Request("key")
invoice = Request("invoice")
payment_date = Request("payment_date")
mc_fee = Request("mc_fee")
buyer_ip = Request("buyer_ip")
If Request("first_name") "" And Request("last_name") "" Then
SendMail("
[email protected]", "
[email protected]", strBody, "Software Order Notification", "
[email protected]")
Else
Response.Write("Email not
sent. Name missing.")
End If
Dim sItem As String
Response.Write("")
If Request.Form("dosubmit") = "1" Then
Response.Write("FORM VALS:")
For Each sItem In Request.Form
Response.Write("" & sItem & " - [" & Request.Form(sItem) & "]")
Next
sqlInsertStr += "insert into aspnet_MorrisCustomerInfo (TransactionID,FirstName,LastName,AddressStreet,AddressCity,AddressState,AddressZip,AddressCountry,AddressPhone,PayerEmail,Price,AuthenticationCode,InvoiceID,PurchaseDate,PaypalFee,PurchaseIPAddress) values ('" & SQLSafe(txn_id) & "','" & SQLSafe(first_name) & "','" & SQLSafe(last_name) & "','" & SQLSafe(address_street) & "','" & SQLSafe(address_city) & "','" & SQLSafe(address_state) & "','" & SQLSafe(address_zip) & "','" & SQLSafe(address_country) & "','" & SQLSafe(address_phone) & "','" & SQLSafe(payer_email) & "','" & SQLSafe(Price) & "','" & SQLSafe(key) & "','" & SQLSafe(invoice) & "','" & SQLSafe(payment_date) & "','" & SQLSafe(mc_fee) & "','" & SQLSafe(buyer_ip) & "')"
runMyQuery(sqlInsertStr, False)
End If
Response.Write("sqlInsertStr is: " & sqlInsertStr)
Response.Write("")
End Sub
'*******************************************************************************************
Sub SendMail(ByVal strEmailAddress, ByVal strEmailAddress_cc, ByVal Email_Body, ByVal Email_Subject, ByVal Email_From)
If Request.ServerVariables("server_name") "localhost" Then
Try
Dim resumeEmail As New MailMessage
resumeEmail.To = strEmailAddress
resumeEmail.Cc = strEmailAddress_cc
resumeEmail.From = Email_From
resumeEmail.Subject = Email_Subject
resumeEmail.Priority = MailPriority.High
'resumeEmail.BodyFormat = MailFormat.Html
resumeEmail.BodyFormat = MailFormat.Html
resumeEmail.Body = Email_Body
'System.Web.Mail.SmtpMail.SmtpServer = "morris.com"
System.Web.Mail.SmtpMail.SmtpServer = "relay-hosting.secureserver.net"
System.Web.Mail.SmtpMail.Send(resumeEmail)
Response.Write("Email
sent.")
Catch exc As Exception
Response.Write("MAIL ERROR OCCURRED" & exc.ToString() & "From: " & Email_From)
End Try
Else
Response.Write("TEST RESPONSE" & strBody & "")
End If
End Sub
End Function
End Class
Process Data
Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
--
section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
--
section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
--