我的问题可能首先看起来有重复,但我遇到了一些让我惊讶的事情。 Yaws Webserver
附带了一套完整的 SOAP 示例,但是当我尝试按原样运行它时,这就是我得到的:
以文本形式,这是我在 shell 中看到的:
1> inets:start(). ok 2> yaws_soap_lib:call("http://www.webservicex.net/WeatherForecast.asmx?WSDL","GetWeatherByPlaceName",["Boston"]).
=ERROR REPORT==== 15-Apr-2013::20:32:11 === Call to tuple fun {erlsom_parse,xml2StructCallback}. Tuple funs are deprecated and will be removed in R16. Use "fun M:F/A" instead, for example "fun erlsom_parse:xml2StructCallback/2". (This warning will only be shown the first time a tuple fun is called.) {error,{decoding,"Malformed: Illegal character in prolog"}}
3> yaws_soap_lib:call("http://www.webservicex.net/WeatherForecast.asmx?WSDL","GetWeatherByPlaceName",["Boston"]). {error,{decoding,"Malformed: Illegal character in prolog"}} 4>
您可以尝试下面的雅司病示例 page 。
另一个问题是我尝试过其他 SOAP 库,例如 detergent和 erlsoap它们要么太旧,要么完全无法使用。大多数解决方案,甚至雅司病,都提到了他对
erlsom
的依赖,我认为是用于 XML 解析。但是,我很难单独使用 erlsom 来提供 SOAP 服务。 有人提供了一些关于我如何在 erlang 中使用 SOAP 服务(sa 客户端和服务器)的信息,并请解释我在雅司病中遇到的错误。我正在使用最新的雅司病版本和erlang 15B。
最佳答案
这是一个丑陋的黑客行为,但以下是我处理 SOAP 请求的方式:
编写一个包含以下内容的函数/模块:
关于web-services - Erlang 和 SOAP 服务 - 进退两难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16021505/