public override WebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteTopicResponse response = new DeleteTopicResponse(); // Nothing need to do with this response here return(response); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteTopicResponse response = new DeleteTopicResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.IsStartElement) { if (context.TestExpression("DeleteTopicResult", 2)) { UnmarshallResult(context, response); continue; } if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context); } } } return(response); }
public async Task <bool> DeleteMessage(string topicArn) { //delete an SNS topic DeleteTopicRequest deleteTopicRequest = new DeleteTopicRequest(topicArn); DeleteTopicResponse deleteTopicResponse = await _sns.DeleteTopicAsync(deleteTopicRequest); Console.WriteLine("DeleteTopic RequestId: {0}", deleteTopicResponse.ResponseMetadata.RequestId); return(true); }
public async System.Threading.Tasks.Task <DeleteTopicResponse> DeleteTopic(string topicArn) { DeleteTopicResponse deleteTopicResponse = new DeleteTopicResponse(); using (AmazonSimpleNotificationServiceClient snsClient = new AmazonSimpleNotificationServiceClient(credentials, Amazon.RegionEndpoint.USEast2)) { DeleteTopicRequest deleteRequest = new DeleteTopicRequest(topicArn); deleteTopicResponse = await snsClient.DeleteTopicAsync(deleteRequest); } return(deleteTopicResponse); }
public async System.Threading.Tasks.Task RemoveTopicAsync() { AmazonSimpleNotificationServiceClient snsClient = new AmazonSimpleNotificationServiceClient(RegionEndpoint.APSoutheast1); string topicArn = ""; // Delete an Amazon SNS topic. DeleteTopicRequest deleteTopicRequest = new DeleteTopicRequest(topicArn); DeleteTopicResponse deleteTopicResponse = await snsClient.DeleteTopicAsync(deleteTopicRequest); // Print the request ID for the DeleteTopicRequest action. Console.WriteLine("DeleteTopicRequest: " + deleteTopicResponse.ResponseMetadata.RequestId); }
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) { DeleteTopicResponse response = new DeleteTopicResponse(); while (context.Read()) { if (context.IsStartElement) { if (context.TestExpression("ResponseMetadata", 2)) { response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context); } } } return(response); }
private static void UnmarshallResult(XmlUnmarshallerContext context, DeleteTopicResponse response) { int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.ReadAtDepth(originalDepth)) { if (context.IsStartElement || context.IsAttribute) { } } return; }
/// <summary> /// 删除topic /// </summary> public void DeleteTopic() { // 设置请求对象 DeleteTopicRequest request = new DeleteTopicRequest { TopicUrn = "urn:smn:cn-north-1:cffe4fc4c9a54219b60dbaf7b586e132:create_by_zhangyx_test_csharp3" }; try { // 发送请求并返回响应 DeleteTopicResponse response = smnClient.SendRequest(request); string result = response.RequestId; Console.WriteLine("{0}", result); Console.ReadLine(); } catch (Exception e) { // 处理异常 Console.WriteLine("{0}", e.Message); } }