[AWS] Problem using wsdl2ada
Björn Lundin
b.f.lundin at gmail.com
Tue Nov 20 15:15:15 CET 2012
2012/11/20 Pascal Obry <pascal at obry.net>:
>
> Björn,
>
> BTW, is this some kind of inheritance?
I'm not sure, but
http://www.w3schools.com/schema/el_extension.asp
seems to indicate that.
> Does LoginResp contains all fields of APIResponse plus the four
> (current, errorCode, minorErrorCode and validUnit) fields? What does
> Visual Studio generate?
Hmm, no. A closer look reveals that LoginResp is broken.
----------------
with www.betfair.com.publicapi.types.global.v3.APIResponse_Type_Pkg;
use www.betfair.com.publicapi.types.global.v3.APIResponse_Type_Pkg;
with Ada.Calendar;
with Ada.Strings.Unbounded;
with SOAP.Types;
pragma Elaborate_All (SOAP);
pragma Elaborate_All (SOAP.Types);
with SOAP.Utils;
pragma Elaborate_All (SOAP.Utils);
package www.betfair.com.publicapi.types.global.v3.LoginResp_Type_Pkg is
pragma Warnings (Off, Ada.Calendar);
pragma Warnings (Off, Ada.Strings.Unbounded);
pragma Warnings (Off, SOAP.Types);
pragma Warnings (Off, SOAP.Utils);
pragma Style_Checks (Off);
use Ada.Strings.Unbounded;
function "+"
(Str : String)
return Unbounded_String
renames To_Unbounded_String;
type LoginResp_Type is record
: APIResponse_Type;
end record;
function To_LoginResp_Type
(O : SOAP.Types.Object'Class)
return LoginResp_Type;
function To_SOAP_Object
(R : LoginResp_Type;
Name : String := "item")
return SOAP.Types.SOAP_Record;
end www.betfair.com.publicapi.types.global.v3.LoginResp_Type_Pkg;
----------------
The record definition misses the variable,
as well as the specified fields :
currency
errorCode
minorErrorCode
validUntil
> So even when switching the order wsdl2ada might not generate a proper
> definition.
Unfortunately, you are correct.
I tried to short the wsdl down to a minimum, but being unused to them,
it's a bit tricky. Not done yet.
however, the c# code looks like this (a snippet from a large file)
public partial class LoginResp : APIResponse {
private string currencyField;
private LoginErrorEnum errorCodeField;
private string minorErrorCodeField;
private System.DateTime validUntilField;
...
public partial class APIResponseHeader : object,
System.ComponentModel.INotifyPropertyChanged {
private APIErrorEnum errorCodeField;
private string minorErrorCodeField;
private string sessionTokenField;
private System.DateTime timestampField;
...
public abstract partial class APIResponse : object,
System.ComponentModel.INotifyPropertyChanged {
private APIResponseHeader headerField;
So, you are right in inheritance.
--
/Björn
More information about the AWS
mailing list