【问题标题】:scalaxb requires missing typescalaxb 需要缺少类型
【发布时间】:2016-10-27 17:36:59
【问题描述】:

我正在尝试使用 scalaxb 从两个 wsdl 文件生成 Web 服务。 以下是文件:https://services.pwsdemo.com/WSDL/PwsDemo_creditcardtransactionservice.xml.
https://services.pwsdemo.com/WSDL/PwsDemo_creditcardmanagementservice.xml
我将它下载到本地机器并运行以下命令:
$ scalaxb PwsDemo_creditcardmanagementservice.xml PwsDemo_creditcardtransactionservice.xml -p delta

我收到了错误:
Referenced type {http://schemas.datacontract.org/2004/07/ThreeDelta.Web.Services.ECLinx.Definitions}ClientCredentials was not found.

我的代码中有一个 ClientCredentials 类,非常简单:

class Halo_3Delta_Request_ClientCredentials
{
    protected $ClientCode;
    protected $UserName;
    protected $Password;

    public function __construct($clientCode, $username, $password)
    {
        $this->ClientCode = $clientCode;
        $this->UserName = $username;
        $this->Password = $password;
    }
}

提供缺失类型的好方法是什么?

更新:
我发现这个类型定义已经存在于 wsdl 文件中:

  <xs:complexType name="ClientCredentials">
    <xs:sequence>
      <xs:element minOccurs="0" name="ClientCode" nillable="true" type="xs:string"/>
      <xs:element minOccurs="0" name="Password" nillable="true" type="xs:string"/>
      <xs:element minOccurs="0" name="UserName" nillable="true" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>

所以我想现在的问题是如何重新排列这些文件以便它们通过验证。

【问题讨论】:

    标签: xml scala xsd wsdl scalaxb


    【解决方案1】:

    错误只是在 XML 结构中。
    以下是重新排列的两个文件,以便它们可以被 scalaxb 解析:

    PwsDemo_creditcardmanagementservice.xml

    PwsDemo_creditcardtransactionservice.xml

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-19
      • 2020-05-30
      • 1970-01-01
      • 2017-10-28
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多