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. Web Service Response

Web Service Response

Scheduled Pinned Locked Moved Web Development
csharpjavajavascriptvisual-studiohelp
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.
  • U Offline
    U Offline
    usermans
    wrote on last edited by
    #1

    I used to create web methods using the template provided with Visual Studio .NET 2003, all I needed to do is to add the [WebMethod] attribute before the function I want to expose through the web service. But recently I was asked to expose my function to a specific client who is using AJAX and JSP and my return values are required to be sent using the "Response" object! I don't know how to access this object in a web service, unlike web applications, this object is not easily accessible from within the code. In fact I have doubts about the whole approach, is it possible and if possible is it practical to send the results back using the "Response" object? The caller wants the return values to be incorporated into a string that contains JavaScript code they can evaluate and use to display the result on their AJAX enabled JSP page. Any help or ideas about the subject are appreciated. Thank you.

    G 1 Reply Last reply
    0
    • U usermans

      I used to create web methods using the template provided with Visual Studio .NET 2003, all I needed to do is to add the [WebMethod] attribute before the function I want to expose through the web service. But recently I was asked to expose my function to a specific client who is using AJAX and JSP and my return values are required to be sent using the "Response" object! I don't know how to access this object in a web service, unlike web applications, this object is not easily accessible from within the code. In fact I have doubts about the whole approach, is it possible and if possible is it practical to send the results back using the "Response" object? The caller wants the return values to be incorporated into a string that contains JavaScript code they can evaluate and use to display the result on their AJAX enabled JSP page. Any help or ideas about the subject are appreciated. Thank you.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The response from a web service is always a SOAP message. If you want the response to be something else, you have to implement it as a regular web page, then you can return whatever you like in the response.

      --- single minded; short sighted; long gone;

      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