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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:30:25+00:00 2026-05-18T11:30:25+00:00

I have run into a bit of a problem, well not sure if it

  • 0

I have run into a bit of a problem, well not sure if it is a problem, but would like some advice.

I have developed a c# webservice in vs2010 and when I debug the service i get this error in my browser

The XML element ‘VoucherResponse’ from namespace ‘http://test.org/’ references a method and a type. Change the method’s message name using WebMethodAttribute or change the type’s root element using the XmlRootAttribute.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The XML element ‘VoucherResponse’ from namespace ‘test.org’ references a method and a type. Change the method’s message name using WebMethodAttribute or change the type’s root element using the XmlRootAttribute.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Now looking at my code in at the actual class "VoucherResponse" i have,

public class VoucherResponse : AResponse
{
    public Voucher Voucher { get; set; }
}

And the Voucher object looks like this

public class Voucher
{
    public string PIN { get; set; }
    public string Serial { get; set; }
    public string Batch { get; set; }
}

Now in one of my web methods I return the VoucherResponse and I am assuming that this error occurs when it is reflected through and checked.

Has anyone had a similar problem with this before, or can anyone give me some advice on this?

Thanks

  • 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-18T11:30:26+00:00Added an answer on May 18, 2026 at 11:30 am

    Apparently, SOAP cannot handle methods that have the same name as their return type.
    You can fix it by reading the error, and acting accordingly:

    public class VoucherResponse
    {
        [WebMethod(MessageName="TheVoucher")]
        public Voucher Voucher{get; set;}
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have run into a bit of a tricky problem in some C++ code,
I have run into a bit of a problem here: I had a problem-specific
I have run into a little problem. I am connecting to a webservice that
Apparently many people have run into this problem, but I have yet to be
I have run into a bit of a problem. Usually when dealing with UITableView
Hey.. I have run into a bit of a problem with my python code..
I have run into a bit of a problem and a head scratcher, as
I have run into a bit of a design issue with my code. I
I'm rather new to Backbone.js development, and have run into a bit of a
Im trying to learn a bit about c++ and have run in to some

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.