[Mono-list] Accessing an XSP hosted c# webservice via Javascript in mozilla?

none none lots.of.mailing.lists at gmail.com
Mon May 22 13:36:31 EDT 2006


the test webservice seemed to allready be running as a "Document"
service, changing it to RPC using [SoapRpcService] made the WSDL file
resemble much more closely the one in the mozilla examples, however it
still give the same error... could it be to do with me running the web
service on the localhost (the html containing the js is also being
accessed locally via a file:// link), do i need to set the namespace
for it to work properly?
([WebService(Namespace="http://www.example.com")])

On 22/05/06, Michał Ziemski <rook at roo.k.pl> wrote:
>
>  Hi!
>
>  I've tried that some time ago. The problem was thas Mozilla uses "Document"
> SOAP format.
>  .NET however defaults to "RPC" SOAP.
>
>  Try setting [SoapDocumentService] attribute on your WebService class.
>
>  Michal Ziemski
>
>  Dnia 2006-05-22 00:38, Użytkownik none none napisał:
>
> 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?
>
>
>  ________________________________
>  _______________________________________________ Mono-list
> maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>


More information about the Mono-list mailing list