开发者

How can I create a SOAP server in Perl?

I'm working with a third-party vendor who unfortunately requires that we set up a SOAP server to handle requests from them. I'm having some trouble finding the best way to go about this. One limitation I'm imposing is that it runs as a mod_perl2 handler. After some searching I've found that the best way may be to use XML::Compile and its SOAP classes but I'm having a tough time wrapping my head around it. Part of the problem is my limited understanding of SOAP and the documentation for most modules seems a bit cryptic to me.

So, can anyone give me some pointers, sample code, anything?

EDIT: we were also given a WSDL file to use, and this was not compatible wit开发者_JAVA百科h SOAP::WSDL ("unsupported global type found in ... Looks like a rpc/literal WSDL, which is not supported by SOAP::WSDL)

EDIT: XML::Compile::SOAP complains "RPC encoded not supported by this version" when using the WSDL with XML::Compile::WSDL11. Can/should I not worry about the WSDL file?


If you have a limited understanding of SOAP, starting reading about SOAP before you worry about implementing it. There are lots of SOAP tutorials out there. Most of the documentation probably seems cryptic to you because you don't already know SOAP.

It's not that tricky of a process. It's not that different than any other web programming when it comes to the big steps:

  • You get a SOAP request, which is some XML.
  • You pull apart the XML to figure out what to do.
  • You put together some XML to send as a response.
  • You return the response.

XML::Compile will take care of most of the details for you.

Before you start writing your own server, you might consider writing a client for an existing SOAP server just to give yourself some practice.


I found two modules that can help you make soap server, but I never use its

https://metacpan.org/pod/XML::Compile::SOAP::Daemon

https://metacpan.org/pod/SOAP::WSDL::Server

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