C#中的webservice,wse 2.0

时间:2010-12-15 11:48:54

标签: c# import webservice-client

我有问题。

我将其导入我的程序:

using Microsoft.Web.Services2;
using Microsoft.Web.Services2.Addressing;
using Microsoft.Web.Services2.Messaging;

我还将Microsoft.Web.Services2.dll添加到我的项目中,但是当我尝试编译程序时仍然出现错误...有什么问题?

我收到这些错误:

错误4命名空间“Microsoft”中不存在类型或命名空间名称“Web”(您是否缺少程序集引用?) 错误6找不到类型或命名空间名称'SoapServiceAttribute'(您是否缺少using指令或程序集引用?)

更多代码:

[SoapService("http://www.example.org/test/")]
public class Payment : SoapClient 
{
    public Payment() : base( new Uri("http://localhost:8080/TestServer/services/testSOAP") )
    {
    }

    [SoapMethod("http://www.example.org/test/paymant")]
    public paymantResponse paymant( paymant request )
    {
        return (paymantResponse)base.SendRequestResponse("paymant", request).GetBodyObject( typeof(paymantResponse), SoapServiceAttribute.TargetNamespace);
    }

    public IAsyncResult Beginpaymant( paymant request, System.AsyncCallback callback, object asyncState)
    {
        return base.BeginSendRequestResponse("paymant", request, callback, asyncState);
    }

    public paymantResponse Endpaymant( System.IAsyncResult asyncResult )
    {
        return (paymantResponse)base.EndSendRequestResponse(asyncResult).GetBodyObject( typeof(paymantResponse), SoapServiceAttribute.TargetNamespace);
    }

所有与SoapService,SoapClient,SoapService属性相关的东西......都不能获得命名空间或者我应该说引用...     }

0 个答案:

没有答案