Groups > Borland > Delphi web services WSDL > Re: WSDLImp code not working with SOAPResponse as expected




WSDLImp code not working with SOAPResponse as expected

WSDLImp code not working with SOAPResponse as expected
Fri, 11 Apr 2008 19:58:25 +010
Can someone help me with working out why a call using a function created by
WSDLImp from a 3rd party WSDL doesn't provide the correct results.

The function returns a list of country names and their codes. The WSDL
import implies (as far as I can work out) that they put them into an array.

Extracting the relevant lines from the WSDLImp program

const
  IS_OPTN = $0001;
  IS_UNBD = $0002;
  IS_NLBL = $0004;
  IS_ATTR = $0010;
  IS_TEXT = $0020;
  IS_REF  = $0080;

  MycSoap = interface(IInvokable)
...
    function  GetPassportCountries: ArrayOfMyCountry; stdcall;
...

  ArrayOfMyCountry = array of MyCountry;

  MyCountry = class(TRemotable)
  private
    FText: WideString;
    FCountryCode: WideString;
    FCountryCode_Specified: boolean;
    procedure SetCountryCode(Index: Integer; const AWideString: WideString);
    function  CountryCode_Specified(Index: Integer): boolean;
  published
    property Text:        WideString  Index (IS_TEXT) read FText write
FText;
    property CountryCode: WideString  Index (IS_ATTR or IS_OPTN) read
FCountryCode write SetCountryCode stored CountryCode_Specified;
  end;


To my knowledge all I should have to do is in my form module is include

   uses
     MyWSDLImp,....

private
     MyCountries: ArrayOfMyCountry;
     MyLink: MycSoap;

....

implementation
...

{in a procedure}
     MyLink := GetMycSoap(true, '',RIO1);

....

      MyCountries := myLink.GetPassportCountries;


length(MyCountries) produces the correct response of 269 but there appears
to be no data in the published data Text or Countrycode.


This is a sample of the SOAP response from the function call (I intercepted
the response). As you can see I get a valid response but the WSDLImp code is
not mapping the XML to the Country array correctly

<soap:Body><GetPassportCountriesResponse
xmlns="https://www........asmx">
<GetPassportCountriesResult>
<MyCountry CountryCode="AFG">Afghanistan</MyCountry>
<MyCountry CountryCode="ALB">Albania</MyCountry>
<MyCountry CountryCode="DZA">Algeria</MyCountry>
.....

Kerry
Can someone guide me to why this could be the case.

Kerry

Post Reply
Re: WSDLImp code not working with SOAPResponse as expected
Sun, 13 Apr 2008 12:13:47 -070
Hello,

This looks like an unbounded array. Can you confirm now 'ArrayOfMyCounty' is
registered? Specially, I'd like to know if the following was generated by
the importer:

    RemClassRegistry.RegisterSerializeOptions(TypeInfo(ArrayOfMyCountry),
[xoInlineArrays]);

With the above and the latest runtime (here
http://cc.codegear.com/Item/24535) I would expect the deserialization to
work.

Please, let me know!

Cheers,

Bruneau.

Post Reply
about | contact