views:

133

answers:

1

I get an empty response back from this local WebService call via jquery / ajax.

I have verified the URL and XML input string by invoking the call in a browser. I DO get XML code back as expected.

What am I missing? Could it have something to do with the return type "XmlDocument"? I have tried changing out text/xml to text. No affect. Tried a GET instead of POST.


Webservice (running locally)...

_ Public Function GetXML(ByVal strXML As String) As XmlDocument... Dim retXML As XmlDocument = New XmlDocument()

...CODE....

Return retXML


Calling Function:

#

GetStat() {

var Url = 'http://localhost/myService.asmx?op=GetXML';

var msg = ' 55 POPE myUser
myPwd


';

$.ajax({
    url: Url,
    type: "POST",
    dataType: "text/xml",
    data: msg,
    complete: processResult,
    contentType: "text/xml"
});

return false;

}

function processResult(xmlData, status) { var jData = $(xmlData); }

#

Thanks!

A: 

Have you checked to see that the XML is well formed?

Other than that i'm pretty sure contentType should be "xml".

Kristoffer S Hansen
Hansen, you are partially correct. I changed the dataType: "jsonp" and at least am seeing data come back. However, now I get "unterminated regular expression leteral".
Kevin