XMLDocument Object to web service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dthope69
    New Member
    • Jan 2009
    • 1

    XMLDocument Object to web service

    I have a client that is requiring my web service to accept XMLDocument object as input parameter. I had created it initially to accept byte string and it worked fine. However, when changing to a XMLDocument object I am getting conversion errors when testing. It is telling me client program cannot convert xmldocument to xmlelement. It works fine from and to forms app, but the web service is casting it somehow. I have searched for hours on this topic and see a lot of the same problem but no solution in vb, I have seen some in C#

    Here's the web service code: I am just trying to accept the xmldocument parameter and save it to a file, then I can load and process.
    Code:
        <WebMethod()> _
    Public Function InsertPatientInfo(ByVal Password As String, ByVal f As XmlDocument) As Integer
            
    Try
                    Dim strTemp As String = System.Web.Hosting.HostingEnvironment.MapPath("~/Schedules/") & "FileX.XML"
                    Dim ms As New MemoryStream(f.OuterXml)
                    Dim fs As New FileStream(strTemp, FileMode.Create)
                    ms.WriteTo(fs)
                    ms.Close()
                    fs.Close()
                    fs.Dispose()
    
                    f.Save(strTemp)
                    strMessage = ProcessXML(strTemp)
    
                 ' Blah blah blah
    Any help here would be greatly appreciated...

    Thanks,
    Paul
    Last edited by pbmods; Jan 29 '09, 03:17 AM. Reason: Added CODE tags.
Working...