Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to remove XML tag from a web service response

how to remove XML tag from a web service response

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwcfcomxml
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    spmohanraj
    wrote on last edited by
    #1

    Hi, I have a webservice in ASP.NET that has one exposed WebMethod that lets the outerworld send us some data and we return a response back after processing that data. We have a restriction though, our clients use a different develpment environment, and they do not use web services as we normally do. They will be using 'HTTP Post' to call the web method exposed by the web service in the following manner: http://mydomain.com/Webservice.asmx/ProcessData?=Parameter = Some Data And the response that they get back is as follows Response As a String Is there anyway that I can return only the response back to the client without the XML tags? My client is being really adamant about getting only the response back and we already have a running webservice that would be really hard to convert to any other format. Regards Mohan

    K 1 Reply Last reply
    0
    • S spmohanraj

      Hi, I have a webservice in ASP.NET that has one exposed WebMethod that lets the outerworld send us some data and we return a response back after processing that data. We have a restriction though, our clients use a different develpment environment, and they do not use web services as we normally do. They will be using 'HTTP Post' to call the web method exposed by the web service in the following manner: http://mydomain.com/Webservice.asmx/ProcessData?=Parameter = Some Data And the response that they get back is as follows Response As a String Is there anyway that I can return only the response back to the client without the XML tags? My client is being really adamant about getting only the response back and we already have a running webservice that would be really hard to convert to any other format. Regards Mohan

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      I have done this with an aspx page, so it might be similar with a web service. With an aspx page you make sure you just have a page with only the <@Page header infomation. No tag or anything like that. Then in the page load you do processing based off the request you get. Then you take the Response object call the clear method and then do a Response.BinaryWrite You will need to convert your string into an array of bytes to pass into the binarywrite. Anyway, I haven't tried it with a web service yet, but I am pretty sure it would work. Hope that helps. Ben

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups