{"action":"closed","issue":{"url":"https://api.github.com/repos/priore/SOAPEngine/issues/43","labels_url":"https://api.github.com/repos/priore/SOAPEngine/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/priore/SOAPEngine/issues/43/comments","events_url":"https://api.github.com/repos/priore/SOAPEngine/issues/43/events","html_url":"https://github.com/priore/SOAPEngine/issues/43","id":76053381,"number":43,"title":"SOAPEngine operations in NSOperationQueue?","user":{"login":"jaunesarmiento","id":1166928,"avatar_url":"https://avatars.githubusercontent.com/u/1166928?v=3","gravatar_id":"","url":"https://api.github.com/users/jaunesarmiento","html_url":"https://github.com/jaunesarmiento","followers_url":"https://api.github.com/users/jaunesarmiento/followers","following_url":"https://api.github.com/users/jaunesarmiento/following{/other_user}","gists_url":"https://api.github.com/users/jaunesarmiento/gists{/gist_id}","starred_url":"https://api.github.com/users/jaunesarmiento/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaunesarmiento/subscriptions","organizations_url":"https://api.github.com/users/jaunesarmiento/orgs","repos_url":"https://api.github.com/users/jaunesarmiento/repos","events_url":"https://api.github.com/users/jaunesarmiento/events{/privacy}","received_events_url":"https://api.github.com/users/jaunesarmiento/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-13T16:53:17Z","updated_at":"2015-05-13T17:36:19Z","closed_at":"2015-05-13T17:36:19Z","body":"Hi again,\r\n\r\nI'm trying to make a multiple requests to a single web service endpoint. I'm doing this by queuing up these requests in a `NSOperationQueue`. The problem is that when I get to the `completWithDictionary` handler of `requestWSDL` method,  I get the same result from the last operation in the queue.\r\n\r\nTo better explain my problem, here's an example.\r\n\r\n```swift\r\n// A dummy webservice\r\nlet url = \"https://some.url.com/webservices/WebService.asmx?WSDL\"\r\n\r\nlet queue = NSOperationQueue()\r\nlet restaurantIds = [100, 101]\r\n\r\nfor id in restaurantIds {\r\n\r\n  let operation = NSBlockOperation()\r\n\r\n  operation.addExecutionBlock({ () -> Void in\r\n    if !operation.cancelled {\r\n      let soap = SOAPEngine.sharedInstance()\r\n      soap.setValue(id, forKey: \"RestaurantID\") // The value of `id' here is correct; 100, and then 101\r\n      soap.requestWSDL(url,\r\n        operation: \"SomeOperation\", // A dummy operation\r\n        completeWithDictionary: { (statusCode: Int, response: [NSObject: AnyObject]!) -> Void in\r\n          // When I try to access `id' here, it's always 101 when it should be 100 \r\n          // then 101 on the second.\r\n        }\r\n      )\r\n    }\r\n  })\r\n\r\n  queue.addOperation(operation) // Starts the operation\r\n\r\n}\r\n```\r\n\r\nI think this has something to do with the way you handle completion blocks inside SOAPEngine, but I could be wrong.\r\n\r\nIt seems that the completion block for the first operation isn't called; instead, it fires the completion block for the second operation for both."}}