Advertisement

07.04.2008 at 07:24AM PDT, ID: 23539508
[x]
Attachment Details

Sending XML to a dot net web service

Asked by ellandrd in Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 3.x versions

Should be a simple one, but im trying to post XML in string format using AJAX from JavaScript to a dot net web service (.asmx) written in VB, im struggling to get it to work quite how i want it to, i can get a simple string to pass into the web service, and return XML with no problems, but sending XML just doesnt want to play. Does anyone have a suggestion of a better way to send an XML document to a web service using Javascript. I have attached the function im calling that does the POST to the web service, i have tried changing the content type from text/XML to

the error i get from the response is a http 500 error :

System.InvalidOperationException: PageSecurityUpdate Web Service method name is not valid. at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
######## Javascript AJAX function ##########
       function makeXMLPOSTRequest(url, xmlString) {
          http_request = false;
          http_request = GetXmlHttpObject(); 
          http_request.onreadystatechange = HTTPCallbackFunction();
          http_request.open('POST', url, true);
          http_request.setRequestHeader("Content-type", "text/XML");
        //  http_request.setRequestHeader("Content-length", parameters.length);
          http_request.setRequestHeader("Connection", "close");
          http_request.send("<?xml version='1.0' encoding='UTF-8'?>" + xmlString);
       }
[+][-]07.05.2008 at 01:41PM PDT, ID: 21938306

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 3.x versions
Sign Up Now!
Solution Provided By: raja_ind82
Participating Experts: 1
Solution Grade: C
 
 
[+][-]07.07.2008 at 02:27AM PDT, ID: 21943588

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 12:40PM PDT, ID: 21957391

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906