How to make WCF call from html file?

i am new to wcf and below is what the WCF WSDL returns, my question is, how to call a WCF service from html page?

 <wsdl:definitions name="MyService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
  - <wsdl:types>
    - <xsd:schema targetNamespace="http://tempuri.org/Imports">
      <xsd:import schemaLocation="http://..../tools/MyService.svc?xsd=xsd0" namespace="http://tempuri.org/" />
      <xsd:import schemaLocation="http://..../tools/MyService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
      <xsd:import schemaLocation="http://..../tools/MyService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/MyService" />
    </xsd:schema>
  </wsdl:types>

Answers


like so:

        $.ajax({
            url: "/tools/MyService.svc/Getist",
            type: "GET",
            context: document.body,
            contentType: 'application/json; charset=utf-8',
            datatype: 'json',
            success: function (data) {
                // do something
            }
        });

I am not sure about parameters - they will go after Getist in the URL, but I don't know their names - they are stored in /tools/MyService.svc?xsd=xsd0


You would need to use a javascript library such as jQuery to make an Ajax request to the web service. I recommend searching google along the lines of "jQuery WCF AJAX" and that should give you some useful examples.


Need Your Help

Set Method Values With prepareForSegue

ios objective-c variables uistoryboardsegue pushviewcontroller

Basically, i'm using the prepareForSegue method to transition to another view within my storyboard, my view had to be embedded in a navigation controller in order to display the navigation bar so I...

Unable to raise an application error message

oracle error-handling plsql oracle11g

For debugging purposes, I need to raise an application level message based on given flag. Here is exception code

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.