<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16705" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2>I'm pasting the vb.NET code.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2>--------------------------vb.NET code
BEGINS-------------------------------------</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2>Dim aWebService As New ws.lists.lists' Web service<BR>Dim
myCredentials As New System.Net.NetworkCredential<BR>myCredentials =
System.Net.CredentialCache.DefaultCredentials<BR>aWebService.Credentials =
myCredentials<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2>aXMLnode =
aWebService.GetListItems(args)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=444582614-11092008><FONT face=Arial
color=#0000ff size=2>--------------------------vb.NET code
ENDS--------------------------------------</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff size=2>The
reason I want to do it in IronPython is to see how it can be done if you do not
use the GUI that Visual Studio provides for connecting a web service provider
and consumer. I think it will work if I can add the SOAPAction header, but how
do I do that? If I write:</FONT></SPAN></DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2>request =
HttpWebRequest.Create('http://myWebServer/ims/_vti_bin/Lists.asmx')</FONT></SPAN></DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2>...there is no</FONT></SPAN></DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2>request.SOAPAction = "GetListItems"</FONT></SPAN></DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2>...Neither is there a</FONT></SPAN></DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=444582614-11092008><FONT face=Arial color=#0000ff
size=2>request.SetHeader("SOAPAction", "GetListItems")</DIV>
<DIV><BR></DIV></FONT></SPAN><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face=Arial size=2>Jim</FONT></SPAN> </P><BR><BR><BR>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> users-bounces@lists.ironpython.com
[mailto:users-bounces@lists.ironpython.com] <B>On Behalf Of </B>Miha
Valencic<BR><B>Sent:</B> Wednesday, September 10, 2008 9:44 PM<BR><B>To:</B>
Discussion of IronPython<BR><B>Subject:</B> Re: [IronPython] SOAPAction
header<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>Jim, first of all, why aren't you using .NET infrastructrue to
invoke WebService? I suspect this is the reason, because you forgot to set he
HTTP header attribute, and infrastracture (are you using generated proxy stub in
<A href="http://VB.NET">VB.NET</A>?) does this for you.<BR><BR>You should create
you proxy by deriving from System.ServiceModel.ClientBase<IYourInterface>
for WCF clients, and for regular clients, you should derive from
System.Web.Services.Protocols.SoapHttpClientProtocol.<BR><BR>wsdl.exe (or
svcutil.exe) does this automatically for you. And I would not create thos proxy
classes in IPy, but would rather create a proxy in c# (with them tools :)) and
then just use this .net object to invoke my web service from IPY like
so:<BR><BR>clr.AddReference("MyDllWhichContainsWSProxy")<BR>from MyNamespace
import MyWSProxy<BR><BR>foo = MyWSProxy<BR>foo.Url = "http://...."<BR>result =
foo.MethodX([1,2,3])<BR><BR>I hope I'm not missing
anything...<BR><BR>rgds,<BR> Miha.<BR><BR>ps: If you still want to do it
the hard way, just add the apropriate SOAPAction HTTP header to your HTTP
request. SOAPAction headers are different for each method you invoke and are
defined in WSDL file.<BR><BR>
<DIV class=gmail_quote>2008/9/10 O'Leary, Jim <SPAN dir=ltr><<A
href="mailto:Jim.O%27Leary@vancouver.ca">Jim.O'Leary@vancouver.ca</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV><BR>
<P><FONT face=Arial size=2>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.</FONT></P>
<P><FONT face=Arial size=2>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. </FONT></P>
<P><FONT face=Arial size=2>At a certain point the server sends back the
following faultstring:</FONT> </P>
<P><FONT face=Arial size=2>Unable to handle request without a valid action
parameter. Please supply a valid soap action.</FONT> </P>
<P><FONT face=Arial size=2>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.</FONT></P><BR></DIV></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>