create dynamic Web Service proxy using wsdl and consume

I'm trying to create a client that can consume a web service given a path to it's wsdl file. I've been trying to use System.Web.Services.Discovery to resolve and retrieve the wsdl file. Does anyone know:

a) if this is possible?

b) how to parse the wsdl file to enumerate the available methods and what parameters are required for the methods?

c) how to create a proxy in run-time (without using wsdl.exe)? 

 

Thanks

 

0
keyurshah01
2/20/2009 8:37:51 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

5 Replies
775 Views

Similar Articles

[PageSpeed] 12
Get it on Google Play
Get it on Apple App Store

As long as your path to WSDL file is correct, discovery tool should be able to create proxy for you. See this link, it will give you a start in that direction.
 
 
If you are using the tool from VS then you would not have to worry about any parsing. It does the job.
 
What do you mean by creating proxy at run time? Do you mean u want to construct SOAP payloads yourself? It is all possible, depends on what you are trying to do.
 
<keyurshah01> wrote in message news:2955781@forums.asp.net...

I'm trying to create a client that can consume a web service given a path to it's wsdl file. I've been trying to use System.Web.Services.Discovery to resolve and retrieve the wsdl file. Does anyone know:

a) if this is possible?

b) how to parse the wsdl file to enumerate the available methods and what parameters are required for the methods?

c) how to create a proxy in run-time (without using wsdl.exe)? 

 

Thanks

 



http://forums.asp.net/p/1387900/2955781.aspx#2955781

0
bitnbytes
2/21/2009 11:42:06 AM

hi, 

do following steps -

Step 1

   Get wsdl file connected by app_Webreference.

   Example  http:/www.abc.come/test/test.wsdl
 
step 2 

   give one reference name "wsTest".
 
step 3

   Now u can access webserive like that

   wsTest.test ws = new wsTest.test();

vinay


Vinay Kumar Sinha
.net Sr. Developer
Hyderabad
0
vinayget
2/21/2009 12:12:06 PM

 thanks for the replies, but I don't think I was clear. I have a dozen or so ASMX Web Services used within our organization, and I need to provide a test client, but I can't add a WebReference to the current project for each Web Service. So, I was hoping to be able to do the following:

1) accept a url from the user (based on a choice from a list of web services)

2) create a client object to the web service at runtime for the url provided. For example, when you add a web reference to the project, it creates a proxy that you can then use in your code. I don't want to have to do this manually, I would like to do this in code.

3) from the proxy, read the list of methods available and their required input parameters

4) prompt the user for input (i.e. the input required to call a method of their choice)

5) call the web service

And so, I'm having issues with #2 and #3

Sorry I wasn't clear. Thanks for your help!!

0
keyurshah01
2/23/2009 3:28:05 PM
This is all doable. What you need to do is use WsdlImporter object from System.ServiceModel.Description. This will provide you all the classes that you need to do all the parsing. You may have to read up on WSDL spec as well to understand what all these terms means. You will still need WSDL file location. Append ?wsdl to ASMX file location to get WSDL file for that web service. Something like http://www.myws.com/foo.asmx?wsdl
 
N
 
<keyurshah01> wrote in message news:2960658@forums.asp.net...

 thanks for the replies, but I don't think I was clear. I have a dozen or so ASMX Web Services used within our organization, and I need to provide a test client, but I can't add a WebReference to the current project for each Web Service. So, I was hoping to be able to do the following:

1) accept a url from the user (based on a choice from a list of web services)

2) create a client object to the web service at runtime for the url provided. For example, when you add a web reference to the project, it creates a proxy that you can then use in your code. I don't want to have to do this manually, I would like to do this in code.

3) from the proxy, read the list of methods available and their required input parameters

4) prompt the user for input (i.e. the input required to call a method of their choice)

5) call the web service

And so, I'm having issues with #2 and #3

Sorry I wasn't clear. Thanks for your help!!



http://forums.asp.net/p/1387900/2960658.aspx#2960658

0
bitnbytes
2/24/2009 10:38:48 AM

 Thanks, I haven't got it fully working yet, but I think I'm on the right path!!

0
keyurshah01
2/24/2009 3:57:28 PM
Reply:

Similar Artilces:

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

create valid xml to send to web service based on the schema provided by web service
Problem: I have a web page which is being populated from a dataset containing multiple tables.  I now need to call a web service and send the majority of this data to be incorporate into a mainframe system.  I have been supplied with the schema that the web service will be using to validate the data.  I am new to web services and I am not sure how to take my existing dataset and transform it into an xml document that matches the schema I was provided with. There is a main schema with an element which is a custom complex type.  This custom type consists of an element whi...

New to web services, why does PB10 web service proxy wizard say there are no services?
here... http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl oops typo... still doesn't show any services though... http://webservices.amazon.com/AWSECommerceService/2005-10-05/AWSECommerceService.wsdl "Chance" <chance@booklog.com> wrote in message news:43b44cb3$1@forums-1-dub... > here... > > http://webservices.amazon.com/AWSECommerceService/205-10-05/AWSECommerceService.wsdl > Upgraded to 10.2x and now seems to be working...at least it created the proxy. "Chance" <chance@booklog.co...

