[Mono-list] Accessing an XSP hosted c# webservice via Javascript in
mozilla?
none none
lots.of.mailing.lists at gmail.com
Sun May 21 18:38:07 EDT 2006
Ok so I've installed XSP and I'm running the test setuo that it comes
with which exposes the test service that has two methods you can use
("Echo" and "Add"). I've written a small c# app that access it and
that works fine, but I'm trying to access it using javascript in a
mozilla gecko based browser using the following code:
var proxy = null;
var wsdl_uri = "http://localhost:8080/1.1/webservice/TestService.asmx?wsdl=0";
function setup_webservice()
{
try {
var listener = {
onLoad: function (aProxy)
{
proxy = aProxy;
proxy.setListener(listener);
/* the following call fails */
proxy.Add(4, 8);
},
onError: function (aError)
{
alert("An error occured!!!!!\n")
alert(aError);
},
EchoCallback : function (result)
{
alert(result);
},
AddCallback : function (result)
{
alert(result);
}
};
var factory = new WebServiceProxyFactory();
factory.createProxyAsync(wsdl_uri, "TestServiceSoap", "", true, listener);
}
catch (ex) {
alert(ex);
}
}
setting up the webservice proxy object works fine but any call to Echo
or Add results in the following error:
Error: [Exception... "Could not convert JavaScript argument arg 0
[TestServiceSoaphttp_003a_002f_002flocalhost_003a8080_002f1_002e1_002fwebservice_002fTestService_002easmx_003fwsdl_003d0Async.Add]"
nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS
frame :: file:///home/blah/blah.js :: anonymous :: line 18" data: no]
Source File: file:///home/blah/blah.js
Line: 18
I'm not sure if this is a problem with firefox or with xsp, the
attached code is exactly the same as in the example that mozilla show
where they access the Amazon web service:
http://www.mozilla.org/projects/webservices/examples/mozilla-wsdl/index.html
Has anyone else had any luck accessing a webservice running under XSP
via javascript in mozilla? or should I post this on a mozilla mailing
list?
More information about the Mono-list
mailing list