带有Windows身份验证的WCF流

时间:2016-08-22 06:02:39

标签: wcf streaming basichttpbinding

我正在使用此绑定

HTTP request streaming cannot be used in conjunction with HTTP authentication. 
Either disable request streaming or specify anonymous HTTP authentication.
Parameter name: bindingElement

我在调用时遇到此错误。

class Directory : NSObject, NSCoding {


    var data : [AnyObject]
    var tid  : String
    var vid  : String
    var name : String
    var imgThumbnail : String
    var imgMedium : String
    var imgLarge : String
    var child : String

    // MARK: Archiving Paths

    init(data:[AnyObject],tid:String,vid:String,name:String,imgThumbnail:String,imgMedium:String,imgLarge:String,child:String) {

        self.data = data ?? []
        self.tid = tid ?? ""
        self.vid = vid ?? ""
        self.name = name ?? ""
        self.imgThumbnail = imgThumbnail ?? ""
        self.imgMedium   = imgMedium ?? ""

        self.imgLarge = imgLarge ?? ""
        self.child = child ?? ""

    }
    // MARK: NSCoding

    func encodeWithCoder(aCoder: NSCoder) {
        aCoder.encodeObject(data, forKey:Constants.kData)
        aCoder.encodeObject(name, forKey:Constants.Directory.kName )
        aCoder.encodeObject(tid, forKey: Constants.Directory.tid)
        aCoder.encodeObject(vid, forKey: Constants.Directory.vid)
        aCoder.encodeObject(imgThumbnail, forKey:Constants.Directory.kImageThumbnail)
        aCoder.encodeObject(imgMedium, forKey: Constants.Directory.kImageMedium)
        aCoder.encodeObject(imgLarge, forKey: Constants.Directory.kImageLarge)
        aCoder.encodeObject(child, forKey: Constants.Directory.kChild)
    }

    required convenience init?(coder aDecoder: NSCoder) {

        let data = aDecoder.decodeObjectForKey(Constants.kData) as! [AnyObject]
        let name = aDecoder.decodeObjectForKey(Constants.Directory.kName) as! String


        let tid = aDecoder.decodeObjectForKey(Constants.Directory.tid) as! String

        let vid = aDecoder.decodeObjectForKey(Constants.Directory.vid) as! String
        let imgThumbnail = aDecoder.decodeObjectForKey(Constants.Directory.kImageThumbnail) as! String
        let imgMedium = aDecoder.decodeObjectForKey(Constants.Directory.kImageMedium) as! String
        let imgLarge = aDecoder.decodeObjectForKey(Constants.Directory.kImageLarge) as! String
        let child = aDecoder.decodeObjectForKey(Constants.Directory.kChild) as! String


        // Must call designated initializer.
        self.init(data:data,tid:tid,vid:vid,name:name,imgThumbnail:imgThumbnail,imgMedium: imgMedium,imgLarge: imgLarge, child: child)
    }
}

我正在使用Windows身份验证,需要通过此服务上传和下载大文件。我应该做些什么改变来避免这个错误?是否有其他绑定适用于流媒体和Windows模式身份验证? 请帮助。

0 个答案:

没有答案