我正在尝试使用 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>
所以我想现在的问题是如何重新排列这些文件以便它们通过验证。