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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Webservices & Reflection & Request types.

Webservices & Reflection & Request types.

Scheduled Pinned Locked Moved .NET (Core and Framework)
xmlhelpcsharphtmlasp-net
1 Posts 1 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.
  • M Offline
    M Offline
    Mr Jen Withers
    wrote on last edited by
    #1

    Hi guys, Ive got a complex problem that I could really use some help / opinions on. Iam in the process of extending the webservice class to add some additional functionality that I require. I have a requirement where I need to write ALOT of public webservices for various things in my application. Natively the webservices return xml which is great for the public side of the interface but I would also like them to have the ability to return something other then xml - say html or CSV. So I have written some XSLT that will run against the XML output of the webservice and transform it into whatever I require. The problem is I want to be able to switch the output of the webservice form xml to my xslt output by changing the request type for say "text/CustomXSLT". I would like to do this so I dont have to implement 2 methods for each webmethod just to cover my requirement. To do this I have implemented a method attribute that marks a webmethod also as an xslt method: [

    XSLTMethod ("CaseSearch_HTML_Table.xslt" , typeof (SearchCases))]

    I have taken the lead from this code project article (see link below) and implemented a very similar system where by I can intercept the method call and manually invoke the method with reflection and put out the correct response. Extending an existing ASP.NET Web Service to support JSON[^] However I have hit a road block. All the input parameters in the request.form collection are strings. To make my extension class generic I will need to either write some kind of generic type marshaller to go from string to value or do something else totally horrid. Iam so close to getting something working here which has alot of value to me but this could be a show stopper. Iam very new to reflection in .net so iam hoping there is alot i dont understand. I was trying to get the .net source so I can see how the standard webservice class handles this kind of type marshalling and see if there is anything i can reuse but the link to the source on the MS site is down :-( Thanks in Advance for any help Mike

    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