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

XmlSerializer, XSD and Web Service

Hi,

1) I start with an XmlSchema...
2) I use xsd.exe MySchema.xsd /c to generate C# classes for the schema
3) I create an ASP.NET web service that exposes the root of the object
tree/xml schema
[WebMethod]
public void UploadData(MyObject obj)
{
....
}

4) I read an xml file from disk in my test app...
5) I Use XmlSerializer to serialize the xml to my generated/defined object
"MyObject"
6) Everything looks good on the client side...my object is full of data from
the xml file...
7) I call my web service....service.UploadData(obj);
8) On the Web Service side my obj is NULL...

Something bad is happening on the server side here...but what??

Help is needed!

/Oscar
Apr 11 '06 #1
2 2312
On Tue, 11 Apr 2006 14:14:20 +0200, "Oscar Thornell"
<no****@internet.com> wrote:
Hi,

1) I start with an XmlSchema...
2) I use xsd.exe MySchema.xsd /c to generate C# classes for the schema
3) I create an ASP.NET web service that exposes the root of the object
tree/xml schema
[WebMethod]
public void UploadData(MyObject obj)
{
....
}

4) I read an xml file from disk in my test app...
5) I Use XmlSerializer to serialize the xml to my generated/defined object
"MyObject"
6) Everything looks good on the client side...my object is full of data from
the xml file...
7) I call my web service....service.UploadData(obj);
8) On the Web Service side my obj is NULL...

Something bad is happening on the server side here...but what??

Help is needed!

/Oscar


Is your object [Serializable]?

And besides that, I never tried to push my own objects to a
WebService, because I thought that couldn't be done (could be wrong
though)

Leon.
Apr 11 '06 #2
Well it´s solved now...sort of...when the xsd.exe generates the classes the
tool tags them with alot of attributes...
I removed all of them except the xmlserialization ones...and now it
works....except that the wsdl files is messed up...had to do that manually
as well...

/Oscar
"Leon Friesema" <le***********@frostbits.nl> wrote in message
news:in********************************@4ax.com...
On Tue, 11 Apr 2006 14:14:20 +0200, "Oscar Thornell"
<no****@internet.com> wrote:
Hi,

1) I start with an XmlSchema...
2) I use xsd.exe MySchema.xsd /c to generate C# classes for the schema
3) I create an ASP.NET web service that exposes the root of the object
tree/xml schema
[WebMethod]
public void UploadData(MyObject obj)
{
....
}

4) I read an xml file from disk in my test app...
5) I Use XmlSerializer to serialize the xml to my generated/defined object
"MyObject"
6) Everything looks good on the client side...my object is full of data
from
the xml file...
7) I call my web service....service.UploadData(obj);
8) On the Web Service side my obj is NULL...

Something bad is happening on the server side here...but what??

Help is needed!

/Oscar


Is your object [Serializable]?

And besides that, I never tried to push my own objects to a
WebService, because I thought that couldn't be done (could be wrong
though)

Leon.

Apr 11 '06 #3

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

Similar topics

2
by: Chris Aitchison | last post by:
Hello, I am attempting to have a class that I have written serialize so that it can be both passed as a parameter or return value for a webservice, and also be serialized to disk using the...
4
by: Andy Neilson | last post by:
I've run across a strange behaviour with XmlSerializer that I'm unable to explain. I came across this while trying to use XmlSerializer to deserialize from a the details of a SoapException. This...
2
by: Craig Edmunds | last post by:
I'm having a basic problem with the XmlSerializer & i'm at my wits end trying to sort it out i have a basic clas <Serializable()> Class Tes Public Name as Strin End Clas when this...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
1
by: rmgalante | last post by:
I have a Windows Service that reads and writes an XML file to disk periodically. I use the XmlSerializer to serialize and deserialize the XML file on disk. I am writing the file using an...
1
by: Yewen Tang | last post by:
I have a schema file datamodel.xsd, element "properties" is declared as a type of "baseProperty". The schema file also defines "derivedProperty" is a derived type of "baseProperty". <?xml...
0
by: PAF | last post by:
Hi, I need to send data to service via XML. This service gave me a schema that you could find in http://www.forum-datenaustausch.ch/fr/pharmacyinvoicerequest_400.xsd . I generated objects...
0
by: neoret | last post by:
Hello. I have developed an application (an office com addin).The application works fine with no error messages on my devoping machine (that machine is not connected to any domains). I have...
10
by: Henrik Dahl | last post by:
Hello! I have an xml schema which has a date typed attribute. I have used xsd.exe to create a class library for XmlSerializer. The result of XmlSerializer.Serialize(...) should be passed as the...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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...
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.