Business Object deserialization from remote XML file over HTTP on WAS Part 1
Let’s say you need to convert data from a remote XML file (located on a remote server) into business object. In our scenario we have a Customer business object (schema) and CustomerInterface which are defined like this:

Input parameter will be used in part 2 and will define XML file URL. In this part XML file URL will be statically configured. Output is a Customer business object that we need in our service or process.
On the server we have the following XML file:

So how to deserialize data form a remote XML file into a business object over HTTP?
The most elegant solution is to use HTTP Import component (HTTP binding overview can be found here):
- Make sure remote XML file is accessible and valid.
- Create a HTTP Import Service with an interface (more info).
- In the properties window of HTTP Import component we must define:
- Endpoint URL (XML file URL in our case)
- HTTP version and method
- Default data format handler – we will use UTF8XMLDataHandler (more info). It converts UTF-8 encoded XML data into business object and vice versa.
- In the Method Bindings section you can also set: data serialization data handlers (for input and output), HTTP Header (character set, media type, etc.), HTTP Proxy, Security and Performance (read timeout and number of retries). In our case we will leave the default settings.
When endpoint URL and proper data handlers (UTF8XMLDataHanler in our case) are configured, we can test our component. Content of the input message is irrelevant since endpoint URL is statically configured. Let’s see the result:

We have successfully deserialized a Customer business object from a remote XML file. In part 2, we will include mediation component that will allow us to dynamically set endpoint URL for the XML file.
1 Comment for Business Object deserialization from remote XML file over HTTP on WAS Part 1
Business Object deserialization from remote XML file over HTTP on WAS Part 2-SOA Competence Center | June 10, 2011 at 8:57 am
Leave a comment!
<< Our Cloud Computing Centre mentioned in the major financial newspaper



[...] this post we continue with BO deserialization of a remote XML file over HTTP. In the previous part (if you haven’t read the first part, I strongly suggest you do so) we have statically set the [...]