I'm trying to use scalaxb to generate a web service from two wsdl files.
Here are the files: https://services.pwsdemo.com/WSDL/PwsDemo_creditcardtransactionservice.xml.
https://services.pwsdemo.com/WSDL/PwsDemo_creditcardmanagementservice.xml
I downloaded it to my local machine and ran the following command:
$ scalaxb PwsDemo_creditcardmanagementservice.xml PwsDemo_creditcardtransactionservice.xml -p delta
I got the error:
Referenced type {http://schemas.datacontract.org/2004/07/ThreeDelta.Web.Services.ECLinx.Definitions}ClientCredentials was not found.
I have a ClientCredentials class in my code, it's really simple:
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;
}
}
What would be a good way to provide the missing type?
Update:
I located this type definition already present in the wsdl files:
<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>
So I guess the question now is how to rearrange those files so they pass validation.
The error is merely in XML structure.
Here are the two files rearranged so that they can be parsed by scalaxb:
PwsDemo_creditcardmanagementservice.xml
PwsDemo_creditcardtransactionservice.xml