wse 3.0

 

                PremiumServicesPayList psList = new PremiumServicesPayList();

                UsernameToken token = new UsernameToken(ServiceUser, ServiceKey, PasswordOption.SendHashed);
                // Set the token onto the proxy
                psList.SetClientCredential(token);
                // Set the ClientPolicy onto the proxy
                psList.SetPolicy("ClientPolicy");
                //
                psList.DeleteByOrderID(strOrder);

 

 修改Reference.cs里的System.Web.Services.Protocols.SoapHttpClientProtocol 为 Microsoft.Web.Services3.WebServicesClientProtocol

PremiumServicesPayList :
        [WebMethod]
        public string Test(string strName)
        {
            if (RequestSoapContext.Current != null && RequestSoapContext.Current.IdentityToken.Identity.Name == ServiceUser)
            {
                return "Hello " + strName;
            }
            else
                return "nonono";
        }

posted on 2010-09-17 10:41  myx  阅读(259)  评论(0编辑  收藏  举报