Click here to Skip to main content
15,889,826 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionlogin controls Pin
valli rajya lakshmi25-Dec-08 8:46
valli rajya lakshmi25-Dec-08 8:46 
AnswerRe: login controls Pin
Lars Brandt Stisen25-Dec-08 9:37
Lars Brandt Stisen25-Dec-08 9:37 
GeneralRe: login controls Pin
valli rajya lakshmi25-Dec-08 12:28
valli rajya lakshmi25-Dec-08 12:28 
GeneralRe: login controls Pin
Lars Brandt Stisen25-Dec-08 13:56
Lars Brandt Stisen25-Dec-08 13:56 
GeneralRe: login controls Pin
valli rajya lakshmi26-Dec-08 10:26
valli rajya lakshmi26-Dec-08 10:26 
QuestionWeb user Control Problem Pin
cmpemikail25-Dec-08 7:16
cmpemikail25-Dec-08 7:16 
AnswerRe: Web user Control Problem Pin
Christian Graus25-Dec-08 11:41
protectorChristian Graus25-Dec-08 11:41 
QuestionXML serialization web service - passing objects Pin
mhp13025-Dec-08 6:47
mhp13025-Dec-08 6:47 
Hi,

I just start learning to write web service using C# vs 2005 - I have a question about passing objects between client and web service.

I have a simple XML, I call it ValueTable.xml

<?xml version="1.0" encoding="utf-8"?>
<ValueTable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="TableA">
  <Table>
    <Table_rec>      
      <date>
        <cal_date>01/22/08</cal_date>
        <weekday>Y</weekday>
      </date>      
      <value>198700</value>
    </Table_rec>
    <Table_rec>
      <date>
        <cal_date>01/22/08</cal_date>
        <weekday>Y</weekday>
      </date>  
      <value>25500</value>
    </Table_rec>    
  </Table>
</ValueTable>


I ran

xsd valueTable.xml
xsd /n:TableA /c valueTable.xsd

Then I added valueTable.cs generated in my web service project and create a web method -
[WebMethod]
   public ValueTable HelloWorld2()
   {
       ValueTable t1 = new ValueTable();
       XmlSerializer si = new XmlSerializer(typeof(ValueTable));
       TextReader r = new StreamReader("f:\\ValueTable.xml");
       t1 = (ValueTable)si.Deserialize(r);
       r.Close();
       return t1;
   }


I saved the wsdl in my localhost default directory and create a client winform project.
Add the web reference by adding the wsdl and call Helloworld2

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            localhost.Service ls = new localhost.Service();
            localhost.HelloWorld2ResultTableTable_rec[][] vt = new ConsoleApplication2.localhost.HelloWorld2ResultTableTable_rec[10][];
            vt = ls.HelloWorld2();
        }
    }
}



vt populates what I expect to see - good (though I am not sure I am doing it the right way).

but say if I want to change HelloWorld2 to be

public ValueTable HelloWorld2(ValueTable Tablein)

by adding an input parameter, for simplicity reason same type of object as the return,
I struggle to get it work. How can I use the info in the wsdl(only)to serialize a ValueTable oject? Do I need to add the same .cs as i did in the server? (does not sound right). Any links or help is appreciated.
AnswerRe: XML serialization web service - passing objects Pin
mhp13025-Dec-08 9:09
mhp13025-Dec-08 9:09 
QuestionSession or Viewstate Pin
Nishant Singh25-Dec-08 2:02
Nishant Singh25-Dec-08 2:02 
AnswerRe: Session or Viewstate Pin
Abhijit Jana25-Dec-08 2:07
professionalAbhijit Jana25-Dec-08 2:07 
GeneralRe: Session or Viewstate Pin
Nishant Singh25-Dec-08 2:19
Nishant Singh25-Dec-08 2:19 
AnswerRe: Session or Viewstate Pin
Christian Graus25-Dec-08 14:50
protectorChristian Graus25-Dec-08 14:50 
AnswerRe: Session or Viewstate Pin
Aman Bhullar25-Dec-08 18:15
Aman Bhullar25-Dec-08 18:15 
QuestionForm Authentication using as.net 2.0 Pin
sbua24-Dec-08 23:37
sbua24-Dec-08 23:37 
AnswerRe: Form Authentication using as.net 2.0 Pin
Abhijit Jana24-Dec-08 23:41
professionalAbhijit Jana24-Dec-08 23:41 
Questionhow to get the value Pin
R111924-Dec-08 22:17
R111924-Dec-08 22:17 
AnswerRe: how to get the value Pin
Abhijit Jana24-Dec-08 22:33
professionalAbhijit Jana24-Dec-08 22:33 
AnswerRe: how to get the value Pin
Christian Graus24-Dec-08 23:50
protectorChristian Graus24-Dec-08 23:50 
GeneralRe: how to get the value Pin
Abhijit Jana24-Dec-08 23:57
professionalAbhijit Jana24-Dec-08 23:57 
GeneralRe: how to get the value Pin
Christian Graus25-Dec-08 0:28
protectorChristian Graus25-Dec-08 0:28 
AnswerRe: how to get the value Pin
Nishant Singh25-Dec-08 2:26
Nishant Singh25-Dec-08 2:26 
Questionhow to get the value of a variable defined in a method, in page load. Pin
R111924-Dec-08 21:43
R111924-Dec-08 21:43 
AnswerRe: how to get the value of a variable defined in a method, in page load. Pin
Nishant Singh24-Dec-08 21:45
Nishant Singh24-Dec-08 21:45 
GeneralRe: how to get the value of a variable defined in a method, in page load. Pin
Tamer Oz24-Dec-08 21:52
Tamer Oz24-Dec-08 21:52 

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.