Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Consuming a WebService in ClassLibrary or Winform
Message
De
26/03/2008 09:27:53
 
 
À
25/03/2008 18:36:57
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01305448
Message ID:
01305637
Vues:
7
Yes Bonnie, it does look strange. In VS2005 there was an option to add a Web Reference but now in VS2008 we add a Service Reference in VB.Net. I think my confusion stems from the fact that I am using a third party WebService which is poorly documented outside of the WSDL.

Thanks

]Glenn

>This stuff looks rather strange Glenn. How did you add the reference? It should have been simply "Add Web Reference" to your project(unless the VB IDE differs significantly from the C# IDE).
>
>In addition to the WSDL that gets generated, there should also be a reference.vb file which is basically the class that you instantiate to use the WS. The class will have the namespace containing the name you used when you added it. So, for example, if I add a web reference in my MainControl project and I call it PersonnelWS. The reference.cs (.vb in your case) that gets generated will have a namespace of MyCompany.MyApp.WinUI.MainControl.PersonnelWS, and the partial class that gets generated will be the same class name as the web service class, Personnel in my case.
>
>In C#, all I would do to instantiate this WS is this:
>
>
>// Declaration
>PersonnelWS.Personnel oWS;
>
>// Instantiation ... usually done in the constructor
>this.oWS = new PersonnelWS.Personnel();  // you would obviously use me.oWS
>
>
>Actually, we also use a Factory class for instantiating our web services, but the concept is the similar.
>
>Then you just call the methods of the class, like any other methods on classes. Intellisense will show you the methods available.
>
>Does this help?
>
>~~Bonnie
>
>
>
>
>
>>I need to access and execute methods on a web service from a VB.Net class in VS2008. So far I have added a Service Reference to the Project for the WebService (WSDL Reference) and it properly describes the Services and Operations. My problem is now I have no idea as to how to Use it. For instance this WS has a service called ContentCafeHTTPGet with three available operations
  1. Single
  2. XMLPost
  3. XMLString

How would I instanciate this service so that I could execute the Single operation?
>>
>>Thanks
>>
>>Glenn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform