
joel at fysh
Nov 23, 2009, 5:39 AM
Post #2 of 2
(503 views)
Permalink
|
2009/11/23 Jens Schwarz <blacky6767 [at] gmx>: > Hi, > > I want to change my Catalyst app so that its data is not written/read to/from my MySQL-DB but to/from Webservices. > > I have made a simple test (outside of Catalyst) with SOAP::WSDL that works for "reading" a Webservice. This looks like this: <snip> > But actually I have no clue on how to consume a Webservice "the Catalyst way". The amount of CPAN modules covering SOAP, WSDL, ... is overwhelming and I am kind of lost. > > Are there any remommendations - especially with detailed examples? It was hard for me to even get this simple example above working as I am SOAP/WSDL newbie. I think you have the right idea. Build a standalone web-service client. In your example you're using a SOAP service, so I would use XML::Compile::SOAP and XML::Compile::WSDL11, but you might have good luck with the SOAP::* modules, I am less familiar with those. Either way, build a standalone client which you can test on its own. Finally build a thin Catalyst-aware shim, using Catalyst::Model::Adaptor or Catalyst::Component::InstancePerContext, which wraps/consumes your standalone model and captures whatever Catalyst config etc you need to use your model within Catalyst. This approach may require slightly more code files than the monolithic approach but will be much simpler to test since you remove the Catalyst dependency from verifying the majority of your model's behaviour. /joel _______________________________________________ List: Catalyst [at] lists Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst [at] lists/ Dev site: http://dev.catalyst.perl.org/
|