Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to call cross domain WebService/WCF in JQuery
    primarykey
    data
    text
    <p><strong>UPDATE1:</strong></p> <p>here is what i am getting when i copy and paste the service url in the IE browser:</p> <p><strong>http://myservername/myservices.svc?wsdl</strong></p> <pre><code>- &lt;wsdl:message name="ILodge_GetCountfor"&gt; &lt;wsdl:part name="parameters" element="tns:GetCountfor" /&gt; &lt;/wsdl:message&gt; - &lt;wsdl:message name="ILodge_GetCountfore"&gt; &lt;wsdl:part name="parameters" element="tns:GetCountfor" /&gt; &lt;/wsdl:message&gt; - &lt;wsdl:message name="ILodge_GetCountfor_Input"&gt; &lt;wsdl:part name="parameters" element="tns:GetCountfor" /&gt; &lt;/wsdl:message&gt; - &lt;wsdl:message name="ILodge_GetCountfor"&gt; &lt;wsdl:part name="parameters" element="tns:GetCountfor" /&gt; &lt;/wsdl:message&gt; </code></pre> <p><strong>http://myservername/myservices.svc?xsd=xsd0</strong></p> <pre><code>- &lt;xs:element name="GetCountfor"&gt; - &lt;xs:complexType&gt; - &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="GetCountforResult" type="xs:long" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; - &lt;xs:element name="GetCountfor"&gt; - &lt;xs:complexType&gt; - &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="Id" nillable="true" type="xs:string" /&gt; &lt;xs:element minOccurs="0" name="LevelId" type="xs:long" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; - &lt;xs:element name="GetCountfor"&gt; - &lt;xs:complexType&gt; - &lt;xs:sequence&gt; &lt;xs:element minOccurs="0" name="GetCountfor" type="xs:long" /&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; </code></pre> <p><strong>UPDATE:</strong></p> <p>i see the services is returning me as XML:</p> <pre><code> public override string ToString() { //- &lt;name&gt;CLUE&lt;/name&gt;&lt;desc&gt;CLUE list&lt;/desc&gt; StringBuilder sb = new StringBuilder("&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;"); sb.AppendLine("&lt;kml xmlns=\"someSITE"&gt;"); sb.AppendLine("&lt;FOLDER&gt;"); sb.AppendLine("&lt;name&gt;Clue&lt;/name&gt;"); sb.AppendLine("&lt;desc&gt;Clue list&lt;/desc&gt;"); sb.AppendLine("&lt;/FOLDER&gt;"); sb.AppendLine("&lt;/kml&gt;"); return sb.ToString(); } </code></pre> <p>i have tried different way to execute the below cross domain reference but no success... what i am doing wrong here? i try debugging and put break point but looks like it never execute</p> <pre><code> $(document).ready(function () { $.getJSON("http://servername/tools/myservice.svc/mymethod/?Id=1&amp;callback=?", null, function (result) { alert("in test: " + result); debugger $("#spText").html(result); }); OR var path = "http://servername/tools/myservice.svc/mymethod?Id=1&amp;callback=?"; $.ajax({ type: "GET", url: path, contentType: "application/json; charset=utf-8", dataType: "json", async: false, success: function (response) { debugger if (response != null) { //displayData(response); } } }); OR debugger $.ajax({ url: "http://servername/tools/myservice.svc/mymethod", data: { Id: "1" }, dataType: "jsonp", success: function (json, textStatus) { alert(json.d); alert(textStatus); }, error: function (XMLHttpRequest, textStatus, errorThrown) { debugger } }); OR $.ajax({ type: "GET", cache: false, url: "http://servername/tools/myservice.svc/mymethod/Id=1&amp;callback=?", scriptCharset: "utf-8", dataType: "jsonp", data: parameters, success: function (data, textStatus) { debugger }, error: function (XMLHttpRequest, textStatus, errorThrown) { debugger } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload