WSDL 空<类型>标签和 YAWS SOAP 支持类型>
我正在尝试使用 Erlang 和 YAWS(特别是 yaws_soap_lib 模块)通过 SOAP 调用 WebService。 http://yaws.hyber.org/soap_intro.yaws 上发布的示例对我有用。
但是,当尝试调用我自己的 Web 服务 YAWS 时失败。第一个问题是 WSDL 中的合作伙伴链接,因为 BPEL 位于该服务后面,所以将其放在那里。我删除了它们(暂时)。
不幸的是,我遇到了另一个问题:提到的 WSDL 有一个空的
- Erlang SOAP 库问题无法处理空的
。标签或 - 生成错误的 WSDL?
有谁知道有更好的 Erlang 库来处理 SOAP 吗?我查看了 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 数组为空。
I am trying to invoke a WebService through SOAP using Erlang and YAWS (yaws_soap_lib module specifically). The examples published on http://yaws.hyber.org/soap_intro.yaws work for me.
However, when trying to invoke my own web service YAWS fails. The first problem were partner links in the WSDL that were put there because of BPEL is befind this service. I deleted them (for now).
Unfortunately, I've come across another problem: mentioned WSDL has an empty <types> tag. Now, I am not very familiar with WSDL specification and SOAP so my question is whether it is
- Erlang SOAP library issue that cannot handle empty <types> tag or
- badly generated WSDL?
Does anyone know any better Erlang library for handling SOAP? I have taken a look at erlsoap but it does not support WSDLs.
EDIT: error caused by mentioned 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
For those who are familiar with the source code: The problem is the Xsds array returned by getXsdsFromWsdl function is empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的 XML 模式 fu 有点生疏,但据我所知 模式 允许空的
元素。这表明第一种选择,尽管很难确定。您收到什么错误消息?My XML schema fu is a bit rusty, but as far as I can see the schema permits empty
<types/>
elements. That would suggest the first alternative, though it's hard to be sure. What error message do you get?我猜想,鉴于函数子句错误,erlsom 没有将某些特定的函数输入处理为未定义。但我假设您已经验证了 WSDL 以确保它没问题?另外,是否有机会将 WSDL 发布到某个地方以便我们可以看到它?
I would guess given the function clause error that erlsom is not handling some particular function input as being undefined. But I assume you've already validated your WSDL to make sure it's OK? Also, any chance of posting the WSDL somewhere so we can see it?
该问题已在最新的 YAWS 版本中得到解决。为了构建提到的 WSDL 模型,必须调用以下命令:
The issue has been resolved in latest YAWS version. In order to construct mentioned WSDL model following command has to be invoked: