Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle SOAP service within persistent Perl web application with cookies?

Due to the fall of SOAP::WSDL which had generated me real Perl modules I have to look for something other in order to handle a SOAP service. The generated modules won't work starting from Perl v5.18.

I have the following situation with my web application.

  • I have a PSGI compatible, Dancer2 driven, persistent web application.
  • The web application handles multiple concurrent customers.
  • The web application is between the customer and an external SOAP service.
  • The SOAP service uses customer sessions via cookies which have to be integrated on the web application internally for the customer.
  • The web application holds an WSDL file copy of the SOAP service.

I'm looking for a module that creates an interface out of the WSDL file and handles parameter/schema validation and communication with the SOAP service. I would like to call a method (SOAP call) with parameters (SOAP call parameters) and receive a cleaned data or object structure of the response.

The problem is that the web application needs to handle multiple concurrent customer cookie sessions. So I need a module which offers the possibility to override the cookie jar for that particular request and extract the cookies after the request without causing interference with other concurrent requests.

I found XML::Compile which I can initialize as a singleton at web application start up. But with this solution I ran into problems with interfering other customer requests. So the requests are not separated. Initializing XML::Compile for every request is not the solution either because it will parse the WSDL and generate handlers over and over again for every request the customer sends to the web application.

Is there any solution/module that fits my needs or do I miss something with XML::Compile and it's possible with it?

like image 803
burnersk Avatar asked Sep 16 '14 18:09

burnersk


1 Answers

Are you using Catalyst?

I've been happy using Catalyst::Controller::SOAP and its companion Catalyst::Model::SOAP to build SOAP/WSDL servers and consumers, being able to integrate Perl Applications even with Microsoft Document Literal-Wrapped thing.

Even if not using Catalyst you may probably learn from its code. It uses XML::Compile::WSDL11.

like image 99
lnrdo Avatar answered Oct 15 '22 10:10

lnrdo