【发布时间】:2021-02-05 09:28:34
【问题描述】:
我不知道我做错了什么,但内部获取值形式变量的表达式在发送请求策略中的 set-body 策略中不起作用。同样的事情也适用于回复。 场景是我必须进行 2 次调用,我将在第一次调用中将数据作为输入传递给第二次调用。 E.G
<set-body template="liquid">
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
</soap:Header>
<soap:Body>
<tem:GetSomething>
<tem:contactId>
@{ context.Variables.GetValueOrDefault<string>("ContactId").ToString(); }
</tem:contactId>
</tem:GetSomething>
</soap:Body>
</soap:Envelope>
</set-body>
Here In ContactId 是我创建的变量,其中包含来自第一个调用输出的值。 上面的 sn-p 线出现以下错误
**'There was an error deserializing the object of type System.Guid. The value '
@{ context.Variables.GetValueOrDefault<string>("ContactId").ToString(); }
' cannot be parsed as the type 'Guid'.'. Please see InnerException for more details.**
谁能告诉我缺少什么
【问题讨论】:
标签: azure azure-api-management policy