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 6144405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:38:43+00:00 2026-05-23T18:38:43+00:00

Question: How does the class for the serialization of this XML content look ?

  • 0

Question: How does the class for the serialization of this XML content look ?

<?xml version="1.0" encoding="utf-8"?>
<vcc:CreateTextSearchResponse xmlns:vcc="urn:veloconnect:catalog-1.1" xmlns:vct="urn:veloconnect:transaction-1.0">
  <vct:BuyersID>12345</vct:BuyersID>
  <vct:ResponseCode>200</vct:ResponseCode>
  <vct:TransactionID>225</vct:TransactionID>
  <vct:StatusCode>2</vct:StatusCode>
  <vct:IsTest>false</vct:IsTest>
  <vcc:TotalCount>3876</vcc:TotalCount>
</vcc:CreateTextSearchResponse>

If I let it run through xsd.exe, it generates an error.

I have no problem generating this:

<?xml version="1.0" encoding="utf-8"?>
<CreateTextSearchResponse>
  <BuyersID>15942</BuyersID>
  <ResponseCode>200</ResponseCode>
  <TransactionID>225</TransactionID>
  <StatusCode>2</StatusCode>
  <IsTest>false</IsTest>
  <TotalCount>3876</TotalCount>
</CreateTextSearchResponse>

It’s just that I need those namespaces to deserialize it (and later on reserialize), so I can’t just leave it like this (it’s needed by a 3rd party web-service)…

  • 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-23T18:38:45+00:00Added an answer on May 23, 2026 at 6:38 pm

    Like this:

    [XmlRoot(Namespace = CreateTextSearchResponse.CatalogNamespace)]
    public class CreateTextSearchResponse
    {
        public const string CatalogNamespace = "urn:veloconnect:catalog-1.1",
                    TransactionNamespace = "urn:veloconnect:transaction-1.0";
        [XmlElement(Namespace=TransactionNamespace)]
        public int BuyersId { get; set; }
        [XmlElement(Namespace = TransactionNamespace)]
        public int ResponseCode { get; set; }
        [XmlElement(Namespace = TransactionNamespace)]
        public int TransactionID { get; set; }
        [XmlElement(Namespace = TransactionNamespace)]
        public int StatusCode { get; set; }
        [XmlElement(Namespace = TransactionNamespace)]
        public bool IsTest { get; set; }
        [XmlElement(Namespace = CatalogNamespace)]
        public int TotalCount { get; set; }
    }
    
    public static void Main()
    {
        var ser = new XmlSerializer(typeof(CreateTextSearchResponse));
        var obj = new CreateTextSearchResponse
        {
            BuyersId = 12345,
            ResponseCode = 200,
            TransactionID = 225,
            StatusCode = 2,
            IsTest = false,
            TotalCount = 3876
        };
        XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
        ns.Add("vcc", CreateTextSearchResponse.CatalogNamespace);
        ns.Add("vct", CreateTextSearchResponse.TransactionNamespace);
        ser.Serialize(Console.Out, obj, ns);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this question: Does implementing a custom MembershipProvider class needs you to implement
(Java question) If I reference a field in an inner class, does this cause
Can't find the answer to my question in MSND: Does Timer class guarantees that
As the question states, does the integer-factorization problem fall into the class of NP-Complete
(This question does not rely on a specific IoC framework, so the interfaces and
I have a question about the volatile statement in Java. Please look at this
Question: Does Informix have a construct equivalent to Oracle's materialized view or is there
[Question] Does anyone product release notes via an automated process? If so how. Especially
Question: Does anyone have an example of a filter as you type dropdown control
Maths101 question - does anyone know how to calculate an ellipse (width/height) that will

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.