OTA Bitmap Format
Further to the post about embedding a bitmap into an SMS, I needed to know the format of the picture to send. Wikipedia has an excellent article on the format, so I'll need to use this when I get those 5 minutes to give it a go.
A reference blog containing posts added during my time at Esendex.
Further to the post about embedding a bitmap into an SMS, I needed to know the format of the picture to send. Wikipedia has an excellent article on the format, so I'll need to use this when I get those 5 minutes to give it a go.
Posted by Ian Dykes at 17:37 0 comments
Labels: SMS
Embedding a bitmap picture into an SMS isn't something that Esendex directly supports, but after a customer's request I thought I'd take a few minutes to find out how to do it.
So I sent a picture message from my phone into one of our virtual mobile numbers, and I'm pretty sure I can reverse engineer the bytes that I got.
Then I found this Nokia article on it, which I should have known already as I used to have this document on my desk pretty much all the time... So it looks quite interesting.
I'll give it a go when I get 5 minutes, but the specification doesn't seem that complicated. Watch this space I guess.
Posted by Ian Dykes at 17:36 0 comments
Labels: SMS
Just a small problem this time for the .Net 2.0 Migration. Assigning a string that contains line feed characters to the Subject property on a System.Net.MailMessage object will result in an error being thrown that says:
The specified string is not in the form required for a subject.
Just make sure you strip out any carriage returns (\r) or line feeds (\n) from your string before you assign it and everything will be fine.
So done, onto the next one...
Posted by Ian Dykes at 15:32 0 comments
Labels: .Net 2 Migration
Posted by Ian Dykes at 10:59 9 comments
Labels: .Net 2 Migration, Logging
Got quite a few posts to write about more version 1.1 to 2.0 migration issues. We've recently released the .Net 2 build onto some of our servers for testing, and there were quite a few problems. I'll try to keep 1 post per issue we saw.
We had a problem with our scheduled SMS service (which allows customers to specify a date and time when they want to submit a given SMS), in that the dates being used weren't being respected correctly when posting from a .Net 2 web service, through an XML formatted MSMQ, and being processed by a .Net 1.1 Windows service.
This was due to the differences between how the versions serialise DateTime objects to XML. There is what I would call a bug in the 1.1 framework that means you cannot serialise a DateTime that represents a UTC time (i.e. with zero offset from GMT, and no daylight savings adjustments). Check out this very useful article about DateTimes in general: Coding Best Practices Using DateTime in the .NET Framework.
It seems any time you put in is treated like the local time for the application deserialising it. I'm not entirely sure, but if you indicate that the time is in UTC (by adding a Z to the end of the time section), the 1.1 framework does treat that as UTC (Zulu) time, but then internally corrects it to the local time the server is in. That's certainly the behaviour we observed during tests anyway.
This has been fixed in version 2, so our solution to the problem just involves altering the order in which we deployed the .Net 2 builds to our servers.
Posted by Ian Dykes at 12:46 0 comments
Labels: .Net 2 Migration
Currently migrating a lot of .Net 1.1 code to .Net 2, and was having problems with one particular ASP.Net page. This page uses a custom control that we have written to display one of our objects. It is a composite control that displays a number of text boxes, check boxes and the like, to represent the object passed in to it.
Well this control pulls form variables during the post back, and updates the underlying object with what the user has entered. The problem was that on a Windows XP development PC this all worked fine, but during a test deploy onto a Windows 2003 server the page didn't save the updated values.
The names of the controls had all been separated with a colon (:) on the development PC, and a dollar ($) on the server. This was a problem as the custom control was set up to separate the names using the colon, which had always worked in the past.
The answer came from a forum posting.
On the development PC the Web.config file had the setting
<xhtmlConformance mode="Legacy"/>
in the
Posted by Ian Dykes at 16:14 0 comments
Labels: .Net 2 Migration, ASP.Net
Deploying a .Net 2 application onto a test server that doesn't have the SDK (but does have the framework, of course), we have a script that installs a bunch of assemblies to the GAC. This script uses the Gacutil.exe program, found in the C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 folder in .Net 1.1.
Problem with this? Gacutil.exe doesn't ship with the framework any more, only with the SDK. Apparently the recommended way of deploying is now with a Setup and Deployment project from Visual Studio 2005.
Well we can't do this, so I've copied Gacutil.exe, and Gacutil.exe.config to the framework directory on the server, and hey presto, the scripts now install the assemblies correctly.
Posted by Ian Dykes at 17:25 0 comments
Labels: .Net 2 Migration
For the last couple of days I've been attempting to communicate with an external Web Service that I need to use Web Service Enhancements for. Particularly I needed to set the value of a UsernameToken within the header.
I found a codeproject article on it (WS-Security: Secure Web services through SOAP Message Level Security) on which I based the code, and this did work. I eventually got successful responses when I had figured out the right format of parameter to use.
However, the codeproject article was written for WSE 2.0, and I was using WSE 3.0. The Security property on RequestSoapContext is rather annoyingly marked as Obsolete in WSE 3.0, and I was using this to set the required header.
Eventually I found the rather snappily titled article Custom WSE 3.0 Policy Assertions for Signing and Encrypting SOAP Messages with Username Tokens on codeproject again. From this I found I had to replace my 1 line of client code with 2 separate classes, and 4 additional lines within the client code.
I have no idea why the propery is now Obsolete, but the new way of doing the same thing was much too difficult to find in my opinion.
Posted by Ian Dykes at 11:55 0 comments
Labels: WSE3
I've been using .Net 1.1 since leaving university just over 3 years ago now, but over the last couple of weeks we've been updating to .Net 2. It's not proven to be an easy transition, and not only because of the updated web application format that Visual Studio 2005 now uses.
When our build got to our SMS XML Web Service APIs we had a lot of these errors:
0x8004E027
CONTEXT_E_NOTRANSACTION
The requested operation requires that the current context have a Transaction, and it does not.
The APIs use COM+ as a business logic layer, and initially it seemed to only be a problem when we had a ServicedComponent calling a non-ServicedComponent which in turn called a different ServicedComponent. However, we refactored some code around to remove the middle section, and the error still threw.
A Google search for the error doesn't find that many pages, but luckily there is a knowledge base article on it. There is also even a patch for it, but only for Windows 2003 Server editions, and (like most people) we don't actually develop on a server operating system.
There is no hotfix for Windows XP Professional, and no usable workaround for that OS was listed either. As a last ditch effort we attempted the registry fix workaround listed on that page, which is to add a new key string value for DisablePromotableTransactions in HKEY_LOCAL_MACHINE\Software\COM3, and set the value to Y.
But look in the registry on a WinXP box and you'll find that the required registry location doesn't exist. There is however a HKEY_LOCAL_MACHINE\Software\Microsoft\COM3. Not knowing whether it would work, we just tried putting the entry there instead.
And it worked. The tests passed and the build continued. No more COM+ problems after that.
But it does raise the question of what else that registry key is controlling. The research that we've done on it seems to suggest promotable transactions are a new feature of Sql Server 2005. As we aren't using that in either production or development we're probably ok. Also, it's only a problem on our development machines, as production boxes do have the hotfix applied.
Posted by Ian Dykes at 12:41 2 comments
Labels: .Net 2 Migration, COM+
This is a personal weblog and represents my own opinions and ideas. This weblog does not represent the thoughts, intentions, plans or strategies of Esendex Limited, any affiliated companies, or other bodies to which I may belong or represent. Inappropriate comments will be deleted at the author’s discretion.
All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.