Consuming a .NET web service in Delphi 2010 using a service reference
Hi, I've been asked to modify one of my existing applications (D2010 Win32) to interact with a web service written under VS2010/.Net 4. The information I have so far is :- "As communication is secured by .NET WsHttpBinding data encrypting, In order to consume it you have to add to your application a Service Reference (not a web reference) that joins the service available at the URL: http://ctm.mobilling.it/SmsComApi/Sms.svc . Assuming that the binding created in your app.confing is named "WSHttpBinding_ISms" you have to instantiate a client as shown below: {c...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

Consuming Web service from .net 3.5 web application using ajax
Hi , Before in .net 2005 ,I use to consume the  web service from client side via Ajax and java script. that's just adding web service inside the script manger services.But  it was not possible with .net 2008 version WEB APPLICATION   , Even it works well with .net 2008 web sites. Please help me to solve the issue. I have no idea what you mean. Please post the code that "does not work". NC...   I have the same problem.  I have a .NET 3.5 Web Application not Web Site.  I fully qualify the web service with the namespace i,e,  &n...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ So no ...

Web Service consuming other Web Services for caching purpose
Hello, I'm quite a newbie in Web Service programming. I'm using Visual Studio .NET 2003 on Windows XP Pro. I would like to write a Web Service on my local network that call Internet Web Service. Is there some writing rules for that or any tutorial. I want this new Web Service to cache the objects of other Web Services in order to reduce the response time. Furthermore, I wanted to test that with Babelfish Web Service on www.xmethods.net But when I make a Web Reference to the wsdl, I've a failure. VS success to access to the wsdl file but doesn't allow the web reference (&q...

How i create web services & call web services?
Give me the solution of how i create webservices & call it and what is purpose of web services ?? PlsGuree  >how i create webservicesVery much the same as creating a new web site site - it is just a different project type. > & call it andAdd a web reference to an existing project to consume the web service.>what is purpose of web services ??To send and receive data.Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. &...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

Xml file mapper using Web Service
Hi all, I am tasked with creating a web service that maps a number of files to a relational database.  I have a good idea of how I might do this but need to make sure that a list of files get mapped to the database or else they are all rolled back.  Here is the scenario of what should happen. 1. Call an initializing method with the list of files to process as a parameter 2. This method would return a unique identifier to the caller 3. Everytime the caller calls a mapping function also pass the identifier as a parameter 4. If a mapping function fails call a rollback function wit...

how to create web service that create xml files availible for web application
Hi epxerts im new in web service. I have a web link which contains nothing when you visit that web link. But when you view the source it will show the xml source in it. I want to create that xml file through web service and make these xml files availible for my application. Best RegardsShaukat Waqar...

cannot create proxy using the web services proxy wizard
I am trying to access a PB component deployed to EAS via web services. I've created the wsdl document and I am able to call this web service from a ..Net client (I've created the proxy classes using to microsoft wsdl), so the web service is working fine. The problems is that when I try to create the proxy in PB the web service proxy wizard say that it is "Unable to process document referenced in "import" element." I've tryed with both wstest.wsdl and wstestImpl.wsdl, I am not sure about what is the right document to use. I've added pbsoapclient90.p...

Web resources about - create dynamic Web Service proxy using wsdl and consume - asp.net.xml-web-services

Dynamics - Wikipedia, the free encyclopedia
Brownian dynamics , the occurrence of Langevin dynamics in the motion of particles in solution (e.g. a grain in water, as was first seen by Brown); ...

Datacenter Dynamics
Datacenterdynamics for data center information, conferences, news, videos, whitepapers and reports globally

Dynamic Chiropractic - chiropractic, news, articles, research & information for chiropractors - Find ...
Dynamic Chiropractic - chiropractic, news, articles, research & information for chiropractors - Find a Chiropractor

Walmart's Everyday Low Prices Face Amazon's Dynamic Price Push
... low prices" strategy is becoming an everyday price-adjustment strategy. In what seems to be a direct response to Amazon's sophisticated dynamic ...

The colorful, dark, dynamic art of life: 2015 BioArt winners
In an embryonic mouse torso, researches closely track how the parallel paths of blood vessels (gray) and nerve cells (red) develop. Understanding ...

General Dynamics Corporation Delivers The Future of American Shipping
American Petroleum Tankers receives delivery of first ECO class tanker from General Dynamics\' NASSCO.

Mea Culpa: Confidence Proceedings Edition: I Really Do Think Dynamic Scoring Is a Bad Idea
... *Brad DeLong noted that when he was a Treasury political appointee, one of the Treasury career staff economists lectured me him about dynamic ...

dynamic billboards to up your photo game
NYC is one of the most photographed places in the world, especially this time of year. And while Instagram has made every one of us feel like ...

Yolanda Foster explains her divorce: ‘chronic illness changed our dynamic’
... is extremely challenging, not only for the person that’s sick, but also for the caregiver,” Foster admitted. “It for sure changed the dynamic ...

CES 2016 TV tech: 4K yawns, high dynamic range dawns
... Show in Las Vegas this January, TVs with 4K resolution are old hat. So what's new hat? The next-generation TV technology known as high dynamic ...

Resources last updated: 12/17/2015 10:27:19 AM