Problems with NET applications

 
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET
View previous topic :: View next topic  
Author Message
ninobg
-


Joined: 12 Nov 2007
Posts: 4

PostPosted: Mon Nov 12, 2007 6:51 pm    Post subject: Problems with NET applications Reply with quote

I have been trying some ASP.NET projects from www.codeproject.com.
All of them are OK on IIS server.
Abyss Web Server X1 2.5 on same machine, same folders, everything set according to your instructions could not run some of them.
For example, see the simple 1-page aspx:
Code:
<%@ page language="vb"  AutoEventWireup="true" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Xml" %>

<html>
<head>
<title>Demo International Prices</title>
</head>
<body >
<script language="VB" runat="server">

    'Load the conversion rate file
    Public Function getConversionRate(ByVal sFromCurr As String, ByVal sToCurr As String) As Double
        Dim req As HttpWebRequest
        Dim res As HttpWebResponse

        Dim srExRateData As StreamReader
        Dim s1ExRateData As String
        Dim separator As Char() = ","
        Dim dRate = 0, dRate1, dRate2 As Double
        Dim oExRateData As System.Xml.XmlDocument

        Const s1ExRateSource As String = "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml"

        Try
            oExRateData = New System.Xml.XmlDocument
            srExRateData = New StreamReader(WebRequest.Create(s1ExRateSource).GetResponse().GetResponseStream(), Encoding.ASCII)
            oExRateData.Load(srExRateData)
            srExRateData.Close()


            dRate1 = getEuroRate(oExRateData, sFromCurr)
            dRate2 = getEuroRate(oExRateData, sToCurr)
            dRate = dRate2 / dRate1
        Catch
        End Try
        Return dRate
    End Function

    'get a rate note from the xml
    Function getEuroRate(ByRef oExRateData As System.Xml.XmlDocument, ByVal sCurr As String) As Double
        Dim oExRateNode As System.Xml.XmlNode

        oExRateNode = oExRateData.SelectSingleNode("*/*/*/*[@currency='" + sCurr + "']/@rate")
        If Not oExRateNode Is Nothing Then
               'Return CDbl(oExRateNode.Value)
      Return Val(oExRateNode.Value)
        Else
            Return 1
        End If
    End Function

    'Return the price
        Public  Function PrintPrice(ByVal dPrice As Double, ByVal dRate As Double, ByVal sCurr As String) As String
        Dim sReturn As String
        sReturn = "N/A"
         if sCurr="USD" then sCurr="$US"
         if not sCurr="" then
               sReturn = (dRate * dPrice).ToString("#.##") & " " & sCurr & "<sup>*</sup>  &nbsp "
         end if
         sReturn += "GB£ " & dPrice
         return sReturn
        End Function
</script>

<%
   'Initialise exchange rates
   dim sCurr as string ="USD" 'Default currency
   dim oReqCurr as object =request("curr")
   if not oReqCurr is nothing then sCurr=oReqCurr
   Dim dRate = getConversionRate("GBP",sCurr) 
   dim Price1 as string ="25.21"
   dim Price2 as string ="75.27"
   'End of initialisation
   %>
   
   
   <h1>SomeProduct Pricing</h1>
          <table border="1" cellpadding="4" cellspacing="0" bordercolor="#FFFFFF">
            <tr>
              <td><strong>SomeProduct Lite</strong> </td>
              <td><div><strong>Price: <%=PrintPrice(Price1,dRate,sCurr)%></strong></div></td>
            </tr>
            <tr>
              <td><strong>Another Product</strong> </td>
              <td><div><strong>Price: <%=PrintPrice(Price2,dRate,sCurr)%></strong></div></td>
             
            </tr>
            <tr>
              <td colspan="2" align="right"> <form method="post" action="PricingDemo.aspx">
                  <sup>*</sup> Approximate prices in my currency <br>
                  <select name="curr">
                    <option value="">Select Currency...</option>
                    <Option Value="USD">US Dollar</Option>
                    <Option Value="EUR">Euro</Option>
                    <Option Value="JPY">Japanese Yen</Option>
                    <Option Value="DKK">Danish Krone</Option>
                    <Option Value="GBP">Pound Sterling</Option>
                    <Option Value="SEK">Swedish Krona</Option>
                    <Option Value="CHF">Swiss Franc</Option>
                    <Option Value="ISK">Icelandic Krona</Option>
                    <Option Value="NOK">Norwegian Krone</Option>
                    <Option Value="BGN">Bulgarian Lev</Option>
                    <Option Value="CYP">Cyprus Pound</Option>
                    <Option Value="CZK">Czech Koruna</Option>
                    <Option Value="EEK">Estonian Kroon</Option>
                    <Option Value="HUF">Hungarian Forint</Option>
                    <Option Value="LTL">Lithuanian Litas</Option>
                    <Option Value="LVL">Latvian Lats</Option>
                    <Option Value="MTL">Maltese Lira</Option>
                    <Option Value="PLN">Polish Zloty</Option>
                    <Option Value="ROL">Romanian Leu</Option>
                    <Option Value="SIT">Slovenian Tolar</Option>
                    <Option Value="SKK">Slovakian Koruna</Option>
                    <Option Value="TRY">New Turkish Lira</Option>
                    <Option Value="AUD">Australian Dollar</Option>
                    <Option Value="CAD">Canadian Dollar</Option>
                    <Option Value="HKD">Hong Kong Dollar</Option>
                    <Option Value="NZD">New Zealand Dollar</Option>
                    <Option Value="SGD">Singapore Dollar</Option>
                    <Option Value="KRW">South Korean Won</Option>
                    <Option Value="ZAR">South African Rand</Option>
                  </select>
                  <input type="submit"  value="Change Currency"  name="cmdChange">
                </form></td>
             
            </tr>
          </table>
       
