Bill,

I think your approach below is fairly sound. My wish would have been to leverage the URL generator, because if you except the posting part, of course, the result of a GET or a POST could be handled exactly the same way.

The URL generator is able to:

o retrieve and parse XML
o retrieve and parse HTML to XML
o retrieve plain text (not documented)
o retrieve binaries

It does not:

1. Provide information about returned headers and the like
2. Support POST

For 1 above, it could be simply a configuration of the URL generator that, instead of returning simply the XML document on the output, would encapsulate it into something like your http-response element. I say something like it, bcause we can access not only the "http:" protocol, but "file:", etc.

Right now in the URL generator we make a distinction between the "oxf:" protocol and all the other ones. If we would like to use something like the Apache commons-httpclient, we could easily plug this in as well.

-Erik

Bill Winspur wrote:

Erik,

You asked:

Are you trying to post and XML document? Is that the functionality you are missing?

In one case, yes. It happens that one gateway formats its payment request and
payment-response records as xml. The payment request is sent as a form post, and
the response is another xml message, presumably accessible to java via an input stream on a URLConnection.


Also, although I'm new to this payment gateway scene, I expect that there are
gateways out there that use proprietary, non-xml syntax for their request and
response messages.


Naturally, for gateways that offer a web-service, OXF already has a solution.

Clarification Of the Requirement
--------------------------------

Thinking as I type, the functionality I am missing could be provided by
a generator that

   * posts a text message (or the text of an xml document) to a
     specified webserver
   * waits for the server to respond
   * captures the response from the http server as an xml document,
   * outputs the document to the pipeline.

The message to be sent (for non xml payment requests) would be an
xml doc on the config input of the processor, formatted as follows:

<http-request>
<url>http://someserver</url>
<content>rquest-string</content>
</http-response> or, for a gateway that uses xml formatting, something like the following


   <http-request>
       <url>http://someserver</url>
       <content>             <?xml version="1.0" encoding="UTF-8"?>
           <TranxRequest>
               <MerchantNumber></MerchantNumber>
               <Products></Products>
               <xxxCard_Number></xxxCard_Number>
               <xxxCCMonth></xxxCCMonth>
               <xxxCCYear></xxxCCYear>
               <CVV2></CVV2>
               <CVV2Indicator></CVV2Indicator>
               <xxxName></xxxName>
               <xxxAddress></xxxAddress>
               <xxxCity></xxxCity>
               <xxxProvince></xxxProvince>
               <xxxPostal></xxxPostal>
               <xxxCountry></xxxCountry>
               <xxxPhone></xxxPhone>
               <xxxEmail></xxxEmail>
           </TranxRequest>
         </content>
   </http-response>

The format of the returned xml response document would be

<http-response>
   <mime-type/>
   <content/>
</http-response>

A hypothetical example response document, generated for a non-xml response,
using positional arguments, would be

<http-response>
   <mime-type>text/plain</mime-type>
   <content>10339, 224, a496, John Smith, 2004/10/10, Visa, OK</content>
</http-response>

The same response from a gateway using xml formats would be

<http-response>
   <mime-type>text/plain</mime-type>
      <content>
          <transaction-response>
               <merchant-number>10339</merchant-number>
               <receipt-number>224</receipt-number>
               <sales-order-number>a496</sales-order-number>
               <name>John Smith</name>
               <date>2004/10/10</date>
               <card-type>Visa</card-type>
               <approval-code>OK</approval-code>
            </transaction-response>
       </content> </http-response>

Alternatives
------------

OK, that's one way to contact a payment gateway webserver.
But before I vanish into hacking out the processor described
above, or wrap some http tunnel code I already have as a
session ejb to be invoked via the delegation processor, is
there an existing approach to accomplishing this with OXF?

Bill.

Bill,

Are you trying to post an XML document? Is that the functionality you are missing?

-Erik

Bill Winspur wrote:

Are there any examples of issuing http requests to another site,
waiting for the response, and delivering it via a request generator. ?

The delegate processor looks close, but it seems to deal only with soap messaging.

I need to talk to a non-soap payment gateway.

Perhaps I'll have to wrap this in a session ejb, but OXF seems to have
everything else. I suspect I've missed an existing capability.




------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to