I'm calling a WCF service via JavaScript. Is there a way I can add a header to my WCF service call?
1 Answer
Http headers are part of the request, irrespective of javascript or .net call they can be set. JQuery and other libraries provide them. Whereas if you are trying to add soap header then the javascript request becomes a post request with body having the header as xml.
following paper explains in detail how to call SOAP based service from javascript using XMLHttpRequest. Hope this helps.
http://www.ibm.com/developerworks/webservices/library/ws-wsajax/
1 Comment
Dustin Kendall
This points me in the right direction. I think I'll use jQuery and the beforeSend parameter to add my custom header. Thanks!