</body>
</html>


What is the problem? It works on IIS.

Thanks
Back to top View user's profile Send private message
ninobg
-


Joined: 12 Nov 2007
Posts: 4

PostPosted: Mon Nov 12, 2007 10:59 pm    Post subject: More Reply with quote

The first reported sample works on Cassini, too.

Next problem:
Try to run the VB or C# sample from this article
http://www.kbsoft-group.com/Use_of_the_PayPal_payment_system_in_ASP.NET.htm
Again, everything was set and running fine on IIS.
Using Abyss Web Server, the sample works incompletely;
the PostBack behaves differently and “Object reference not set to an instance of an object” error appears in the log file.
……………………..

And … my last question:
You answered on this forum, (see theVOJ’s thread):
“theVOJ,
Please contact our technical support to get an updated version of the ASP.NET connector that solves that (his) problem”

Is this “updated version” already available?

Thanks.
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Nov 13, 2007 4:28 pm    Post subject: Re: More Reply with quote

ninobg,

We tested both applications (the simpel ASPX script quoted above) and the Paypal sample and they worked fine with no problems. So could you please explain us how you configured Abyss Web Server ASP.NET paramters?
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
ninobg
-


Joined: 12 Nov 2007
Posts: 4

PostPosted: Wed Nov 14, 2007 3:49 pm    Post subject: Reply with quote

Thanks,
Agree for the quoted sample. I found what was wrong.
Hovewer the PayPal application from the link still has troubles.
The settings are:
- MS Windows XP
- fresh default install of Abyss Web Server x1 2.5
- fresh install of Net.2 framework
- only server ASP.NET aplication is the sample in question
- the application is in subfolder /paypal inside htdocs
- Host > Configure > ASP.NET Parameters, Add /paypal ; and type 2.0 selected
- All pre-work regarding application itself is done properly - account on paypal sandbox, web.config settings etc.
- The application is tested with other server+aspnet engine - works fine.
(in web.config the setting is <add key="SendToReturnURL" value="false"/>, that means "NotifyUrl" and IPNHandler will be used)
When Abyss server is used, everything looks "almost" correct, except that
the IPNHandler doesnt process the back request like the with the alternative server engine.

Log always has: Error in IPNHandler: Object reference not set to an instance of an object.
Should be: "Success in IPNHandler: PaymentResponses created"

I did the test above 10s times on three different PC/setups and always the same result appears.

I tested also with "alias" and virtual subfolder's settings - same thing.

What else I could change?

Thanks
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Nov 17, 2007 1:17 pm    Post subject: Reply with quote

ninobg wrote:
When Abyss server is used, everything looks "almost" correct, except that
the IPNHandler doesnt process the back request like the with the alternative server engine.

Log always has: Error in IPNHandler: Object reference not set to an instance of an object.
Should be: "Success in IPNHandler: PaymentResponses created"

I did the test above 10s times on three different PC/setups and always the same result appears.


So we need to check it again. How can we reproduce the error? (the exact steps, URLs, and links to visits would help us quickly check the problem and understand what's going on).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
ninobg
-


Joined: 12 Nov 2007
Posts: 4

PostPosted: Mon Nov 19, 2007 11:03 pm    Post subject: Reply with quote

In order to reproduce my findings, please follow the steps:
1. Create one main account on http://developer.paypal.com/.
2. Follow their instructions and create two sandbox test accounts - one for buyer another for seller.
3. Log in as seller and go to Profile  Instant Payment Notification Preferences  Click on Edit and check the box under “Activate Instant Payment Notification” paragraph.
Make the “Notification URL address” field blank.
Click on “Save” and check if the Instant Payment Notification is ON
4. Unpack the sample from http://www.kbsoft-group.com/Use_of_the_PayPal_payment_system_in_ASP.NET.htm to subfolder /paypal inside htdocs
Create an internal sub folder /paypal/Log if doesn’t exist.
5. Open web.config and change the strings according to your IP (or hostname)
- choose sandbox setting
- make sure that /paypal is valid server path (follows)
- change the following key key <add key="SendToReturnURL" value="false"/>,
6. Abyss Console: Host > Configure > ASP.NET Parameters, Add /paypal ; select 2.0
7. Run the server and address the application (ype the ip/paypal or hosname/paypal if is DNS registered)
!!!Make sure your server is available from internet!!! (D'ont use "localhost" or so)
8. Open another browser to confirm that you are still login to http://developer.paypal.com/ . If not, just login again. (Otherwise, the paypal sandbox will ask you to do so at one point before payment and payment sequence will be interrupted)
9. Test one transaction (use buyer's account to pay !! Don't return to sellers page !!) and check the log file in /paypal/Log.
10. Repeat the same, but by using IIS
11. Compare the results. In my case for similar transactions, on last log line I have:
Abyss: Error in IPNHandler: Object reference not set to an instance of an object.
IIS: Success in IPNHandler: PaymentResponses created
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> ASP.NET All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group