469,625 Members | 1,911 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

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.
Expand|Select|Wrap|Line Numbers
  1.     <WebMethod()> _
  2. Public Function InsertPatientInfo(ByVal Password As String, ByVal f As XmlDocument) As Integer
  3.  
  4. Try
  5.                 Dim strTemp As String = System.Web.Hosting.HostingEnvironment.MapPath("~/Schedules/") & "FileX.XML"
  6.                 Dim ms As New MemoryStream(f.OuterXml)
  7.                 Dim fs As New FileStream(strTemp, FileMode.Create)
  8.                 ms.WriteTo(fs)
  9.                 ms.Close()
  10.                 fs.Close()
  11.                 fs.Dispose()
  12.  
  13.                 f.Save(strTemp)
  14.                 strMessage = ProcessXML(strTemp)
  15.  
  16.              ' Blah blah blah
  17.  
Any help here would be greatly appreciated...

Thanks,
Paul
Jan 28 '09 #1
0 1191

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by JD | last post: by
1 post views Thread by Joe Monnin | last post: by
4 posts views Thread by =?Utf-8?B?TWFyaw==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.