1

I'm calling a WCF service via JavaScript. Is there a way I can add a header to my WCF service call?

1 Answer 1

2

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/

Sign up to request clarification or add additional context in comments.

1 Comment

This points me in the right direction. I think I'll use jQuery and the beforeSend parameter to add my custom header. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.