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

  • Home
  • SEARCH
  • 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 246839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:12:21+00:00 2026-05-11T21:12:21+00:00

In a SOAP client request, the header needs this line: <NS2:Header Name=Foo>Bar<NS2:Header> So I

  • 0

In a SOAP client request, the header needs this line:

<NS2:Header Name="Foo">Bar<NS2:Header>

So I wrote a class which has two string properties:

  • the Content property – for the value of the element (“Bar”)
  • the Name property – for the value of the attribute (“Foo”)

The AS_ATTRIBUTE flag of the Name property should indicate that it is an XML “attribute”.

   Header = class(TSoapHeader)
   private
     FContent: string;
     FName: string;
   published
     property Content: string read FContent write FContent;
     property Name: string read FName write FName stored AS_ATTRIBUTE;
   end;

and register with

   RemClassRegistry.RegisterXSClass(Header, MY_URI);
   RemClassRegistry.RegisterSerializeOptions(Header, [xoLiteralParam, 
xoSimpleTypeWrapper]);

The xoLiteralTypWrapper option indicates that the class should only ‘wrap’ the value Content property in the element and not add a nested element for it.

For Name := “Foo” and Content := “Bar”, this will be the result XML code in the SOAP request:

<NS2:Header Name="Foo">
   <Content xsi:type="xsd:string">Bar</Content>
</NS2:Header>

The attribute is in the correct place, but the content value is in a nested tag which should not be here. If I remove the Name property from the class definition the Content property will look nice as the element content, like this:

<NS2:Header>Bar</NS2:Header>

It looks like a conflict between the two requirements – if I have the
attribute, I will not get the xoSimpleTypeWrapper style.

  • 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-11T21:12:21+00:00Added an answer on May 11, 2026 at 9:12 pm

    I haven’t tried this so this is a speculation. Try overriding ObjectToSOAP and SOAPToObject method. In the help file it says

    Override ObjectToSOAP to customize the
    way your application converts a
    TSOAPHeader descendant to its SOAP
    representation.

    Again, I haven’t tried this on compiler, but it could look like the following:

    function Header.ObjectToSOAP(RootNode, ParentNode: IXMLNode; 
      const ObjConverter: IObjConverter; const Name, URI: InvString; 
      ObjConvOpts: TObjectConvertOptions; out RefID: InvString): IXMLNode;  
    begin 
      ObjConvOpts := ObjConvOpts + [ocoDontSerializeProps]; 
      Result := inherited ObjectToSOAP(RootNode, ParentNode, ObjConverter, Name, URI, ObjConvOpts, RefID); 
      Result.Text := FContent; 
      Result.Attributes['Name'] := FName;
    end; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 182k
  • Answers 182k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One more thing: the SuperWaba project with all sources is… May 12, 2026 at 4:28 pm
  • Editorial Team
    Editorial Team added an answer You dont have to do that because your updating a… May 12, 2026 at 4:28 pm
  • Editorial Team
    Editorial Team added an answer Almost any scientific code -- finite differences, finite elements, etc.… May 12, 2026 at 4:28 pm

Related Questions

I'm extremely new to SOAP and I'm trying to implement a quick test client
I've developed a Silverlight client that has worked fine on regular HTTP, but now
So I'm trying to write a php SOAP client that requires the user to
I'm in a tough situation in which a Java web service endpoint hosted on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.