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 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

Related Questions

How to get SOAP Client Request Header by Yii?
I have a client that wants to send a large number of SOAP Header
I have a SOAP client in Ruby that I'm trying to get working with
I've got a working SOAP::Lite client. It works against an established server, but so
I'm planning to develop a web-services (SOAP to C++ client) in Java with Metro/Hibernate
Could some one tell me how to capture SOAP messages passed between the client
I am using C# .Net 2.0 to write a webservices client. The server's soap
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 far, no Delphi version supports SOAP 1.2 clients or server. I have tried

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.