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

Web-Services with a Collection of a custom object

Hi there,

I'm trying to consume a web-service that is supposed to return a
collection of a custom object. The web-service was not created with C# or
VS.net. It was created with IBM VisualAge Smalltalk 6. I haven't had
problems consuming other web-services but c# seems to choke with
"Collection" return types.

If you'd like to try to see an example of this problem you can add the
following web-reference to your project:

http://216.18.68.93:9999/CollectionWsInterface.wsdl
(The browser window will say that there are no functions found, but they
are there)
After adding the web-reference and renaming it "CollectionsTest", I
created a plain vanilla windows app and inserted the following into the
form load event:

CollectionsTest.CollectionWsInterface ws =
new CollectionsTest.CollectionWsInterface();

//PsmWsCollection seems to be the return object
//which is supposed to be a collection.
CollectionsTest.PsmWsCollection wsCollection;

wsCollection = ws.getCollection();

At this point, the debugger halts execution. The first lines of the stack
trace:

-------------------------------
Unhandled Exception: System.InvalidOperationException: There is an error
in XML document (16, 14). ---> System.InvalidCastException: Cannot assign
object of type WindowsApplication3.CollectionsTest.PsmWsResult to an
object of type WindowsApplication3.CollectionsTest.PsmWsResult[].
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.Rea
d1_PsmWsCollection()
-------------------------------

Which leads me to believe that the collection is being returned as an
array itself. I'm stuck at this point, how do I cast the return type to
be an array of itself??

If I try the following:

wsCollection = (CollectionsTest.PsmWsCollection[])ws.getCollection();

I get a "Cannot convert type" error when compiling.
I tried invoking the getCollection function using "Web Service Studio"
and it chokes on it as well!
If anyone has any clue on what I should do to correct this, I'd
appreciate it!

Thanks!

Jorge
Nov 16 '05 #1
3 2128
hellrazor <jo***@another-world.com> wrote in
news:Xn**********************************@64.59.14 4.76:
Hi there,

I'm trying to consume a web-service that is supposed to return a
collection of a custom object. The web-service was not created with C#
or VS.net. It was created with IBM VisualAge Smalltalk 6. I haven't
had problems consuming other web-services but c# seems to choke with
"Collection" return types.

If you'd like to try to see an example of this problem you can add the
following web-reference to your project:

http://216.18.68.93:9999/CollectionWsInterface.wsdl
(The browser window will say that there are no functions found, but
they are there)
After adding the web-reference and renaming it "CollectionsTest", I
created a plain vanilla windows app and inserted the following into
the form load event:

CollectionsTest.CollectionWsInterface ws =
new CollectionsTest.CollectionWsInterface();

//PsmWsCollection seems to be the return object
//which is supposed to be a collection.
CollectionsTest.PsmWsCollection wsCollection;

wsCollection = ws.getCollection();

At this point, the debugger halts execution. The first lines of the
stack trace:

-------------------------------
Unhandled Exception: System.InvalidOperationException: There is an
error in XML document (16, 14). ---> System.InvalidCastException:
Cannot assign object of type
WindowsApplication3.CollectionsTest.PsmWsResult to an object of type
WindowsApplication3.CollectionsTest.PsmWsResult[].
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.R
ea d1_PsmWsCollection()
-------------------------------

Which leads me to believe that the collection is being returned as an
array itself. I'm stuck at this point, how do I cast the return type
to be an array of itself??

If I try the following:

wsCollection = (CollectionsTest.PsmWsCollection[])ws.getCollection();

I get a "Cannot convert type" error when compiling.
I tried invoking the getCollection function using "Web Service Studio"
and it chokes on it as well!
If anyone has any clue on what I should do to correct this, I'd
appreciate it!

Thanks!

Jorge


Following up an extra bit of info:

The collection (or array) is supposed to contain three instances of a
custom object called PsmWsResult, which has two variable members: code,
and description.

Thanks!
Nov 16 '05 #2
hellrazor <jo***@another-world.com> wrote in
news:Xn*********************************@207.46.24 8.16:
hellrazor <jo***@another-world.com> wrote in
news:Xn**********************************@64.59.14 4.76:
Hi there,

I'm trying to consume a web-service that is supposed to return a
collection of a custom object. The web-service was not created with C#
or VS.net. It was created with IBM VisualAge Smalltalk 6. I haven't
had problems consuming other web-services but c# seems to choke with
"Collection" return types.

If you'd like to try to see an example of this problem you can add the
following web-reference to your project:

http://216.18.68.93:9999/CollectionWsInterface.wsdl
(The browser window will say that there are no functions found, but
they are there)
After adding the web-reference and renaming it "CollectionsTest", I
created a plain vanilla windows app and inserted the following into
the form load event:

CollectionsTest.CollectionWsInterface ws =
new CollectionsTest.CollectionWsInterface();

//PsmWsCollection seems to be the return object
//which is supposed to be a collection.
CollectionsTest.PsmWsCollection wsCollection;

wsCollection = ws.getCollection();

At this point, the debugger halts execution. The first lines of the
stack trace:

-------------------------------
Unhandled Exception: System.InvalidOperationException: There is an
error in XML document (16, 14). ---> System.InvalidCastException:
Cannot assign object of type
WindowsApplication3.CollectionsTest.PsmWsResult to an object of type
WindowsApplication3.CollectionsTest.PsmWsResult[].
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.R ea d1_PsmWsCollection()
-------------------------------

Which leads me to believe that the collection is being returned as an
array itself. I'm stuck at this point, how do I cast the return type
to be an array of itself??

If I try the following:

