Re: [Watin-users] Does anyone know .Net & SOAP web services?
Brought to you by:
jvmenen
|
From: Ron G. <ron...@ya...> - 2016-05-02 21:19:05
|
Seems like more of a general .NET web services questions. Given this envelope: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="..." xmlns:foo="..."> <soapenv:Header> <soap:authentication> <soap:locale>en_US</soap:locale> <soap:username>...</soap:username> <soap:password>...</soap:password> </soap:authentication> </soapenv:Header> <soapenv:Body> <foo:processRequest> <foo:requestMsg><![CDATA[<?xml version="1.0"?> <root />]]></foo:requestMsg> </foo:processRequest> </soapenv:Body></soapenv:Envelope> When you import the WSDL into VS the header members (in this case locale, username, password) are often (always?) parameters on the operation you're invoking: var client = new ServiceReference1.APIPortTypeClient();client.processRequest( new authentication {username = "me", password = "secret"}, new locale { Value = "en_US"}, payload); I've found that to be true in both .NET and Java auto-generated clients. One time I couldn't get VS to properly import a WSDL so I ended up just making the envelope myself: public const string EnvelopeFormat = @" <soapenv:Envelopexmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:soap=""..."" xmlns:foo=""...""> <soapenv:Header> <soap:authentication> <soap:locale>en_US</soap:locale> <soap:username>{0}</soap:username> <soap:password>{1}</soap:password> </soap:authentication> </soapenv:Header> <soapenv:Body> <foo:processRequest> <foo:requestMsg><![CDATA[<?xml version=""1.0""?> {2} ]]></foo:requestMsg> </foo:processRequest> </soapenv:Body> </soapenv:Envelope>"; String envelope = String.Format(EnvelopeFormat, "me", "secret", payload);// TODO: use WebClient or HttpClient to POST the envelope From: Greg Hile <gh...@qu...> To: watin-users mailing list <wat...@li...> Sent: Monday, May 2, 2016 10:31 AM Subject: [Watin-users] Does anyone know .Net & SOAP web services? <!--#yiv7686359915 _filtered #yiv7686359915 {font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv7686359915 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv7686359915 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv7686359915 {font-family:Verdana;panose-1:2 11 6 4 3 5 4 4 2 4;}#yiv7686359915 #yiv7686359915 p.yiv7686359915MsoNormal, #yiv7686359915 li.yiv7686359915MsoNormal, #yiv7686359915 div.yiv7686359915MsoNormal {margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv7686359915 a:link, #yiv7686359915 span.yiv7686359915MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv7686359915 a:visited, #yiv7686359915 span.yiv7686359915MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv7686359915 span.yiv7686359915EmailStyle17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv7686359915 .yiv7686359915MsoChpDefault {font-family:"Calibri", sans-serif;} _filtered #yiv7686359915 {margin:1.0in 1.0in 1.0in 1.0in;}#yiv7686359915 div.yiv7686359915WordSection1 {}-->Hello all, I am looking for someone to share their knowledge. Specifically, with .Net and sending a soap envelope with login info in the header of the envelopeI am willing to pay for your time. Greg gh...@qu... ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Watin-users mailing list Wat...@li... https://lists.sourceforge.net/lists/listinfo/watin-users |