Click here to Skip to main content
15,915,603 members
Home / Discussions / C#
   

C#

 
GeneralAnyone know any good resources (besides codeproject :P) that deal with collections for use in custom controls Pin
FocusedWolf7-Jan-05 17:46
FocusedWolf7-Jan-05 17:46 
GeneralRe: Anyone know any good resources (besides codeproject :P) that deal with collections for use in custom controls Pin
ACorbs8-Jan-05 9:33
ACorbs8-Jan-05 9:33 
GeneralRe: Anyone know any good resources (besides codeproject :P) that deal with collections for use in custom controls Pin
FocusedWolf8-Jan-05 16:48
FocusedWolf8-Jan-05 16:48 
GeneralForm and Network Listener Pin
Jackson L7-Jan-05 16:05
sussJackson L7-Jan-05 16:05 
GeneralRe: Form and Network Listener Pin
Allan Eagle8-Jan-05 14:40
Allan Eagle8-Jan-05 14:40 
GeneralRe: Form and Network Listener Pin
Member 14535649-Jan-05 15:45
Member 14535649-Jan-05 15:45 
QuestionWindows Forms question: How to lock scrollbars? Pin
kmansari7-Jan-05 14:33
kmansari7-Jan-05 14:33 
GeneralWeb-Services with a Collection of a custom object Pin
He11razor7-Jan-05 13:54
He11razor7-Jan-05 13:54 
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. The collection (or array) is supposed to
contain three instances of a custom object called PsmWsResult, which has
two variable members: code, and description.


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 here:

"CollectionsTest\Reference.cs"

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

//debugger breaks at the following line!

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

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.XmlSerializationReader1.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

GeneralRe: Web-Services with a Collection of a custom object Pin
Andy Brummer7-Jan-05 17:18
sitebuilderAndy Brummer7-Jan-05 17:18 
Generalwindows socket Pin
WaleedH7-Jan-05 11:16
WaleedH7-Jan-05 11:16 
GeneralRe: windows socket Pin
Alex Korchemniy7-Jan-05 11:26
Alex Korchemniy7-Jan-05 11:26 
GeneralRe: windows socket Pin
kmansari7-Jan-05 14:30
kmansari7-Jan-05 14:30 
Generalwindows socket Pin
ghjhgjghjghj7-Jan-05 11:16
sussghjhgjghjghj7-Jan-05 11:16 
GeneralRe: windows socket Pin
MoustafaS8-Jan-05 1:17
MoustafaS8-Jan-05 1:17 
GeneralRe: windows socket Pin
Alex Korchemniy8-Jan-05 5:37
Alex Korchemniy8-Jan-05 5:37 
GeneralPowerPoint automation question Pin
Asad Hussain7-Jan-05 11:00
Asad Hussain7-Jan-05 11:00 
GeneralRe: PowerPoint automation question Pin
Alex Korchemniy7-Jan-05 11:12
Alex Korchemniy7-Jan-05 11:12 
Questionpressure clock ?? Pin
Sakkijha7-Jan-05 10:46
Sakkijha7-Jan-05 10:46 
AnswerRe: pressure clock ?? Pin
Alex Korchemniy7-Jan-05 11:18
Alex Korchemniy7-Jan-05 11:18 
GeneralRe: pressure clock ?? Pin
Sakkijha8-Jan-05 4:47
Sakkijha8-Jan-05 4:47 
GeneralRe: pressure clock ?? Pin
Alex Korchemniy8-Jan-05 5:33
Alex Korchemniy8-Jan-05 5:33 
Generalservices and WaitForStatus Pin
sprout747-Jan-05 10:36
sprout747-Jan-05 10:36 
GeneralRe: services and WaitForStatus Pin
Heath Stewart7-Jan-05 11:56
protectorHeath Stewart7-Jan-05 11:56 
GeneralRe: services and WaitForStatus Pin
sprout748-Jan-05 8:50
sprout748-Jan-05 8:50 
GeneralRe: services and WaitForStatus Pin
Heath Stewart10-Jan-05 20:19
protectorHeath Stewart10-Jan-05 20:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.