我正在尝试使用 Erlang 和 YAWS(特别是 yaws_soap_lib 模块)通过 SOAP 调用 WebService。http://yaws.hyber.org/soap_intro.yaws上发布的示例对我有用。
但是,当尝试调用我自己的 Web 服务时,YAWS 失败了。第一个问题是 WSDL 中的合作伙伴链接被放在那里,因为 BPEL 在此服务之前。我删除了它们(暂时)。
不幸的是,我遇到了另一个问题:提到的 WSDL 有一个空的 <types> 标记。现在,我对 WSDL 规范和 SOAP 不是很熟悉,所以我的问题是它是否是
- 无法处理空 <types> 标记的 Erlang SOAP 库问题或
- 生成不良的 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数组是空的。