2013-03-13 148 views
1

我使用php SOAP将前导数据发布到我的客户端的SAGE CRM,创建记录(使用crmid返回)但包含空值。由于某些未知的原因,我的XML包被忽略。 SAGE文档没有给出向CRM添加记录(addrecord)的xml示例。有人可以帮忙吗? 什么是addrecord函数的正确的xml格式?使用PHP SOAP的Sage Web服务

+0

你可能会有更好的运气在http://community.sagecrm.com – 2013-03-13 10:25:36

+0

好主意埃德。我会尽力 – Christian 2013-03-13 13:44:26

回答

0

我知道这是2013年的一个问题,但最好有回答,以防其他人来寻找解决方案。

以下是将新机会上传到Sage CRM的示例。我还没有看到你正在生成的XML,但我会开始使用add而不是addrecord。我之前没有使用过addrecord,所以我无法帮助您理解这种上传数据的格式。

请注意*Specified字段,因为它们很重要。任何具有相关*Specified字段的填充字段都必须将其设置为true。否则,该字段可能不会填充。

样品波纹管上的大部分数值必须用实际值代替。 SID是最重要的一个。

您可以在<add>标签内输入多个<records>

<?xml version='1.0' encoding='utf-8' ?> 
<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:Header> 
    <SessionHeader xmlns='http://tempuri.org/type'> 
     <sessionId>SID</sessionId> 
    </SessionHeader> 
</soap:Header> 
<soap:Body> 
    <add xmlns='http://tempuri.org/type'> 
     <entityname>opportunity</entityname> 
      <records xsi:type='opportunity'> 
       <description>description</description> 
       <forecast>forecast_value</forecast> 
       <forecastSpecified>true</forecastSpecified> 
       <certainty>certainty</certainty> 
       <certaintySpecified>true</certaintySpecified> 
       <targetclose>targetclose</targetclose> 
       <targetcloseSpecified>true</targetcloseSpecified> 
       <forecast_cid>forecast_cid</forecast_cid> 
       <forecast_cidSpecified>true</forecast_cidSpecified> 
       <total_cid>total_cid</total_cid> 
       <total_cidSpecified>true</total_cidSpecified> 
       <totalorders_cid>total_orders_cid</totalorders_cid> 
       <totalorders_cidSpecified>true</totalorders_cidSpecified> 
       <totalquotes_cid>totalquotes_cid</totalquotes_cid> 
       <totalquotes_cidSpecified>true</totalquotes_cidSpecified> 
       <source>source</source> 
       <type>type</type> 
       <stage>stage</stage> 
       <status>status</status> 
       <assigneduserid>assigneduserid</assigneduserid> 
       <assigneduseridSpecified>true</assigneduseridSpecified> 
       <channelid>channelid</channelid> 
       <channelidSpecified>true</channelidSpecified> 
       <priority>priority</priority> 
       <currency>cid</currency> 
       <currencySpecified>true</currencySpecified> 
       <primarycompanyid>primarycompanyid</primarycompanyid> 
       <primarycompanyidSpecified>true</primarycompanyidSpecified> 
       <primarypersonid>primarypersonid</primarypersonid> 
       <primarypersonidSpecified>true</primarypersonidSpecified> 
      </records> 
     </add> 
    </soap:Body> 
</soap:Envelope> 

你可以找到https://community.sagecrm.com/user_community/m/cloud_documentation/27076.aspx

的Web服务文档下载WSDL文件,以获取有关每个字段和实体提供更多的细节。