473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamically Consuming Web Services

mfr
Hi all,

In a project I'm working on, I need to call web services methods based on
information that is given to my client program only at run-time.
I get the wsdl url, the name of the method to call and the parameters to use.

While that would not be a problem with the old SOAP toolkit, I found no way
to call webservices in VB.NET 2005 at run time.

All the articles, whitepapers, tutorials,... start with "in solution
explorer, add a web reference...". That's not gonna work for me as I only
know which web service I'll call at run-time.

I can't believe that dynamically calling a web-service in VB.NET is harder
than with VB6 and the old SOAP toolkit (3 lines of code), thus I must be
missing something big.

Any suggestion will be more than welcome.

Thanks a lot.

mfr
Oct 3 '06 #1
2 3903
Try using XMLHTTP object

--
Regards,

Debasish Pramanik
Assetlink India.
Phone: +91 20 26119531 (226)

"mfr" <mf*@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...
Hi all,

In a project I'm working on, I need to call web services methods based on
information that is given to my client program only at run-time.
I get the wsdl url, the name of the method to call and the parameters to
use.
>
While that would not be a problem with the old SOAP toolkit, I found no
way
to call webservices in VB.NET 2005 at run time.

All the articles, whitepapers, tutorials,... start with "in solution
explorer, add a web reference...". That's not gonna work for me as I only
know which web service I'll call at run-time.

I can't believe that dynamically calling a web-service in VB.NET is harder
than with VB6 and the old SOAP toolkit (3 lines of code), thus I must be
missing something big.

Any suggestion will be more than welcome.

Thanks a lot.

mfr

Oct 3 '06 #2
In the Project explorer of your client app:
Lets assume you added a web referebce as Test .
Right mouse click on Test Click on Properties.
In the Properties pane you will notice a propery 'URL Behaviour'
Set that to Dynamic.
Open Reference.vb and modify the function according to your need:
For example:
Public Sub New()
MyBase.New
Dim urlSetting As String =
System.Configuration.ConfigurationSettings.AppSett ings("TestService")
If (Not (urlSetting) Is Nothing) Then
Me.Url = String.Concat(urlSetting, "")
Else
Me.Url = "http://Mydomain/TestService.asmx"
End If
End Sub

Hope this helps.

Cheers
Ramana

"mfr" wrote:
Hi all,

In a project I'm working on, I need to call web services methods based on
information that is given to my client program only at run-time.
I get the wsdl url, the name of the method to call and the parameters to use.

While that would not be a problem with the old SOAP toolkit, I found no way
to call webservices in VB.NET 2005 at run time.

All the articles, whitepapers, tutorials,... start with "in solution
explorer, add a web reference...". That's not gonna work for me as I only
know which web service I'll call at run-time.

I can't believe that dynamically calling a web-service in VB.NET is harder
than with VB6 and the old SOAP toolkit (3 lines of code), thus I must be
missing something big.

Any suggestion will be more than welcome.

Thanks a lot.

mfr
Oct 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: eric_mamet_test | last post by:
Has somebody got an example of consuming web services from an ASP "client" web site? I saw mentions of "Soap Toolkit" but the Microsoft download area specifies that this will not be supported...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
1
by: BestofAbhi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
0
by: Abhijit Salvi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
1
by: leslie_tighe | last post by:
Hello, I have a project setup to create a dll as a VB.NET Class library project. This dll is supposed to wrap to calls to web services so that I can utilize this in VB and other .NET...
1
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
4
by: =?Utf-8?B?Z3Jhenph?= | last post by:
Hello If someone can help me with this it would be greatly appreciated. I’m no web service expert but I don't think i'm trying to do anything too special. I think i must be missing something...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.