gpt4 book ai didi

wcf - Coldfusion WCF API 实现

转载 作者:行者123 更新时间:2023-12-02 08:42:56 27 4
gpt4 key购买 nike

下面是调用我从 Provider 获得的 API 的示例,我在将此代码转换为 Coldfusion 时遇到问题。如有任何帮助,我们将不胜感激

    var parameters = new List<RegaloPayBillerFieldWithValue>
{
new RegaloPayBillerFieldWithValue
{
Name = "NPE",
Value = "1234567890"
}
};
var preReceipt = client.RegaloPayPreReceipt(accessId: "2FC60D63-9091-4530-BC08-AF0D5742BBF2", billerPublicId: 3, localAmount: 0, billParameters: parameters);

我面临问题的部分是上部,即

   var parameters = new List<RegaloPayBillerFieldWithValue>
{
new RegaloPayBillerFieldWithValue
{
Name = "NPE",
Value = "1234567890"
}
};

此处有两个变量,即名称和值未正确发布。测试 url 为 http://regalocashservice.cloudapp.net:8085/RegaloCashService.svc?wsdl

最佳答案

你可以写-

    <cfset wsdlurl = "http://regalocashservice.cloudapp.net:8085/RegaloCashService.svc?wsdl">
<cfset parameters = StructNew()>
<cfset RegaloPayBillerField = ArrayNew(1)>
<cfset vars = structNew()>

<cfset ArrayAppend(RegaloPayBillerField, {Name="NPE", Value="1234567890"})>
<cfset StructAppend(parameters, {RegaloPayBillerFieldWithValue = RegaloPayBillerField })>
<cfset vars["billerPublicId"] = 2>
<cfset vars["localAmount"] = 0>
<cfset vars["accessId"] = "2FC60D63-9091-4530-BC08-AF0D5742AAF2">

<cfinvoke webservice="#wsdlurl#" method="RegaloPayPreReceipt" returnVariable="res" argumentcollection="#vars#" >
<cfinvokeargument name="billParameters" value="#parameters#"/>
</cfinvoke>
<cfdump var="#res.getResponseCode()#">

关于wcf - Coldfusion WCF API 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24502119/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com