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

Michał Ziemski rook at roo.k.pl
Mon May 22 02:31:33 EDT 2006


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. 
<T_System_Web_Services_Protocols_SoapDocumentMethodAttribute.htm>

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
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20060522/b4645c55/attachment-0001.html


More information about the Mono-list mailing list