Salesforce不登入調用Webservice的方法

來源:互聯網
上載者:User

標籤:使用   海外   url   name   定義   secure   com   ebs   ping   

Salesforce中提供了WebService的調用方式,在系統內部使用的時候,比如通過VF上的JS,或者通過標準頁面上的按鈕進行調用,可以方便的實現很多功能。
同時,Salesforce中的WebService可以也以rest方式提供給第三方系統進行可控的資料互動。
但是,鑒於Salesforce的License價格虛高,並且有些第三方,例如後台是無法進行身份認證的時候,通過public site開放WebSerivce用rest方式調用就非常有必要了。

首先,要在Webservice的首行添加@RestResource(urlMapping=‘/{your name}/*‘)
之後定義好@HttpGet方法或者@HttpPost方法。

將WebService類及相關類加到Site的可訪問Apex Class列表裡。
準備完畢後確認site有沒有設定Path。
如果是sandbox的話
https://{prefix}.{sandbox instance Name}.force.com/{path}/services/apexrest/{Name Space}/{webservice urlMapping Name}/{your paramater}
如果是Production的話,
https://{prefix}.secure.force.com/{path}/services/apexrest/{Name Space}/{webservice urlMapping Name}/{your paramater}

尤其是Name Space,曾經難倒無數英雄漢。

 

海外同步地址:https://wp.me/p3i9xe-al

Salesforce不登入調用Webservice的方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.