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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:00:18+00:00 2026-05-23T17:00:18+00:00

When using ASP.NET Webservice it automatically adds the MethodNameResult and MethodaNameResponse . Is there

  • 0

When using ASP.NET Webservice it automatically adds the MethodNameResult and MethodaNameResponse.

Is there a easy way to not include them, and can we do the same with the request?

I.e., remove <tem:HelloWorld><tem:xml> from

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:HelloWorld>
         <tem:xml>

Here is the response sample

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <HelloWorldResponse xmlns="http://tempuri.org/">
         <HelloWorldResult>
         </HelloWorldResult>
      </HelloWorldResponse>
   </soap:Body>
</soap:Envelope>
  • 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-23T17:00:19+00:00Added an answer on May 23, 2026 at 5:00 pm

    um … you could manually handle the response and stream back your own xml string but why would you do this ??? this would break any client applications built against it.

    EDIT: (Call it elaboration) :

    Essentially what you need to do is create your own “soap extention” …

    public class MySOAPExtension : SoapExtension
    {
    
         Stream oldStream;
         Stream newStream;
    
         // Save the Stream representing the SOAP request or SOAP response into
         // a local memory buffer.
         public override Stream ChainStream( Stream stream )
         {
                oldStream = stream;
                newStream = new MemoryStream();
                return newStream;
         }
    
        public override void ProcessMessage(SoapMessage message)
        {
           switch (message.Stage)
            {
                case SoapMessageStage.BeforeDeserialize:
                    // before the XML deserialized into object.
                    break;
                case SoapMessageStage.AfterDeserialize:
                    break;        
                case SoapMessageStage.BeforeSerialize:
                    break;
                case SoapMessageStage.AfterSerialize:
                    break;            
                default:
                    throw new Exception("Invalid stage...");
            }       
        }
    }
    

    From here you can pick which part of the process you are interested in and if need be combine this with the information found here …

    http://msdn.microsoft.com/en-us/library/ms525585%28v=vs.90%29.aspx

    … to throw your own xml back to the client

    It’s not easy, and does require quite a bit of knowledge of the service lifecycle but at least this follows the typical asp.net model for servicing requests …

    http://msdn.microsoft.com/en-us/library/ms178473.aspx

    I would think you’re only interested in handling “SoapMessageStage.AfterSerialize” from the above switch block to manipulate the soap envelope.

    Post note:

    based on your further comment of manipulating the request soap packet, that would have to be done by the calling client as the client builds a soap packet which the server uses as an instruction, manipulating the request envelope may however affect how it’s handled or in fact break the servers handling of the soap packet.

    With all this in mind you may find that it’s more suitable to simply implement a custom httphandler instead as that would accept anything and potentially return anything, using web services imposes some basic formatting rules implied by the soap standard http handlers do not …

    http://support.microsoft.com/kb/308001

    …

    Is this more helpful?

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

Sidebar

Related Questions

I was looking for Good/Simple webservice which can be consumed using asp.net but I
I'm trying to execute a asp.net webservice using jquery. When I pass only one
I'm connecting to an ASP.NET webservice using the HTTPConnection class in Blackberry, but when
This question is regarding the ASP.NET webservice that i am creating using the DAL-BLL
I've created an ASP.NET WebService that is to be consumed using ASP.NET Ajax. The
I am using ASP .Net 3.5 and trying to invoke a WebService using javascript
We are using Excel to convert SpreatSheetML to XLS in an ASP.NET webservice. Moreover,
I'm using jquery ajax to fetch data from an asp.net webservice. I'm wondering how
I'm writing a ASP.NET webservice (.ASMX), and to test this webservice, I'm using a
I'm trying to get the hand on JQuery and JSON using an ASP.NET webservice.

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.