0

我正在尝试使用 Erlang 和 YAWS(特别是 yaws_soap_lib 模块)通过 SOAP 调用 WebService。http://yaws.hyber.org/soap_intro.yaws上发布的示例对我有用。

但是,当尝试调用我自己的 Web 服务时,YAWS 失败了。第一个问题是 WSDL 中的合作伙伴链接被放在那里,因为 BPEL 在此服务之前。我删除了它们(暂时)。

不幸的是,我遇到了另一个问题:提到的 WSDL 有一个空的 <types> 标记。现在,我对 WSDL 规范和 SOAP 不是很熟悉,所以我的问题是它是否是

  1. 无法处理空 <types> 标记的 Erlang SOAP 库问题或
  2. 生成不良的 WSDL?

有谁知道处理 SOAP 的更好的 Erlang 库?我看过 erlsoap 但它不支持 WSDL。

编辑:由提到的 WSDL 引起的错误:


::error:function_clause
  in function erlsom_add:add_model/2
    called as add_model({model,[{type,'_document',sequence,
              [{el,[{alt,'soap:Envelope','soap:Envelope',...},
                    {alt,'soap:Header',...},
                    {alt,...},
                    {...}],
                   1,1,1}],
              [],undefined,undefined,1,1,1,false,...},
        {type,'soap:detail',sequence,
              [{el,[{alt,'#any',...},{alt,...},{...}|...],0,unbound,1}],
              [],
              {anyAttr,"lax","##any",[...]},
              undefined,2,1,1,...},
        {type,'soap:Fault',sequence,
              [{el,[{alt,...}],1,1,...},
               {el,[{...}],1,...},
               {el,[...],...},
               {el,...}],
              [],undefined,undefined,5,1,...},
        {type,'soap:Body',sequence,
              [{el,[{...}|...],0,...}],
              [],
              {anyAttr,[...],...},
              undefined,2,...},
        {type,'soap:Header',sequence,
              [{el,[...],...}],
              [],
              {anyAttr,...},
              undefined,...},
        {type,'soap:Envelope',sequence,[{el,...},{...}|...],[],{...},...}],
       [{ns,"http://schemas.xmlsoap.org/soap/envelope/","soap"},
        {ns,"http://www.w3.org/2001/XMLSchema","xsd"}],
       "http://schemas.xmlsoap.org/soap/envelope/",[]},undefined)
  in call from yaws_soap_lib:initModel2/5

熟悉源码的朋友:问题是getXsdsFromWsdl函数返回的Xsds数组是空的。

4

3 回答 3

0

考虑到函数子句错误,我猜想 erlsom 没有将某些特定函数输入处理为未定义。但是我假设您已经验证了您的 WSDL 以确保它没问题?此外,是否有机会在某处发布 WSDL 以便我们查看?

于 2011-03-23T19:06:10.623 回答
0

该问题已在最新的 YAWS 版本中得到解决。为了构建提到的 WSDL 模型,必须调用以下命令:

yaws_soap_lib:initModel(WSDL_FILE_URL, [{include_fun, {erlsom_lib, find_xsd}}])
于 2011-11-04T11:06:25.120 回答
0

我的 XML 模式 fu 有点生疏,但据我所知,该模式允许空<types/>元素。这将建议第一种选择,尽管很难确定。你得到什么错误信息?

于 2011-03-23T13:26:01.273 回答