@@ -285,6 +285,64 @@ structure PayloadWithXmlName {
285
285
name : String
286
286
}
287
287
288
+ /// The following example serializes a payload that uses an XML name
289
+ /// on the member, changing the wrapper name.
290
+
291
+ @idempotent
292
+ @http (uri : " /HttpPayloadWithMemberXmlName" , method : " PUT" )
293
+ operation HttpPayloadWithMemberXmlName {
294
+ input : HttpPayloadWithMemberXmlNameInputOutput ,
295
+ output : HttpPayloadWithMemberXmlNameInputOutput
296
+ }
297
+
298
+ apply HttpPayloadWithMemberXmlName @httpRequestTests ([
299
+ {
300
+ id : " HttpPayloadWithMemberXmlName" ,
301
+ documentation : " Serializes a structure in the payload using a wrapper name based on member xmlName" ,
302
+ protocol : restXml ,
303
+ method : " PUT" ,
304
+ uri : " /HttpPayloadWithMemberXmlName" ,
305
+ body : " <Hola><name>Phreddy</name></Hola>" ,
306
+ bodyMediaType : " application/xml" ,
307
+ headers : {
308
+ "Content-Type" : " application/xml"
309
+ },
310
+ requireHeaders : [
311
+ " Content-Length"
312
+ ],
313
+ params : {
314
+ nested : {
315
+ name : " Phreddy"
316
+ }
317
+ }
318
+ }
319
+ ])
320
+
321
+ apply HttpPayloadWithMemberXmlName @httpResponseTests ([
322
+ {
323
+ id : " HttpPayloadWithMemberXmlName" ,
324
+ documentation : " Serializes a structure in the payload using a wrapper name based on member xmlName" ,
325
+ protocol : restXml ,
326
+ code : 200 ,
327
+ body : " <Hola><name>Phreddy</name></Hola>" ,
328
+ bodyMediaType : " application/xml" ,
329
+ headers : {
330
+ "Content-Type" : " application/xml"
331
+ },
332
+ params : {
333
+ nested : {
334
+ name : " Phreddy"
335
+ }
336
+ }
337
+ }
338
+ ])
339
+
340
+ structure HttpPayloadWithMemberXmlNameInputOutput {
341
+ @httpPayload
342
+ @xmlName (" Hola" )
343
+ nested : PayloadWithXmlName ,
344
+ }
345
+
288
346
/// The following example serializes a payload that uses an XML namespace.
289
347
@idempotent
290
348
@http (uri : " /HttpPayloadWithXmlNamespace" , method : " PUT" )
0 commit comments