Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 850303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:14:35+00:00 2026-05-15T07:14:35+00:00

I’ve made Web Services with Delphi in the past but most were pretty simple

  • 0

I’ve made Web Services with Delphi in the past but most were pretty simple that just took a few parameters and returned a single value to the client. A new service I am working on calls for me to be able to send and receive complex types. Consider the following types are defined in my code:

TBaseRequest = Class(TRemotable)
  private
    FUsername: string;
    FPassword: string;
  published
    Property Username: String read FUsername write FUsername;
    Property Password: String read FPassword write FPassword;
End;

TBaseResponse = Class(TRemotable)
  private
    FStatusMessage: string;
    FStatusCode: integer;
  published
    Property StatusMessage: string read FStatusMessage write FStatusMessage;
    Property StatusCode: integer read FStatusCode write FStatusCode;
End;

TSepecialRequest = class(TBaseRequest)
private
  FExtraParam: string;
published
  Property ExtraParam: String read FExtraParam write FExtraParam;
end;

TSpecialResponse = class(TBaseResponse)
private
  FExtraResult: string;
published
  Property ExtraResult: String read FExtraResultwrite FExtraResult;
end;

All of these classes are registerd with RemClassRegistry.RegisterXSClass.

Now I’ve also got the following function defined in the interface for this webservice:

function SpecialMethod(request:TSepecialRequest): TSpecialResponse;

In the service code I can easily access the parent class properties like Username and Password, but if we look at the WSDL that is generated we see that the TSpecialRequest and TSpecialResponse class members are included in the schema section.

  <xs:complexType name="TSpecialRequest">
    <xs:complexContent>
      <xs:extension base="TBaseRequest">
        <xs:sequence>
          <xs:element name="ExtraParam" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="TSpecialResponse">
    <xs:complexContent>
      <xs:extension base="TBaseResponse">
        <xs:sequence>
          <xs:element name="ExtraResult" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

This schema fragment in the WSDL shows that the TSpecials are extentions of the TBase classes and all is well except that the decription of the TBase classes are not included in the schema. I would expect there to also be a section like this, but it is missing:

  <xs:complexType name="TBaseRequest">
    <xs:sequence>
      <xs:element name="Username" type="xs:string"/>
      <xs:element name="Password" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="TBaseResponse">
    <xs:sequence>
      <xs:element name="StatusMessage" type="xs:string"/>
      <xs:element name="StatusCode" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>

However this schema fragment is missing from the generated WSDL. This means that any client attempting to use this service will not be able to correctly generate requests or interpret responses. For example, if I attempt to load the geneated WSDL into the WSDL importer in Delphi 2009, I get the following classes:

TSpecialRequest = class(TRemotable)
private
  FExtraParam: WideString;
published
  property ExtraParam: WideString read FExtraParam write FExtraParam;
end;

TSpecialResponse = class(TRemotable)
private
  FStatusMessage: WideString;
  FStatusCode: Integer;
published
  property StatusMessag: WideString read FStatusMessage write FStatusMessage;
  property StatusCode: Integer read FStatusCode write FStatusCode;
end;

The result is that the client code is unable to do things like set the username and password members that should be part of TSpecialRequest.

Does anyone have any clue why this is happening or what I can do about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T07:14:36+00:00Added an answer on May 15, 2026 at 7:14 am

    I don’t think I am going to get an answer but I have found a work around. I’m not really satisified with it, but It gets me passed the problem. The symptom described above can be avoided by using Object Composition instead of inheritance. This code functions as expected but it is less simple to use. I suppose I’ll want to come up with some kind of message factory in my implementation but thats getting off topic.

    This solution can be illustrated by the following code:

    TBaseRequest = Class(TRemotable)
      private
        FUsername: string;
        FPassword: string;
      published
        Property Username: String read FUsername write FUsername;
        Property Password: String read FPassword write FPassword;
    end;
    
    TSepecialRequest = class(TRemotable)
    private
      FExtraParam: string;
      FBaseRequest: TBaseRequest;
    published
      Property ExtraParam: String read FExtraParam write FExtraParam;
      Property BaseRequest: TBaseRequest read FBaseRequest write FBaseRequest;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm making a simple page using Google Maps API 3. My first. One marker
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.