Tuesday, October 26, 2004

Consuming Web Services with HTTP Post

When I first started working on a web service project a few weeks ago, I put together a small ASPx page that uses HTTP Post to call the web service. This made it somewhat simple to test. I could easily change the input values and re-submit without having to change some code and recompile an application that uses the web service.

This worked great on my laptop where I accessed everything on localhost. As soon as I migrated the project to our development server for testing that all changed. I spent a couple of days trying to figure out if I had inadvertently changed my web service code and caused this problem. I ended up writing that application that I mentioned to see if that would work. To my bewilderment, it did.

After doing some searching, I finally found some very useful information in ASP.NET Unleashed, Second Edition last night that helped solve my problem. For security reasons, in ASP.NET 1.1 a web service can only be accessed using SOAP. HTTP Post and HTTP Get are both disabled by default. HTTP Post still works on a local machine, which is why I did not have a problem at first.

To enable the use of HTTP Post or HTTP Get from remote machines, you will have to edit the Web.Config file for your project:















XML to XHTML via XSLT - revisited

I worked on the XSLT project again today. I am basically taking a dataset from a web service and putting it in a tabular format for display. I successfully applied the stylesheet enhancements today. That was a no-brainer. I had never worked with stylesheets in HTML before, so I did not realize just how easy it would be. The project that I am working on is, obviously, quite simple, but it is nice to do something different and learn something new for a change.

One thing that I definitely learned about XSLT today is that you should have well formed tags. In other words, every tag must have an end tag.

Wow! Working sure makes the day go by faster. I should do it more often!

Monday, October 25, 2004

SOAP Message Content-Length

I am working with someone to properly understand how to call an ASP.NET web service from PeopleSoft. After several tries, I finally saw down at the keyboard Sunday night and put together some code to call the web service from a Java application. I learned very quickly that if you do not have all your ducks in a row, most likely, the SOAP request will not work.

The thing that I struggled with the most last night was getting the Content-Length value set properly. When I thought I had it set just right, I would use the code to access a different web service with different parameter names and it would no longer work.

I finally figured out after a lot of trial and error that the Content-Length value in the POST header for the SOAP message only includes the length of the content in the SOAP message body, which is encompassed by the tags.

XML to XHTML vis XSLT

Too many acronyms there. I started playing around with a new technology today. Welll, it is new to me, anyway. I am having to transform some data from a web service into HTML. I have only started working with XSLT. I am doing some very basic transformations which takes the data in the XML dataset and put it in a tabular format that is easily read by the viewer of the pagelet.

I downloaded the Unicorn XSLT Processor to do the transformations after I created my XSLT. It is command line driven, but it works well for what I am doing.

One thing that I need to do next is learn how to apply a style sheet (CSS) to the HTML as I do the transformation so that I can get the proper look that I want.