[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;
				/* the following call fails */
				proxy.Add(4, 8);

			onError: function (aError)
				alert("An error occured!!!!!\n")

			EchoCallback : function (result)

			AddCallback : function (result)

		var factory = new WebServiceProxyFactory();
		factory.createProxyAsync(wsdl_uri, "TestServiceSoap", "", true, listener);
	catch (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
 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:


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

More information about the Mono-list mailing list