473,385 Members | 1,343 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,385 software developers and data experts.

Reflecting a Web Service

Does anyone know how I can hit a generic web service and pull back all
exposed methods and properties?
Sep 20 '07 #1
5 1188
"r" <r@discussions.microsoft.comwrote in message
news:EE**********************************@microsof t.com...
Does anyone know how I can hit a generic web service and pull back all
exposed methods and properties?
Web services don't have methods and properties. They have a WSDL, which may
point to one or more other WSDL or schema files.

Also, web services don't have properties. Only methods.

--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

Sep 20 '07 #2
What I want to do is build a WinForms wizard that allows users to connect to
a web service and reflect through each of the webmethods bringing back each
webmethod parameter and it's type.

Sorry, I wan't clear about "properties", but I've seen web services which
contain public class or struct objects, I'd also like to pull methods,
properties, etc. for those objects, if possible.

Is there a way for me to use reflection to get this information? If not and
I need to parse the .WSDL, how do I get the raw XML for the WSDL
programmatically?
Sep 20 '07 #3
"r" <r@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
What I want to do is build a WinForms wizard that allows users to connect
to
a web service and reflect through each of the webmethods bringing back
each
webmethod parameter and it's type.

Sorry, I wan't clear about "properties", but I've seen web services which
contain public class or struct objects, I'd also like to pull methods,
properties, etc. for those objects, if possible.

Is there a way for me to use reflection to get this information? If not
and
I need to parse the .WSDL, how do I get the raw XML for the WSDL
programmatically?
You're going to have a lot of fun with this. ;-)

If you're talking about a .ASMX web service in .NET, it will return you its
WSDL when you send a request to http://localhost/YourService.asmx?WSDL. This
assumes that it's not configured to ignore such requests.

You should use the System.Web.Services.Description.ServiceDescription class
(see
http://msdn2.microsoft.com/en-us/lib...cription.aspx).
This has a static Read method that you can pass the above URL to, and it
will read in the WSDL. It then creates an object model of the WSDL that you
can navigate through.
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

Sep 20 '07 #4
This is exactly what I needed ( I think ;) ) I was already passing in the
the ?wsdl, but I couldn't get the raw xml, so the ServiceDescription class
looks like the missing piece.

Thanks!

"John Saunders [MVP]" wrote:
"r" <r@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
What I want to do is build a WinForms wizard that allows users to connect
to
a web service and reflect through each of the webmethods bringing back
each
webmethod parameter and it's type.

Sorry, I wan't clear about "properties", but I've seen web services which
contain public class or struct objects, I'd also like to pull methods,
properties, etc. for those objects, if possible.

Is there a way for me to use reflection to get this information? If not
and
I need to parse the .WSDL, how do I get the raw XML for the WSDL
programmatically?

You're going to have a lot of fun with this. ;-)

If you're talking about a .ASMX web service in .NET, it will return you its
WSDL when you send a request to http://localhost/YourService.asmx?WSDL. This
assumes that it's not configured to ignore such requests.

You should use the System.Web.Services.Description.ServiceDescription class
(see
http://msdn2.microsoft.com/en-us/lib...cription.aspx).
This has a static Read method that you can pass the above URL to, and it
will read in the WSDL. It then creates an object model of the WSDL that you
can navigate through.
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer

Sep 20 '07 #5
Parsing the wsdl is a lot of work. I know that VS 2005 comes with a utility
wsdl.exe which if given a url to a web service it will build code (proxy
classes, etc) to invoke the web service. If you really want to do this
project, using this as a starting point. Build an app that can query a web
service wsdl and build proxy class code, then compile the code into a class
and once compiled use reflection to iterate through methods, parameter types
etc. wsdl.exe should show you how to query a web service and build proxy
class code. The reset is easy.

"r" <r@discussions.microsoft.comwrote in message
news:38**********************************@microsof t.com...
What I want to do is build a WinForms wizard that allows users to connect
to
a web service and reflect through each of the webmethods bringing back
each
webmethod parameter and it's type.

Sorry, I wan't clear about "properties", but I've seen web services which
contain public class or struct objects, I'd also like to pull methods,
properties, etc. for those objects, if possible.

Is there a way for me to use reflection to get this information? If not
and
I need to parse the .WSDL, how do I get the raw XML for the WSDL
programmatically?

Sep 25 '07 #6

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

Similar topics

0
by: San | last post by:
Hello, I have DataSet which has a table named bills . I'm filling this bills table from another class named Class2 which also has the bills table with same schema. After copying the data from...
4
by: MattBell | last post by:
I've tried to search for an answer to this without much success, and I think it's probably a common thing to do: I have a web service I want to accept an XmlDocument as an argument which conforms...
3
by: | last post by:
Hi all, I have a question on reflection Lets say I have a custom object called Address. Now, lets say I have a string variable that holds the name of a variable in the object such as...
24
by: ManjunathRatakonda | last post by:
Hi, Am assigning the innerHTML of a div to another div, the problem is that the assigned innerHTML is not reflected when i display the second div to which i have assigned the innerHTML of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.