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

Serialize ArrayList from C# Webservice to native ATL SOAP Client

Hi,

in my webservice I have a Webmethod wich returns a list of Objects to my C++
Application.

C# code:

public class Contact
{
public string FirstName;
public string LastName;
}

[XmlRoot("Result")]
public class ContactList
{
public ContactList()
{
m_listOfContacts = new ArrayList();
}

[XmlArray("ContactList"), XmlArrayItem("Contact", typeof(Contact))]
public ArrayList m_listOfContacts;
}

// Service.asmx.cs
[WebMethod]
[XmlInclude(typeof(ContactList))]
public ContactList GetContactList()
{
ContactList cl = new ContactList();

// Fill in some contacts....

return cl;
}

The code works fine, and there is no problem with the generated Proxy class
within my C++
Project.
But the struct for the ContactList generated from SPROXY.exe is not very
readable.

C++ code:
struct ContactList
{
Contact *ContactList144;
int __ContactList144_nSizeIs;
};

Is there any Attribute for the ArrayList, that I can define, that SPROXY.exe
generate more
readable names for the struct variables?

Thank you
Frank

Nov 23 '05 #1
3 8006
Hi,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Nov 23 '05 #2
Hi,

thank you for your help.

The problem is not so important, but it would be easier when there is any
way to
tell sproxy.exe howto generate variable names.
I will refactor my code with search and replace when I update
my web reference. That sounds like the easiest solution at the moment.

Kind regards
Frank

""Peter Huang" [MSFT]" wrote:
Hi,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights

Nov 23 '05 #3
Hello Frank,

It seems to be a flaw of SPROXY.EXE. It just use code like:

Contact *ContactList144;

to construct an array and ensure the name is exclusive. We can not control
this from web service. All are done by sproxy.exe internally. Your solution
should be a proper one for this issue.

Luke
Nov 23 '05 #4

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

Similar topics

14
by: vince | last post by:
Can I add (append) to an xml file that already contains a serialized object, and be able to deserialize to either or both objects from the same file...??? How is this done...?? thanks, vince
0
by: Det | last post by:
Hi there I am somewhat stuck with calling a WebService from out of a VB App. My Goal: - Get a WebService invoked under MS - Access 2002, not using the MS-SOAP-Toolkit but the .net - Framework ...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
6
by: Vinit | last post by:
Hi I am passing an arraylist to a c#/.net webmethod from a perl client using soap:lite. The trace shows the elements in the xml request. The arraylist input in the webmethod however does not...
0
by: Brad | last post by:
I'm trying to serialize an arraylist of objects to send as a reply to a SOAP request. I think my prob has something to do with the XMLInclude, but i can't figure out the problem. In the code...
6
by: Paez | last post by:
Hello there. My teacher asked me to do a job and I don't know how.. This is the scenario: I must create a client/server application. The server application is a c# web server and the client...
5
by: VictorG | last post by:
Hello, I am trying to secure a webservice using WSE 3.0 and the turnkey usernameForCertificateSecurity profile. I am passing a valid username token, and on the server I have overridden the...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.