通过Javascript的WCF服务

时间:2012-06-28 17:17:28

标签: javascript wcf web-services

是否可以通过javascript与下面描述的网络服务进行通信。或者,此Web服务是否仅限于将其连接到Visual Studio中内置的应用程序并称为服务引用?我认为这是严格意义上的.net语言,无法通过简单的js访问。

(我发布截图但由于我还是新用户,网站不会让我这么做。)

如您所见,没有支持列出的操作,每个操作都包含预期的soap请求/响应。

======页面文字=====

EBonding服务

您已创建了一项服务。

要测试此服务,您需要创建一个客户端并使用它来调用该服务。您可以使用命令行中的svcutil.exe工具执行此操作,语法如下:

svcutil.exe https:// [编辑] .com / EBonding.svc?wsdl

这将生成包含客户端类的配置文件和代码文件。将这两个文件添加到客户端应用程序,并使用生成的客户端类来调用服务。例如:

C#

class Test
{
static void Main()
{
    EBondingClient client = new EBondingClient();

    // Use the 'client' variable to call operations on the service.

    // Always close the client.
    client.Close();
}
}



Visual Basic

Class Test
Shared Sub Main()
    Dim client As EBondingClient = New EBondingClient()
    ' Use the 'client' variable to call operations on the service.

    ' Always close the client.
    client.Close()
End Sub
End Class

====关于绑定的问题#1 ===

就像一个FYI,这是一个供应商网络服务。所以我无法控制它改变它的任何功能......这是我为构建它而构建的C#app的绑定(有效);如果我们能用js代替c#....

,我今天才被问到这个问题
            <binding name="BasicHttpBinding_IEBonding" closeTimeout="00:01:00" openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
                <security mode="Transport">
                    <transport clientCredentialType="Certificate" proxyCredentialType="None" realm=""/>
                    <message clientCredentialType="UserName" algorithmSuite="Default"/>
                </security>
            </binding>

===关于使用jquery来点击此服务的问题#2 ===

这是一个很棒的链接;但是,如果此Web服务受证书保护,它是否仍然适用?

0 个答案:

没有答案
相关问题