Click here to Skip to main content
16,020,432 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Passing custom object to web service Pin
BobsAfro10-May-07 6:29
BobsAfro10-May-07 6:29 
GeneralRe: Passing custom object to web service Pin
Dave Kreskowiak10-May-07 6:34
mveDave Kreskowiak10-May-07 6:34 
GeneralRe: Passing custom object to web service Pin
BobsAfro10-May-07 6:37
BobsAfro10-May-07 6:37 
GeneralRe: Passing custom object to web service Pin
BobsAfro10-May-07 6:39
BobsAfro10-May-07 6:39 
GeneralRe: Passing custom object to web service Pin
nlarson1110-May-07 7:57
nlarson1110-May-07 7:57 
GeneralRe: Passing custom object to web service Pin
nlarson1110-May-07 6:35
nlarson1110-May-07 6:35 
GeneralRe: Passing custom object to web service Pin
BobsAfro10-May-07 22:04
BobsAfro10-May-07 22:04 
GeneralRe: Passing custom object to web service Pin
BobsAfro10-May-07 23:11
BobsAfro10-May-07 23:11 
Well I have managed to achieve what I want to but in a pretty crude way.
I have written a function to serialize a class and one to deserialize it.
Like this -

        Public Function Object2XML(ByVal obj As Object) As String<br />
            Dim SW As New StringWriter<br />
            Dim Ser As New XmlSerializer(obj.GetType())<br />
            Try<br />
                Ser.Serialize(SW, obj)<br />
                Return SW.ToString<br />
            Catch ex As Exception<br />
                Throw ex<br />
            End Try<br />
        End Function<br />
<br />
    Public Function XML2OBject(ByVal xml As String, ByVal Type As Type) As Object<br />
        Dim Obj As New Object<br />
        Dim SR As New StringReader(xml)<br />
        Dim Serializer As New System.Xml.Serialization.XmlSerializer(Type)<br />
        Try<br />
            Return Serializer.Deserialize(SR)<br />
        Catch ex As Exception<br />
            Throw ex<br />
        End Try<br />
    End Function


But surely there is a better way to do it than this?
GeneralRe: Passing custom object to web service Pin
nlarson1111-May-07 4:09
nlarson1111-May-07 4:09 
GeneralRe: Passing custom object to web service Pin
BobsAfro11-May-07 5:02
BobsAfro11-May-07 5:02 
GeneralRe: Passing custom object to web service Pin
nlarson1111-May-07 5:27
nlarson1111-May-07 5:27 
GeneralRe: Passing custom object to web service Pin
BobsAfro11-May-07 5:33
BobsAfro11-May-07 5:33 
GeneralRe: Passing custom object to web service Pin
nlarson1111-May-07 6:12
nlarson1111-May-07 6:12 
GeneralRe: Passing custom object to web service Pin
nlarson1111-May-07 11:07
nlarson1111-May-07 11:07 
GeneralRe: Passing custom object to web service Pin
BobsAfro14-May-07 3:26
BobsAfro14-May-07 3:26 
GeneralRe: Passing custom object to web service Pin
nlarson1114-May-07 3:41
nlarson1114-May-07 3:41 
GeneralRe: Passing custom object to web service Pin
BobsAfro14-May-07 3:48
BobsAfro14-May-07 3:48 
GeneralRe: Passing custom object to web service Pin
BobsAfro14-May-07 3:53
BobsAfro14-May-07 3:53 
GeneralRe: Passing custom object to web service Pin
nlarson1114-May-07 3:54
nlarson1114-May-07 3:54 
GeneralRe: Passing custom object to web service Pin
BobsAfro14-May-07 3:59
BobsAfro14-May-07 3:59 
QuestionDatagrid dropdownlist, populated from Access database. [modified] Pin
robw188810-May-07 1:06
robw188810-May-07 1:06 
Questionexlude from column ordering a field Pin
sal219-May-07 23:53
sal219-May-07 23:53 
AnswerRe: exlude from column ordering a field Pin
nlarson1110-May-07 4:14
nlarson1110-May-07 4:14 
QuestionTray Icon Pin
nitin_ion9-May-07 22:32
nitin_ion9-May-07 22:32 
AnswerRe: Tray Icon Pin
Sonia Gupta9-May-07 23:35
Sonia Gupta9-May-07 23:35 

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.