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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:46:07+00:00 2026-05-26T23:46:07+00:00

How to I control parameter type tag in ASP.NET web service? I get <

  • 0

How to I control parameter type tag in ASP.NET web service? I get < xml>string< /xml> in one web application and < data>string< /data> in other… Is there a way to control this?

[WebMethod]
public bool TestFunction(string xml)
{
    //DO SOMETHING
    return true;
}

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <TestFunction xmlns="http://tempuri.org/">
      <xml>string</xml> //<data>string</data>
    </TestFunction>
  </soap:Body>
</soap:Envelope>

edit: I forgot to rename function

  • 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-26T23:46:07+00:00Added an answer on May 26, 2026 at 11:46 pm

    Any method is exposed using the parameter names you specify. If you change your method to public bool TestFunction(string FooBar), then the string will be in a <FooBar>string</FooBar> tag in the resulting XML.

    When you are using WCF you can change this behavior using Message Contracts or applying a MessageParameter to instruct the serializer to use an alternate name:

    public bool TestFunction([MessageParameter(Name="YourName")]string xml)
    

    However, I don’t know whether this also applies to ASP.Net web services.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in an ASP.NET UserControl . When I type Control-K, Control-D to reformat all
I have a method with a ref control type parameter which I want to
I have multibinding on Image control. I bind two properties one is type of
To have less redundant XAML markup i try to get a radiobutton-type selection control
The DragCompleted event of a wp7 control has a parameter of type DragCompletedGestureEventArgs that
I'm trying to control a parameter with AE expressions and I need a triangle
I'm using a repeater control and I'm trying to pass a parameter as such:
I have a gridview control with delete asp:ImageButton for each row of the grid.
Haskell beginner here. I want to pass a type parameter with JSON, and have
This is toy-example.hs: {-# LANGUAGE ImpredicativeTypes #-} import Control.Arrow data From = From (forall

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.