wsCollection = (CollectionsTest.PsmWsCollection[])ws.getCollection();

I get a "Cannot convert type" error when compiling.
I tried invoking the getCollection function using "Web Service Studio"
and it chokes on it as well!
If anyone has any clue on what I should do to correct this, I'd
appreciate it!

Thanks!

Jorge


Following up an extra bit of info:

The collection (or array) is supposed to contain three instances of a
custom object called PsmWsResult, which has two variable members: code,
and description.

Thanks!


.... and furthermore yet, this is where the debugger halts:

-------------------------------
[System.Web.Services.Protocols.SoapRpcMethodAttribu te
("http://www.CollectionWsInterface.com/CollectionWsInterface-
interface/getCollectio" +
"n", RequestNamespace="urn:CollectionWsInterface",
ResponseNamespace="urn:CollectionWsInterface")]
[return: System.Xml.Serialization.SoapElementAttribute("out MsgText")]
public PsmWsCollection getCollection() {

//debugger breaks at the following line!

object[] results = this.Invoke("getCollection", new object[0]);
return ((PsmWsCollection)(results[0]));
}
-------------------------------
Nov 16 '05 #3
Hello hellrazor.

I have the same problem, searching in tons of references I found that there
is a bug in the implementation of the compact framework, when a web service
exposes an array ob Objets, the pocket pc just cannot get it. I downloaded
the service pack 3 for the compact framework but it didnĀ“t work.

If you find an answer to this problem I will apreciate it, and If I finf one
i will notify you.

regards
Jorge Ayala
ja****@siga.com.mx

"hellrazor" wrote:
hellrazor <jo***@another-world.com> wrote in
news:Xn*********************************@207.46.24 8.16:
hellrazor <jo***@another-world.com> wrote in
news:Xn**********************************@64.59.14 4.76:
Hi there,

I'm trying to consume a web-service that is supposed to return a
collection of a custom object. The web-service was not created with C#
or VS.net. It was created with IBM VisualAge Smalltalk 6. I haven't
had problems consuming other web-services but c# seems to choke with
"Collection" return types.

If you'd like to try to see an example of this problem you can add the
following web-reference to your project:

http://216.18.68.93:9999/CollectionWsInterface.wsdl
(The browser window will say that there are no functions found, but
they are there)
After adding the web-reference and renaming it "CollectionsTest", I
created a plain vanilla windows app and inserted the following into
the form load event:

CollectionsTest.CollectionWsInterface ws =
new CollectionsTest.CollectionWsInterface();

//PsmWsCollection seems to be the return object
//which is supposed to be a collection.
CollectionsTest.PsmWsCollection wsCollection;

wsCollection = ws.getCollection();

At this point, the debugger halts execution. The first lines of the
stack trace:

-------------------------------
Unhandled Exception: System.InvalidOperationException: There is an
error in XML document (16, 14). ---> System.InvalidCastException:
Cannot assign object of type
WindowsApplication3.CollectionsTest.PsmWsResult to an object of type
WindowsApplication3.CollectionsTest.PsmWsResult[].
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlS erializationReader1.R ea d1_PsmWsCollection()
-------------------------------

Which leads me to believe that the collection is being returned as an
array itself. I'm stuck at this point, how do I cast the return type
to be an array of itself??

If I try the following:

wsCollection = (CollectionsTest.PsmWsCollection[])ws.getCollection();

I get a "Cannot convert type" error when compiling.
I tried invoking the getCollection function using "Web Service Studio"
and it chokes on it as well!
If anyone has any clue on what I should do to correct this, I'd
appreciate it!

Thanks!

Jorge


Following up an extra bit of info:

The collection (or array) is supposed to contain three instances of a
custom object called PsmWsResult, which has two variable members: code,
and description.

Thanks!


.... and furthermore yet, this is where the debugger halts:

-------------------------------
[System.Web.Services.Protocols.SoapRpcMethodAttribu te
("http://www.CollectionWsInterface.com/CollectionWsInterface-
interface/getCollectio" +
"n", RequestNamespace="urn:CollectionWsInterface",
ResponseNamespace="urn:CollectionWsInterface")]
[return: System.Xml.Serialization.SoapElementAttribute("out MsgText")]
public PsmWsCollection getCollection() {

//debugger breaks at the following line!

object[] results = this.Invoke("getCollection", new object[0]);
return ((PsmWsCollection)(results[0]));
}
-------------------------------

Nov 16 '05 #4

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

Similar topics

0
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
0
by: Bill Burwell | last post by:
I am converting a VB6 WebClass application to VB.Net. Used the VB upgrade tool to do the conversion - and it left me a lot of little code things to do. Did those code things and got my app to...
25
by: John Morgan | last post by:
Though I have designed and implemented a number of large reasonably well received web sites I do not consider myself a graphics designer I am now for the first time going to work with a ...
8
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
16
by: C. Woody Butler | last post by:
I have a strange problem with a website and a web service. They're both on the same server, running Windows server 2003. The website is set up as the default website for the server. I've got...
2
by: Lucas Fletcher | last post by:
Hello, I was wondering how I can reference assemblies from web.config files residing in subdirectories without having to create a new project for each web.config-containing subdirectory? I...
2
by: Jeff | last post by:
Hey asp.net 2.0 My asp.net 2.0 project has got a assembly load problem: Some of my web.config settings: <membership defaultProvider="AH_MembershipProvider" userIsOnlineTimeWindow="15">
7
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I did my MCAD sometime ago in 1.1, using the 305 manual. I've since moved up to VS 2005. I've created perhaps a half dozen Dot Net 2.0 web applications. (Click on the Create Project link within...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.