"use" a wsdl (SOAP)<p align=left><span> </p> <p align=left><font face=Arial size=2>Hello all,</font></p> <p align=left> </p> <p align=left>      I have recently beeing asked to create a client application in .net and visual c# that will be able to communicate with a server application over soap. I have bee given a WSDL file but i am struggling to see how i will use that in a client application.</p> <p align=left> </p> <p align=left>     My reading provided some basics on what the WSDL file describes and how it is used in the SOAP context, but i am trying to find a library/mechanism that will create a class which will be able to construct the XML file according to the wsdl definition. </p> <p align=left> </p> <p align=left>    I have checked that the SOAP toolkit seems to be of no use (and it is now depricated) and i was trying to see if there is any other tool in VS 2008 that will ease my way in doing that (or any good reading pointers)...</p> <p align=left> </p> <p align=left>   Thanks a lot in advance,</p> <p align=left>   Panos</p></span>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z5b627639-bf37-4a58-ad4d-e3b654119e95http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5b627639-bf37-4a58-ad4d-e3b654119e95http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5b627639-bf37-4a58-ad4d-e3b654119e95Panos_grhttp://social.msdn.microsoft.com/Profile/en-US/?user=Panos_gr"use" a wsdl (SOAP)<p align=left><span> </p> <p align=left><font face=Arial size=2>Hello all,</font></p> <p align=left> </p> <p align=left>      I have recently beeing asked to create a client application in .net and visual c# that will be able to communicate with a server application over soap. I have bee given a WSDL file but i am struggling to see how i will use that in a client application.</p> <p align=left> </p> <p align=left>     My reading provided some basics on what the WSDL file describes and how it is used in the SOAP context, but i am trying to find a library/mechanism that will create a class which will be able to construct the XML file according to the wsdl definition. </p> <p align=left> </p> <p align=left>    I have checked that the SOAP toolkit seems to be of no use (and it is now depricated) and i was trying to see if there is any other tool in VS 2008 that will ease my way in doing that (or any good reading pointers)...</p> <p align=left> </p> <p align=left>   Thanks a lot in advance,</p> <p align=left>   Panos</p></span>Thu, 29 May 2008 12:07:00 Z2008-05-29T12:07:00Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#69ae8634-6456-455c-90cd-cc4d95127ae9http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#69ae8634-6456-455c-90cd-cc4d95127ae9FalcoDavehttp://social.msdn.microsoft.com/Profile/en-US/?user=FalcoDave"use" a wsdl (SOAP)<font size=2><span style="font-family:Arial">Hi,<br><br>Microsoft provide a tool for creating C# or VB.NET classes from a WSDL document, it's included with VS2003/2005 at least so I can't think it wouldn't be there in 2008, it's called wsdl.exe <br><br>Hope this helps,<br>David<br><br>Microsoft (R) Web Services Description Language Utility<br>[Microsoft (R) .NET Framework, Version 1.1.4322.573]<br>Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.<br><br><br>wsdl.exe -<br>    Utility to generate code for xml web service clients and xml web services<br>    using ASP.NET from WSDL contract files, XSD schemas and .discomap discovery<br>    documents.  This tool can be used in conjunction with disco.exe.<br><br>wsdl.exe &lt;options&gt; &lt;url or path&gt; &lt;url or path&gt; ...<br><br>     - OPTIONS -<br><br>&lt;url or path&gt; -<br>    A url or path to a WSDL contract, an XSD schema or .discomap document.<br><br>/nologo<br>    Suppresses the banner.<br><br>/language:&lt;language&gt;<br>    The language to use for the generated proxy class.  Choose from 'CS',<br>    'VB', 'JS', 'VJS' or provide a fully-qualified name for a class<br>    implementing System.CodeDom.Compiler.CodeDomProvider.  The default is 'CS'<br>    (CSharp).  Short form is '/l:'.<br><br>/server<br>    Generate an abstract class for an xml web service implementation using<br>    ASP.NET based on the contracts. The default is to generate client proxy<br>    classes.<br><br>/namespace:&lt;namespace&gt;<br>    The namespace for the generated proxy or template.  The default namespace<br>    is the global namespace. Short form is '/n:'.<br><br>/out:&lt;fileName&gt;<br>    The filename for the generated proxy code. The default name is derived from<br>    the service name. Short form is '/o:'.<br><br>/protocol:&lt;protocol&gt;<br>    Override the default protocol to implement.  Choose from 'SOAP', 'SOAP12',<br>    'HttpGet', 'HttpPost', or custom protocol as specified in the configuration<br>    file.<br><br>/username:&lt;username&gt;<br>/password:&lt;password&gt;<br>/domain:&lt;domain&gt;<br>    The credentials to use when the connecting to a server that<br>    requires authentication. Short forms are '/u:', '/p:' and '/d:'.<br><br>/proxy:&lt;url&gt;<br>    The url of the proxy server to use for http requests.<br>    The default is to use the system proxy setting.<br><br>/proxyusername:&lt;username&gt;<br>/proxypassword:&lt;password&gt;<br>/proxydomain:&lt;domain&gt;<br>    The credentials to use when the connecting to a proxy server that<br>    requires authentication. Short forms are '/pu:', '/pp:' and '/pd:'.<br><br>/appsettingurlkey:&lt;key&gt;<br>    The configuration key to use in the code generation to read the default<br>    value for the Url property. The default is to not read from the config<br>    file. Short form is '/urlkey:'.<br><br>/appsettingbaseurl:&lt;baseurl&gt;<br>    The base url to use when calculating the url fragment. The<br>    appsettingurlkey option must also be specified. The url fragment is<br>    the result of calculating the relative url from the appsettingbaseurl<br>    to the url in the WSDL document. Short form is '/baseurl:'.<br><br>/parsableerrors<br>    Print errors in a format similar to those reported by compilers.<br></span></font>Thu, 29 May 2008 16:22:05 Z2008-05-29T16:22:05Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#7f403533-dfa6-4a79-91a9-ca70b641566fhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#7f403533-dfa6-4a79-91a9-ca70b641566fPanos_grhttp://social.msdn.microsoft.com/Profile/en-US/?user=Panos_gr"use" a wsdl (SOAP) Hello David and many thanks for your reply!<br><br>    In fact i used succesfully the wsdl.exe utility and managed to recreate and run the simple example from ms's website (<a href="http://msdn.microsoft.com/en-us/library/ms734712.aspx">http://msdn.microsoft.com/en-us/library/ms734712.aspx</a>)<br><br>    However, and although i have succesfully created the generatedProxy and the api.config files from the remote web service, i keep receiving hundreds of exceptions when i am trying to use it.<br><br>   Before posting the exceptions i wanted to make sure that my client is accessing the service correctly using our proxy server. What do i have to do to declare that programmatically in my client application?<br><br>  I have noticed that there are some setting about the proxy in the api.config file (generated from the wsdl). do i have to declare it in there and how?<br><br>   Many many thanks,<br>    PanosFri, 06 Jun 2008 13:17:20 Z2008-06-06T13:17:20Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5b809d60-1765-4025-90d0-86935b13ae4bhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5b809d60-1765-4025-90d0-86935b13ae4bSteve Mainehttp://social.msdn.microsoft.com/Profile/en-US/?user=Steve%20Maine"use" a wsdl (SOAP) There's a Proxy property on SoapHttpClientProtocol (the base clase for the generated proxy), so if you need to set up proxy authentication that's the place to do it<br>-smaine<hr size="1" align="left" width="25%">Brain.Save() -- http://hyperthink.net/blogFri, 06 Jun 2008 19:06:53 Z2008-06-06T19:06:53Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5f12a8bc-8166-4e61-a7bc-1125a9110302http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/5b627639-bf37-4a58-ad4d-e3b654119e95#5f12a8bc-8166-4e61-a7bc-1125a9110302Panos_grhttp://social.msdn.microsoft.com/Profile/en-US/?user=Panos_gr"use" a wsdl (SOAP) Hello Steve,<br><br>    Thanks a lot for your reply, indeed there is a property there to define the proxy settings.<br><br>    I have also found that the<br><br>     <div style="border-right:#7f9db9 1px solid;border-top:#7f9db9 1px solid;font-size:11px;overflow:auto;border-left:#7f9db9 1px solid;line-height:100%! important;border-bottom:#7f9db9 1px solid;font-family:Courier New;background-color:white"> <table style="border-top-width:0px;border-left-width:0px;margin:2px 0px;width:99%;border-bottom:#eee 0px solid;border-collapse:collapse;background-color:#fff;border-right-width:0px" cellspacing=0 cellpadding=0> <colgroup> <col style="padding-left:10px;font-size:11px;border-bottom:#f7f7f7 1px solid;font-family:Courier New;white-space:nowrap"> <tbody> <tr> <td><font style="font-size:11px"></font><font style="color:red">System.Net.GlobalProxySelection.Select</font><font style="font-size:11px"> = </font><font style="color:blue">new</font><font style="font-size:11px"> System.Net.WebProxy(&quot;putyourproxyURLhere&quot;,8080); </font></td></tr></tbody></table></div><br><br>    is doing the job!<br><br>    Cheers,<br>    PanosMon, 09 Jun 2008 12:04:50 Z2008-06-09T12:04:50Z