You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geoffrey Gallaway <ge...@sloth.org> on 2000/10/18 05:53:21 UTC

XML help (offtopic)?

I know this isnt the right place to ask this question but if someone could
at least fill me in and point me in the right direction I'd be gratefull.

I'm trying to find a way to do XML over HTTP. I have a project at work
that I'm doing where we have a XML based system. The system would connect
to port 80 and do XML over HTTP. I'm not exactly sure what this entails
but I'm guessing using the HTTP protocall to send XML. So, you get the
HTTP methods (GET, POST, HEAD, etc) and headers (Date, Server,
Content-Type, etc) but with XML data instead of HTML. Now, I understand I
could easily use apache to send XML data (GET) but I'm not to sure how I
should handle receiving XML (POST). I definetly want to do the XML parsing
and such with perl (I've been playing with XML::Parser, very cool). What
am I missing?

Thanks, sorry for being offtopic and for the bad explanation...
Geoff

-- 
Geoffrey Gallaway || This may seem a bit weird, but that's okay, because it
geoffeg@sloth.org || is weird.
D e v o r z h u n ||				-- Tom Christiansen 


Re: XML help (offtopic)?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Wed, 18 Oct 2000, Adi wrote:

> Have you looked at SOAP::Lite and the rest of the SOAP:: hierarchy on CPAN? 
> They may not be of direct help if you've already got a home-grown XML transport
> protocol, but it might give you some good ideas.  And, it may save you lots of
> time in the long run if you can convert your home-grown XML system to use the
> SOAP standard.
> 
> BTW, has anyone played with these SOAP modules much?  Specifically, are they
> well-written / optimized for mod_perl?

I've played a little bit with SOAP::Lite. Its a great concept, and just
seemed to work, except in certain cases, for example you can't pass a DBI
handle over SOAP, obviously, and the same goes for globs and
filehandles. But other than that its almost transparent!

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\


Re: XML help (offtopic)?

Posted by Adi <ad...@certsite.com>.
Have you looked at SOAP::Lite and the rest of the SOAP:: hierarchy on CPAN? 
They may not be of direct help if you've already got a home-grown XML transport
protocol, but it might give you some good ideas.  And, it may save you lots of
time in the long run if you can convert your home-grown XML system to use the
SOAP standard.

BTW, has anyone played with these SOAP modules much?  Specifically, are they
well-written / optimized for mod_perl?

-Adi

Geoffrey Gallaway wrote:
> 
> I know this isnt the right place to ask this question but if someone could
> at least fill me in and point me in the right direction I'd be gratefull.
> 
> I'm trying to find a way to do XML over HTTP. I have a project at work
> that I'm doing where we have a XML based system. The system would connect
> to port 80 and do XML over HTTP. I'm not exactly sure what this entails
> but I'm guessing using the HTTP protocall to send XML. So, you get the
> HTTP methods (GET, POST, HEAD, etc) and headers (Date, Server,
> Content-Type, etc) but with XML data instead of HTML. Now, I understand I
> could easily use apache to send XML data (GET) but I'm not to sure how I
> should handle receiving XML (POST). I definetly want to do the XML parsing
> and such with perl (I've been playing with XML::Parser, very cool). What
> am I missing?
> 
> Thanks, sorry for being offtopic and for the bad explanation...
> Geoff
> 
> --
> Geoffrey Gallaway || This may seem a bit weird, but that's okay, because it
> geoffeg@sloth.org || is weird.
> D e v o r z h u n ||                            -- Tom Christiansen


Re: XML help (offtopic)?

Posted by Perrin Harkins <pe...@primenet.com>.
Geoffrey Gallaway wrote:
> 
> I think I might have been a slight bit confusing in the email. I need to
> have apache be able to *recieve* the POST and GET requests. I know how to
> send the XML to another server, I just need to know how to get *my*
> server to handle the requests/data from other clients..

Seems like you'd handle this the same as any HTML form with a POST
method.  If you aren't sure what that looks like you can read the HTTP
specs or make LWP generate some POST requests and look at them.  It's
pretty simple stuff.

- Perrin

Re: XML help (offtopic)?

Posted by Geoffrey Gallaway <ge...@sloth.org>.
I think I might have been a slight bit confusing in the email. I need to
have apache be able to *recieve* the POST and GET requests. I know how to
send the XML to another server, I just need to know how to get *my*
server to handle the requests/data from other clients..

Geoff

This one time, at band camp, cloudnine wrote:

> HTTP::Request is your friend.  It generates an HTTP request, whether it be
> a get or a post. 
>  
> LWP::UserAgent actually performs the request for you.  
> 
> ## example:
> my $request = HTTP::Request->new(POST=>'http://foo.bar.com');
> $request->content_type('application/x-www-form-urlencoded');
> $request->content("XMLStuff=$scalarWithYourXML"); ## add the xml to the post.
> 
> my $ua = LWP::UserAgent->new;
> my $response;
> $response = $ua->simple_request($request);
> unless ( $response->is_success ) {
>     ## do what must be done in event of a failure
> }
> 
> ## whatever else....
> 
> The receiving server could grab the XMLStuff as $r->param('XMLStuff');
> Hope i answered your question!
> 
> - Matt Avitable
> 
> 
> On Tue, 17 Oct 2000, Geoffrey Gallaway wrote:
> > 
> > I'm trying to find a way to do XML over HTTP. I have a project at work
> > that I'm doing where we have a XML based system. The system would connect
> > to port 80 and do XML over HTTP. I'm not exactly sure what this entails
> > but I'm guessing using the HTTP protocall to send XML. So, you get the
> > HTTP methods (GET, POST, HEAD, etc) and headers (Date, Server,
> > Content-Type, etc) but with XML data instead of HTML. Now, I understand I
> > could easily use apache to send XML data (GET) but I'm not to sure how I
> > should handle receiving XML (POST). I definetly want to do the XML parsing
> > and such with perl (I've been playing with XML::Parser, very cool). What
> > am I missing?
> > 
> 

-- 
Geoffrey Gallaway || Programming the X Window System is like trying to find 
geoffeg@sloth.org || the square root of pi using Roman numerals.
D e v o r z h u n || 				-- Anonymous


Re: XML help (offtopic)?

Posted by cloudnine <cl...@escapement.net>.
HTTP::Request is your friend.  It generates an HTTP request, whether it be
a get or a post. 
 
LWP::UserAgent actually performs the request for you.  

## example:
my $request = HTTP::Request->new(POST=>'http://foo.bar.com');
$request->content_type('application/x-www-form-urlencoded');
$request->content("XMLStuff=$scalarWithYourXML"); ## add the xml to the post.

my $ua = LWP::UserAgent->new;
my $response;
$response = $ua->simple_request($request);
unless ( $response->is_success ) {
    ## do what must be done in event of a failure
}

## whatever else....

The receiving server could grab the XMLStuff as $r->param('XMLStuff');
Hope i answered your question!

- Matt Avitable


On Tue, 17 Oct 2000, Geoffrey Gallaway wrote:
> 
> I'm trying to find a way to do XML over HTTP. I have a project at work
> that I'm doing where we have a XML based system. The system would connect
> to port 80 and do XML over HTTP. I'm not exactly sure what this entails
> but I'm guessing using the HTTP protocall to send XML. So, you get the
> HTTP methods (GET, POST, HEAD, etc) and headers (Date, Server,
> Content-Type, etc) but with XML data instead of HTML. Now, I understand I
> could easily use apache to send XML data (GET) but I'm not to sure how I
> should handle receiving XML (POST). I definetly want to do the XML parsing
> and such with perl (I've been playing with XML::Parser, very cool). What
> am I missing?
>