jonesoncorners has asked for the wisdom of the Perl Monks concerning the following question:

We are trying to build an async interface with a middleware which sends a SOAP formatted string via an HTTP post. This request is acknowledged with HTTP 200 and the connection is closed.

To receive the response we will be exposing another perl page, the URL of which will be provided to middleware team. This URL will be altered to have the response xml. So effectively we are using the URL query string to send and receive response.

I am absolutely new to perl and hence was hoping to get some help on how to go about implementing this and how to expose the perl based page so that it can be called anytime.

1) getListPrice.pl will prepare a SOAP formatted string and send this across to the middleware web service using the LWP::userAgent and post. 2)setListPrice.pl is the page we are hoping to build which middleware will call and supply the response in the URL query string. http://example.com:62040/SetListPrice.asp/?RequestXML=<...SOAP XML...>

EDIT 1 :- Perl version which I have to work with v5.8.4 built for sun4-solaris-64int.

Replies are listed 'Best First'.
Re: Reading SOAP formatted text sent via GET.
by FreeBeerReekingMonk (Deacon) on Nov 26, 2016 at 09:03 UTC
    Ok, so you are trying PAAS (Perl as a Service). And you are not using a RESTful interface to do that. What do you have? Basic perl where you need to write your own webserver? An Apache webserver where you can put CGI-BIN's in? A Plack/Dancer2?

    If you have an apache webserver, that allows CGI's in your home directory... then read "Writing a CGI program" at Apache docs - cgi

    Get that first running.

    edit: Here is a very good Perl CGI tutorial: perl_cgi

    Once you mastered that, throw SOAP into the mix (scroll down to the examples first, or you head will overload and explode): SOAP::Lite

    If you are interested in theory and alternative methods: modern ways of doing web services

Re: Reading SOAP formatted text sent via GET.
by Anonymous Monk on Nov 25, 2016 at 23:12 UTC

    I am absolutely new to perl and hence was hoping to get some help on how to go about implementing this and how to expose the perl based page so that it can be called anytime.

    Just do it? I don't understand what you're asking, you've mentioned all the keywords, and even a key module name ... not sure where the confusion lies exactly?

    Have you heard of Mojo?

    ...?RequestXML=...

    Last I checked URL query strings have size limitations , and transfering "CONTENT" via "GET" goes against the spirit of HTTP :D

      I take your point re. query size limitation and it is 2k characters which just about meets our requirement. The version of Perl I have does not support Mojo. I was looking for a starting point for 1)Code to read URL string sent by either GET or POST