So, in my endeavors of finishing my three week late project for a customer, I ran into a snag, rather a wall. When trying to write to universe (uv) using uniobjects.net (uo) the browser returns the following error:


Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.


 

So I thought, wow this stinks. So I check out the application log and find the following helpful error message


Event ID: 1000
Source: ASP.NET 2.0.5...
Description: aspnet_wp.exe (PID: 7440) stopped unexpectedly.

As always, helpful messages are best! So then I review my code as follows:


Dim uniSession As UniSession = Nothing

uniSession = UniObjects.OpenSession(UVServerIP, UVUserID, UVPassword, UVAccount, UVService)
Dim bill As ShippingAddress = Session("BillingAddress")

Dim uniFile As UniFile = uniSession.CreateUniFile("CM")
uniFile = uniSession.CreateUniFile("CM")
uniFile.Read(bill.ID)

Try
With uniFile
.WriteField(bill.ID, 2, bill.FirstName & "/" & bill.LastName)
.WriteField(bill.ID, 4, bill.Address1)
.WriteField(bill.ID, 3, bill.Address2)
.WriteField(bill.ID, 5, bill.City)
.WriteField(bill.ID, 6, bill.State)
.WriteField(bill.ID, 7, bill.ZipCode)
.WriteField(bill.ID, 18, bill.Phone)
End With

Catch ex As UniFileException
Response.Write(ex.Message)
End Try

uniFile.Close()

UniObjects.CloseSession(uniSession)


My initial guess is that its the UODOTNET.dll file I am using and not my code. If it were the code then the try...catch would catch the error and display the message. Instead ASPNET service just crashes, so its something to do with how that service is handling the dll, i'm guessing. After a lot of research into the Application log error, nothing being associated with this specific DLL, I've set the ASPNET account to be an admin, reinstall .Net 2.0 and a few other things.

Several hours later....

And my assumptions were right! My IBM rep confirmed the bug in the DLL, and thankfully gave me a workaround until the next release. And here is the life saving workaround, which actually appears to be easier than what I was doing any way

unifile.RecordID = bill.id
unifile.WriteField(2, bill.FirstName & "/" & bill.LastName)
unifile.WriteField(fieldNumber,String)
and so on.....

So, I'm starting to like UniObjects again ;)



Looking for a uniobjects developer? Look no further! Contact us at www.delphi-ts.com! As you can see, we've figured out the bugs so you don't have to!