Rick
Rick

Reputation: 197

Can't get WSDL from Webservice with Javascript

I am creating a website which calls a WebMethod in an .NET Webservice. To archieve this I use the JavaScript SOAPClient described here (with source code).

The method

 SOAPClient._loadWsdl(url, method, parameters, async, callback) 

tries to get the WSDL file from the webservice. But the wsdl var stays null.

I used a network sniffer to analyze the incoming and outgoing packets at the webservice pc. I saw that the request reaches the webservice and that the wsdl is being sent back to the client. But somehow it stays null in the javascript var.

the method

 SOAPClient._onLoadWsdl = function(url, method, parameters, async, callback, req)

should store the wsdl in a var.

Anyone knows what the problem might be?

Upvotes: 1

Views: 1746

Answers (1)

Henrik Opel
Henrik Opel

Reputation: 19441

Just a guess, but it might be a browser security thing. From the source link you posted:

please note that many browsers do not allow cross-domain calls for security reasons

(Of course it would be a bit strange for the browser to actually make the request and than drop the response later on but who knows...)

Edit: Looking through the comments on the linked CodeProject article, it looks like the code posted there was an initial version for which some bugs got fixed in the meantime. So you might want to try again using the latest version.

Upvotes: 3

Related Questions