[IronPython] SOAPAction header

O'Leary, Jim Jim.O'Leary at vancouver.ca
Wed Sep 10 18:46:45 CEST 2008

I am trying to access a web service on a SharePoint site using
IronPython. The web service can be accessed via a vb.NET app, but not
from IronPython.

Sniffing the packets from both IronPython and vb.NET transactions shows
that the SOAP envelope and all headers are exactly the same in both
transactions, except for the SOAPAction header, which is missing in the
IronPython app. 

At a certain point the server sends back the following faultstring:

Unable to handle request without a valid action parameter. Please supply
a valid soap action.

How to you add this header? Below is my code. I am able to authenticate,
but the app chokes on the request.GetResponse() line with 500 Internal
Server Error.

query = Encoding.UTF8.GetBytes('''<?xml version="1.0"

request =
request.Method = "POST"
myCredentials = System.Net.NetworkCredential
myCredentials = System.Net.CredentialCache.DefaultCredentials
request.Credentials = myCredentials

request.ContentType = "text/xml; charset=utf-8"
request.ContentLength = query.Length
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services
Client Protocol 2.0.50727.1433)"
requestStream = request.GetRequestStream()
response = request.GetResponse()



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080910/b4d1275c/attachment.html>

More information about the Ironpython-users mailing list