我无法访问客户端网页中的[operationcontract]服务 [英] I can't access [operationcontract] services in client web page

查看:88
本文介绍了我无法访问客户端网页中的[operationcontract]服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的Imathservice代码


This is my Imathservice code


[ServiceContract]
public interface IMathService
{
    [OperationContract]
    void DoWork();
    [OperationContract]
    int add(int x, int y);
    [OperationContract]
    int mul(int x, int y);
}


-------------------------------------------------- -
这是我的隐式接口函数



----------------------------------------------------
This is my implimented interface functions


public class MathService : IMathService
{
    public void DoWork()\\system defined function
    {
    }

  public   int add(int x, int y)
    {
        return (x + y);
    }                                \\these two function are my own function

   public int mul(int x, int y)
    {
        return (x * y);
    }
}


-------------------------------------------------- ---
我将服务参考添加到了我的cilent项目中,并创建了所需的文件
在我的客户项目中,例如(Reference.svcmap,.svcinfo,.svcinfo,.disco,.wsdl,.xsd)
并在我的项目中完美创建了这些文件.


然后我在client.cs文件中创建对象,直到一切正常....

我只能访问系统定义的文件"DoWork",而我不能访问定义的两个函数[add(),mull()]....



谁能帮我一个忙..怎么办.....

感谢®ards
mahesh


-----------------------------------------------------
I added service reference into my cilent project and required files are created
in my client proj like(Reference.svcmap,.svcinfo,.svcinfo,.disco,.wsdl,.xsd)
and these files perfectly created in my project.


And i created object in client.cs file untill it is okay....

i am able to access only system defined files that is "DoWork" and i not able to access those two function which i defined that is [add() ,mull()]....



Can any one help me out....How it can be done.....

thanks®ards
mahesh

推荐答案

就像添加服务时那样,那时您只有一个函数DoWork,后来又添加了两个方法?

如果是这样,则尝试更新服务参考.右键单击服务参考并说更新.

这应该可以解决您的问题.尝试一下,如果这样无济于事,请让我们知道是否生成了任何异常.
如果是这样,则还要粘贴该异常.
Is it like when you add the service, that time you had only one function which is DoWork and later you added two more methods?

If so then try to update service reference. Rightclick on service reference and say update.

This should solve your problem. Try out this and if that doesnt help let us know if there is any exception generated.
If so then paste the exception aswell.


这篇关于我无法访问客户端网页中的[operationcontract]服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