如何填充SOAP标头Sales Force

时间:2013-09-19 19:02:56

标签: web-services soap salesforce apex-code

我在Saels Force中创建了一个服务webservices,从类创建的soliceitei生成WSDL并转到将使用该服务的公司。但是有一些标题信息不能事先得到,有人可以帮助我吗?

  <soapenv:Header>
  <atu:AllowFieldTruncationHeader>
     <atu:allowFieldTruncation>???????????</atu:allowFieldTruncation>
  </atu:AllowFieldTruncationHeader>
  <atu:DebuggingHeader>
     <!--Zero or more repetitions:-->
     <atu:categories>
        <atu:category>??????????</atu:category>
        <atu:level>???????????</atu:level>
     </atu:categories>
     <atu:debugLevel>????????????</atu:debugLevel>
  </atu:DebuggingHeader>
  <atu:CallOptions>
     <atu:client>??????????????</atu:client>
  </atu:CallOptions>
  <atu:SessionHeader>
     <atu:sessionId>?????????????</atu:sessionId>
  </atu:SessionHeader>

1 个答案:

答案 0 :(得分:0)

对于会话ID,您必须使用Enterprise.WSDL或Partner.wsdl提供的登录方法登录。

下面是一个装满标题的exeplo肥皂。

<soapenv:Header>
  <atu:AllowFieldTruncationHeader>
     <atu:allowFieldTruncation>**true**</atu:allowFieldTruncation>
  </atu:AllowFieldTruncationHeader>
  <atu:DebuggingHeader>
     <!--Zero or more repetitions:-->
     <atu:categories>
        <atu:category>**Apex_Code**</atu:category>
        <atu:level>**Debug**</atu:level>
     </atu:categories>
     <atu:debugLevel>**Debugonly**</atu:debugLevel>
  </atu:DebuggingHeader>
  <atu:CallOptions>
     <atu:client>**true**</atu:client>
  </atu:CallOptions>
  <atu:SessionHeader>
     <atu:sessionId>**YOUR_SESSION_ID**</atu:sessionId>
  </atu:SessionHeader>

我希望有所帮助。