Skip to main content

Posts

Showing posts from January, 2012

Javascript SOAP Client

Sometimes it is nice to get data using a SOAP call. However with using Javascript there are some disadvantages and hurdles that you may need to over come. As with any fun little project you will need some materials before we get started.Favorite Text EditorBrowserEndpoint for the SOAP call - should be a urlSOAP request stringIf you have all these things ready to go, the next thing we need to make sure of is that the proper headers are set on the server side. If this is not your server that your are trying to hit then you will need to ask the administrator of the server if they can fix up the proper access.The Headers we need areAccess-Control-Allow-Origin: * Access-Control-Allow-Methods: POST Access-Control-Allow-Headers: SOAPAction, Content-Type If you happen to have a PHP SOAP server you can add these lines to the top of your code. Please remember that the header functions will need to load before you start printing other text to the page.header("Access-Control-Allow-Origin: *&…