PC Review


Reply
Thread Tools Rate Thread

[newbie] webservice questions

 
 
=?Utf-8?B?UGV0ZXIgU2NobWl0eg==?=
Guest
Posts: n/a
 
      30th Apr 2005
Hi,

I'm new to .net webservices (esp. with .net framework 2.0) and I have these
questions - perhaps one of the gurus in here could give me some hints...

- I just created a WebMethod() that shall return a value of type ArrayList.
But when I try to call the webmethod in my client - the return value
declaration has changed to "Object()". How can I return a value of type
ArrayList in a webmethod?

- How can I get the client (and servers) IP addresses or ports?

- When I use an SSL certificate on the server to encrypt the connection - do
I need to change the code on the clients side?

Thanks a lot for any help
Peter
 
Reply With Quote
 
 
 
 
Joshua Flanagan
Guest
Posts: n/a
 
      1st May 2005
> - I just created a WebMethod() that shall return a value of type ArrayList.
> But when I try to call the webmethod in my client - the return value
> declaration has changed to "Object()". How can I return a value of type
> ArrayList in a webmethod?


As far as I know, you can't. More importantly, you probably don't want
to. WebServices are inteded to be interoperable across multiple
languages and platforms. Other languages and platforms do not
necessarily have a definition for an ArrayList. Your web service should
just return an array of items. The client program is free to use
whatever mechanisms are available in their platform to deal with the
array (a .NET client could load the array into an ArrayList if it wants
to use the data as an ArrayList locally).
If you don't care about interoperability, and know you will only have
..NET clients, .NET Remoting might be a more appropriate technology,
instead of web services. Using the HTTP channel and IIS as a host, you
can use remoting across the internet.

>
> - How can I get the client (and servers) IP addresses or ports?


Derive your webservice class from System.Web.Services.WebService. Check
out the documentation for this class:
http://msdn.microsoft.com/library/de...ClassTopic.asp

You should find the information you are looking for (look at the Context
property, which has a Server and Request property).


>
> - When I use an SSL certificate on the server to encrypt the connection - do
> I need to change the code on the clients side?
>


Not necessarily the code, if the server URL is stored in a configuration
file. Make sure the URL includes https://
I do not think there are any additional changes required, but I am not
completely confident. Try it out.


Joshua Flanagan
http://flimflan.com/blog
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2003 Webservice Toolkit 2.01 and ASP.NET 2.0 Webservice - Problem Neil Young Microsoft Dot NET Framework 0 6th Mar 2006 10:47 AM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista Microsoft ASP .NET 1 26th Jan 2006 01:05 PM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista Microsoft ASP .NET 0 26th Jan 2006 09:13 AM
Problem! webservice.htc calling nonsecure webservice from a secured ssl https webpage batista Microsoft Dot NET 0 26th Jan 2006 09:12 AM
Excel 2003: Grabbing a dataset from a webservice and then sending to a webservice? gjn Microsoft Excel Programming 1 7th Oct 2005 04:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 PM.