Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Looking for VB.NET Example of Web Method that receives XML from "Submit to URL" button

Avatar

09-09-2008

I am trying to create a web service using Visual Studio 2005 that will receive XML from the "Submit to URL" button in a form. We have set the URL to be sent to as "http://servername/Services.asmx?op=WebService" in the form. I have tried the button to send XML Data, UTF-8 encoded and the method signature parameter as XmlDocument, XmlDataDocument and String. With these settings I receive the error - "Cannot handle content type: text/xml; charset=utf-8"<br />Example:<br /> <WebMethod()> _<br />Public Sub WebService(ByVal inputdoc As XmlDocument)<br /> 'Load master XML<br /> Dim doc As XmlDocument = New XmlDocument()<br /> doc.Load("C:\RFI\Master.xml")<br /><br /> 'merge pasted XML<br /> Dim imported As XmlNode = doc.ImportNode(inputdoc.DocumentElement, True)<br /> doc.DocumentElement.AppendChild(imported)<br /><br /> ' print merged documents<br /> doc.Save("C:\RFI\FormData.xml")<br /><br /> End Sub<br /><br />I have also tried the button to send URL-Encoded Data (HTTP Post), UTF-8 encoded and the method signature parameter as XmlDocument, XmlDataDocument, and String. With these settings I receive the error after clicking the submit button in the form - "Cannot handle content type: application/soap+xml; charset=utf-8"<br /><br />I have even tried commenting out the processing of the parameter withing the method to see if that was causing the problem. No joy!<br /><br />Can anyone please provide me good example of a web method that receives data from the "Submit to URL" button? Thanks!