Click here to Skip to main content
15,891,951 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 3:26
Alan N4-May-09 3:26 
GeneralRe: How can I make a method abstract in a child class? Pin
Meysam Mahfouzi4-May-09 4:05
Meysam Mahfouzi4-May-09 4:05 
GeneralRe: How can I make a method abstract in a child class? Pin
Alan N4-May-09 4:41
Alan N4-May-09 4:41 
QuestionUrgent Help With Serialization needed Pin
GrgBalden3-May-09 11:46
GrgBalden3-May-09 11:46 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute3-May-09 12:39
Henry Minute3-May-09 12:39 
QuestionRe: Urgent Help With Serialization needed Pin
GrgBalden3-May-09 23:10
GrgBalden3-May-09 23:10 
AnswerRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 1:33
Henry Minute4-May-09 1:33 
GeneralRe: Urgent Help With Serialization needed Pin
GrgBalden4-May-09 3:09
GrgBalden4-May-09 3:09 
Hi Henry, thanks for your help,

I updated the project with your comments but now I'm getting a HTTP 500 error when i Invoke the web service, the full code listing is below:

order.aspx.cs

using System;
using System.IO;
using System.Xml.Serialization;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using ExampleforCodeProject;

namespace ExampleforCodeProject
{

    [WebService(Namespace = "http://MyXmlTest/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class Order : System.Web.Services.WebService
    {

        [WebMethod]
        public NewOrder SerialiseOrder()
        {
            NewOrder order1 = new NewOrder();



            order1.AccountGroup = "11";
            order1.AccountNumber = "878";
            order1.Card.CardFirstName = "George";
            order1.Card.CardLastName = "Balden";
            order1.Card.CardNumber = "872947924793274";



            Stream stream = File.Open("C:\\test\\NewSoap.xml", FileMode.Create); //Create a file
            XmlSerializer sf = new XmlSerializer(typeof(NewOrder)); //
            sf.Serialize(stream, order1); //serialise
            stream.Close();
            return order1;
        }
    }
}


and the Order class (NewOrder.cs):

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ExampleforCodeProject; 

namespace ExampleforCodeProject
{
    [Serializable]
    public class NewOrder
    {

        public NewOrder() { } //constructor
        ~NewOrder() { } //Destructor

        private string accountGroupfield;
        private string accountNumberfield;

        public string AccountGroup
        {
            get
            {
                return accountGroupfield;
            }
            set
            {
                accountGroupfield = value;
            }
        }

        public string AccountNumber
        {
            get
            {
                return accountNumberfield;
            }
            set
            {
                accountNumberfield = value;
            }
        }

        public CardDetail Card;

        [Serializable]
        public class CardDetail
        {

            private string cardFirstNamefield;
            private string cardLastNamefield;
            private string cardNumberfield;

            public string CardFirstName
            {
                get
                {
                    return cardFirstNamefield;
                }
                set
                {
                    cardFirstNamefield = value;
                }
            }

            public string CardLastName
            {
                get
                {
                    return cardLastNamefield;
                }
                set
                {
                    cardLastNamefield = value;
                }
            }

            public string CardNumber
            {
                get
                {
                    return cardNumberfield;
                }
                set
                {
                    cardNumberfield = value;
                }
            }
        }
    }
}


Thanks again for all the help!
GeneralRe: Urgent Help With Serialization needed Pin
Henry Minute4-May-09 4:10
Henry Minute4-May-09 4:10 
QuestionNeed some help fast:D [modified] Pin
DrJele3-May-09 7:32
DrJele3-May-09 7:32 
AnswerRe: Need some help fast:D Pin
Henry Minute3-May-09 8:46
Henry Minute3-May-09 8:46 
GeneralRe: Need some help fast:D Pin
Member 10339073-May-09 10:43
Member 10339073-May-09 10:43 
GeneralRe: Need some help fast:D Pin
DrJele4-May-09 10:29
DrJele4-May-09 10:29 
GeneralRe: Need some help fast:D Pin
Member 10339074-May-09 20:55
Member 10339074-May-09 20:55 
Questionerror using float for array to string Pin
onetreeup3-May-09 7:26
onetreeup3-May-09 7:26 
AnswerRe: error using float for array to string Pin
fly9043-May-09 8:06
fly9043-May-09 8:06 
QuestionAcess control system for company entrance Pin
7alool3-May-09 4:41
7alool3-May-09 4:41 
AnswerRe: Acess control system for company entrance Pin
PIEBALDconsult3-May-09 5:43
mvePIEBALDconsult3-May-09 5:43 
AnswerRe: Acess control system for company entrance Pin
Dave Kreskowiak3-May-09 6:39
mveDave Kreskowiak3-May-09 6:39 
QuestionPrinter on distributed system Pin
Snappy Wing3-May-09 4:39
Snappy Wing3-May-09 4:39 
AnswerRe: Printer on distributed system Pin
Dave Kreskowiak3-May-09 6:40
mveDave Kreskowiak3-May-09 6:40 
Question2d drawing (visualstudio2005) [modified] Pin
lor3n7o3-May-09 2:11
lor3n7o3-May-09 2:11 
AnswerRe: 2d drawing (visualstudio2005) Pin
Henry Minute3-May-09 2:21
Henry Minute3-May-09 2:21 
GeneralRe: 2d drawing (visualstudio2005) Pin
lor3n7o3-May-09 3:44
lor3n7o3-May-09 3:44 
GeneralRe: 2d drawing (visualstudio2005) Pin
Henry Minute3-May-09 4:00
Henry Minute3-May-09 4:00 

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.