考虑以下肥皂响应:
(ArrayOfNotificationData){NotificationData[] = (NotificationData){Id = 1 Title = "notification 1" Message = "bla bla." Published = 2000-01-01 00:00:00}, (NotificationData){Id = 2 Title = "notification 2" Message = "bla bla." Published = 2000-01-01 00:00:00},}
如何将此响应转换为:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetNotificationsResponse xmlns="http://localhost/WS.asmx">
<GetNotificationsResult>
<NotificationData>
<Id>1</Id>
<Title>notification 1</Title>
<Message>bla bla.</Message>
<Published>2000-01-01T00:00:00</Published>
</NotificationData>
<NotificationData>
<Id>2</Id>
<Title>notification 1</Title>
<Message>bla bla.</Message>
<Published>2001-01-01T00:00:00</Published>
</NotificationData>
</GetNotificationsResult>
</GetNotificationsResponse>
</soap:Body>
我正在使用 suds 调用 Web 服务。