0

MethodCRM api在.Net中有这个例子

Dim arrUpdateFieldsArray(1) As String
Dim arrUpdateValueArray(1) As String

arrUpdateFieldsArray(0) = Me.txtUpdateField1.Text
arrUpdateValueArray(0) = Me.txtUpdateValue1.Text
arrUpdateFieldsArray(1) = Me.txtUpdateField12Text
arrUpdateValueArray(1) = Me.txtUpdateValue2.Text

'Call the MethodAPI to update the record
sResult = wbsMethodAPI.MethodAPIUpdateV2(sCompanyAccount, sUserName, sPassword, "", _sUpdateTable, arrUpdateFrieldsArray, arrUpdateValueArray, intRecordID)
wbsMethodAPI = Nothing

我试图建立这个等价物但没有成功,这就是我尝试过的

<CFSCRIPT>
    s = "salesRep,CustomerType";
    array1 = s.split(",");
    s = "#Signature_RepName#,#Payment_CompanyType#";
    array2 = s.split(",");

    string = CreateObject("java", "java.lang.String");
    array = CreateObject("java", "java.lang.reflect.Array");
    cookies = array.newInstance(string.getClass(), 3);
    array.set(cookies, 0, "salesRep");
    array.set(cookies, 1, "CustomerType");

    string2 = CreateObject("java", "java.lang.String");
    array2 = CreateObject("java", "java.lang.reflect.Array");
    cookies2 = array2.newInstance(string.getClass(), 3);
    array2.set(cookies2, 0, "#Signature_RepName#");
    array2.set(cookies2, 1, "#Payment_CompanyType#");
</CFSCRIPT>

<cfhttp url="https://www.methodintegration.com/MethodAPI/service.asmx/MethodAPIUpdateV2" method="GET"> 
    <cfhttpparam type="URL" name="strCompanyAccount" value="xxxx"/>
    <cfhttpparam type="URL" name="strLogin" value="xxxx"/>
    <cfhttpparam type="URL" name="strPassword" value="xxxx"/>
    <cfhttpparam type="URL" name="strSessionID" value=""/>
    <cfhttpparam type="URL" name="strTable" value="Customer"/>
    <cfhttpparam type="URL" name="arrUpdateFieldsArray" value=#cookies#/>
    <cfhttpparam type="URL" name="arrUpdateValueArray" value=#cookies2#/>
    <cfhttpparam type="URL" name="intRecordID" value="#customerid#"/>
</cfhttp>

请让我知道我做错了什么。TIA

4

1 回答 1

4

我相信这些是根据http://www.methodintegration.com/Method-API-for-QuickBooks-CRM.aspx的 SOAP Web 服务。证明:https ://www.methodintegration.com/MethodAPI/service.asmx?wsdl

因此,用于cfinvoke消耗它们。

<cfinvoke 
     webservice="https://www.methodintegration.com/MethodAPI/service.asmx?wsdl" 
     method="MethodAPIUpdateV2" 
     returnVariable="ws" >
    <cfinvokeargument name="strCompanyAccount" value="" />
    <cfinvokeargument name="strLogin" value="" />
    <cfinvokeargument name="strPassword" value="" />
    <cfinvokeargument name="strSessionID" value="" />
    <cfinvokeargument name="strTable" value="" />
    <cfinvokeargument name="arrUpdateFieldsArray" value="" />
    <cfinvokeargument name="arrUpdateValueArray" value="" />
    <cfinvokeargument name="intRecordID" value="" />
</cfinvoke>

或者

<cfset wbsMethodAPI 
   = createObject("webservice",
                  "https://www.methodintegration.com/MethodAPI/service.asmx?wsdl")>
<cfset ws = wbsMethodAPI.MethodAPIUpdateV2(
  strLogin="", strCompanyAccount="", strTable="", arrUpdateValueArray="", 
  arrUpdateFieldsArray="", intRecordID="", strPassword="", strSessionID="")>

请参阅:http ://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-78b4.html

2 个数组的类型为tns:ArrayOfString,请参阅:http ://forums.adobe.com/message/4337438

于 2012-12-18T00:41:02.740 回答