Link to code in VB.NET

I am not entirely familiar with VB.NET or ASP. I need to create a simple page that makes a call to a remote web service. I used the wsdl utility that comes with the DotNet SDK to create a service proxy and write it to a VB file. Unfortunately, I have no idea how to reference this code in my ASPX file or in the VB file code so that I can instantiate the proxy.

Edit: I would have to qualify this by noting that I am not using visual studio. I just encoded the .aspx with a .vb behind it and dropped it to the IIS location. Is there a way to do what you suggest outside of VS?

0


source to share


2 answers


You need to add this code to your project to be usable.

Right-click the App_Code folder and select Add Existing Item. This will summon an explorer. Use it to select the generated file and it will add it to your project.



You should now be able to link to this code from your page or code by file

If your project does not have an App_Code folder, right click on the project in the solution explorer and select "Add new ASP.Net folder" -> App_Code

+1


source


Or instead of the wsdl utility:

In the solution explorer window, r-click on the project and select "add web link". In the dialog box that appears, enter the URL of the web service. In the web link name field (at the bottom right corner of this dialog), add whatever you want to the local alias for the service being called.

So, if you entered the url:

http://otherserver.com/otherservice.asmx



And, web link name: hug

To use it, your code would look like this:

dim x as new xyz
var = x.methodname()

      

0


source







All Articles