Discussion:
WCS 5.6 - Send outbound XML over HTTP
(too old to reply)
m***@yahoo.com
2006-12-22 15:57:04 UTC
Permalink
The problem I'm trying to solve is:
I'd like to have a WCS business logic (e.g controller command) which sends an outbound XML over HTTP to some fulfillment center, "waits" for an inbound XML repsonse back from the fulfillment center, and then does the rest of business logic, so it's a synchronous message. Please note that we "don't want to use":
MQ, web services, and SOAP. Only XML over HTTP. And it's WCS 5.6, not 6.0.

Is this an option?
Define a new transport in WCS Admin Console for HTTP. Then assign a new message type to that transport. And then the code calls sendReceiveImmediate method? I think the method sendReceiveImmediate is part of WCS messaging and hopefully not part of MQ-specific API only. How viable is this solution? Any comment about this option or a new solution?

Thanks.

Mahdad
m***@gmail.com
2007-01-03 01:30:52 UTC
Permalink
<nitpick>"XML over HTTP" <b><i>is</i></b> a perfectly valid form of Web services, so in actuality Web services is <b><i>exactly</i></b> what you're talking about here.</nitpick>

If all you're doing is POST'ing some XML to a remote location and then processing the response, this is very easily doable from a controller command, though you might consider using a task command whose sole purpose it is to create the outbound document, POST the request, parse the response, and provide getters for relevant result values.

A simple HTTP client (e.g. http://jakarta.apache.org/commons/httpclient/) and DOM document builder (see the J2SE standard org.w3c.dom package) are all you need.
geo
2007-01-06 21:54:31 UTC
Permalink
I would go with a databean that encapsulates the xml over http via an
httpurlconnection. Then use jsp or some other composition method to create
the outbound message and post that via your connection. Use DOM as you
mention to parse the response and process appropriately.

We implemented our own extension to InventoryBaseCmdImpl to do exactly what
you mention in your posting and it works well.

Best regards,
George
Post by m***@yahoo.com
I'd like to have a WCS business logic (e.g controller command) which sends
an outbound XML over HTTP to some fulfillment center, "waits" for an
inbound XML repsonse back from the fulfillment center, and then does the
rest of business logic, so it's a synchronous message. Please note that we
MQ, web services, and SOAP. Only XML over HTTP. And it's WCS 5.6, not 6.0.
Is this an option?
Define a new transport in WCS Admin Console for HTTP. Then assign a new
message type to that transport. And then the code calls
sendReceiveImmediate method? I think the method sendReceiveImmediate is
part of WCS messaging and hopefully not part of MQ-specific API only. How
viable is this solution? Any comment about this option or a new solution?
Thanks.
Mahdad
m***@yahoo.com
2007-01-08 13:28:24 UTC
Permalink
Thanks mattz and George.

The solution can use HttpClient code of Jakarta. It's a fairly simple chunk of code to send an XML message over HTTP. The URL can point to a local JSP, and to simulate the response for unit-test, the local JSP can simply compose and send an XML back to the sender.

Mahdad

Loading...