如何参数化 PHP Soap 调用 - Taleo
How to parametrize a PHP Soap call - Taleo
我需要从 Taleo WS 获取实体列表。
我有一个可用的 soap xml 示例,但我不知道如何参数化 php soap 调用。谁能给我提示?
要求如下
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:find="http://www.taleo.com/ws/tee800/2009/01/find">
<soapenv:Header/>
<soapenv:Body>
<find:findPartialEntities>
<find:mappingVersion>http://www.taleo.com/ws/tee800/2009/01</find:mappingVersion>
<find:query>
<query:query alias="Find Open and Posted Requisitions" projectedClass="SourcingRequest" xmlns:query="http://itk.taleo.com/ws/query">
<query:projections>
<query:projection>
<query:field path="Requisition,ContestNumber"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Title" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales = "it" path="Requisition,JobInformation,DescriptionExternalHTML" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales = "it" path="Requisition,JobInformation,DescriptionInternalHTML" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field path="Requisition,Number"/>
</query:projection>
<query:projection>
<query:field path="Requisition,State,Description"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,JobField,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Organization,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Location,PrimaryLocation,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="SourcingRequestStatus,Description" localeFiltering="customLocales"/>
</query:projection>
</query:projections>
<query:filterings>
<query:filtering>
<query:equal>
<query:field locales="it" path="SourcingRequestStatus,Description" localeFiltering="customLocales"/>
<query:string>Pubblicata</query:string>
</query:equal>
</query:filtering>
</query:filterings>
<query:sortings>
<query:sorting>
<query:field path="Requisition,ContestNumber"/>
</query:sorting>
</query:sortings>
</query:query>
</find:query>
<find:attributes/>
</find:findPartialEntities>
</soapenv:Body>
</soapenv:Envelope>
到目前为止我生成了这段代码
$wsdlUrl = 'https://s01iit.taleo.net/enterprise/soap?ServiceName=FindService&wsdl';
$options = array(
'login' => 'myUsername',
'password' => 'myPassword'
);
try {
$client = new SoapClient($wsdlUrl, $options);
$params = array(
"mappingVersion"=>"http://www.taleo.com/ws/tee800/2009/01",
"query" => "",
"attributes" => ""
);
$result = $client->findPartialEntities($params);
die(var_dump($result));
我收到 "Not enough message parts were received for the operation." 错误作为响应。
谢谢
这有点棘手,因为 taleo 肥皂文档很差。我花了几天时间调查它,但还有很多事情要做。这是一个可以提供帮助的基本示例:
$query = [
'query' => [
'projectedClass' => "Requisition",
'alias' => "Find Open and Posted Requisitions a",
'subQueries' => '',
'projections' => [
'projection' => [
'field' => [
'path' => 'JobInformation,Title'
]
]
]
]
];
$attributes = [
"entry" => [
['key' => 'pageindex', 'value' => '1'],
['key' => 'pagingsize', 'value' => '10']
]
];
try {
$client = new SoapClient($findServiceWSDL, $options);
$arguments = array('mappingVersion' => 'http://www.taleo.com/ws/art750/2006/12', 'query' => $query, 'attributes' => $attributes);
} catch (Exception $e) {
echo $e->getMessage();
echo '<br>';
echo $e->getTraceAsString();
echo htmlentities($client->__getLastRequest());
echo '<br><br><br>';
echo htmlentities($client->__getLastResponse());
}
希望对您有所帮助。
我需要从 Taleo WS 获取实体列表。 我有一个可用的 soap xml 示例,但我不知道如何参数化 php soap 调用。谁能给我提示?
要求如下
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:find="http://www.taleo.com/ws/tee800/2009/01/find">
<soapenv:Header/>
<soapenv:Body>
<find:findPartialEntities>
<find:mappingVersion>http://www.taleo.com/ws/tee800/2009/01</find:mappingVersion>
<find:query>
<query:query alias="Find Open and Posted Requisitions" projectedClass="SourcingRequest" xmlns:query="http://itk.taleo.com/ws/query">
<query:projections>
<query:projection>
<query:field path="Requisition,ContestNumber"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Title" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales = "it" path="Requisition,JobInformation,DescriptionExternalHTML" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales = "it" path="Requisition,JobInformation,DescriptionInternalHTML" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field path="Requisition,Number"/>
</query:projection>
<query:projection>
<query:field path="Requisition,State,Description"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,JobField,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Organization,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="Requisition,JobInformation,Location,PrimaryLocation,Name" localeFiltering="customLocales"/>
</query:projection>
<query:projection>
<query:field locales="it" path="SourcingRequestStatus,Description" localeFiltering="customLocales"/>
</query:projection>
</query:projections>
<query:filterings>
<query:filtering>
<query:equal>
<query:field locales="it" path="SourcingRequestStatus,Description" localeFiltering="customLocales"/>
<query:string>Pubblicata</query:string>
</query:equal>
</query:filtering>
</query:filterings>
<query:sortings>
<query:sorting>
<query:field path="Requisition,ContestNumber"/>
</query:sorting>
</query:sortings>
</query:query>
</find:query>
<find:attributes/>
</find:findPartialEntities>
</soapenv:Body>
</soapenv:Envelope>
到目前为止我生成了这段代码
$wsdlUrl = 'https://s01iit.taleo.net/enterprise/soap?ServiceName=FindService&wsdl';
$options = array(
'login' => 'myUsername',
'password' => 'myPassword'
);
try {
$client = new SoapClient($wsdlUrl, $options);
$params = array(
"mappingVersion"=>"http://www.taleo.com/ws/tee800/2009/01",
"query" => "",
"attributes" => ""
);
$result = $client->findPartialEntities($params);
die(var_dump($result));
我收到 "Not enough message parts were received for the operation." 错误作为响应。
谢谢
这有点棘手,因为 taleo 肥皂文档很差。我花了几天时间调查它,但还有很多事情要做。这是一个可以提供帮助的基本示例:
$query = [
'query' => [
'projectedClass' => "Requisition",
'alias' => "Find Open and Posted Requisitions a",
'subQueries' => '',
'projections' => [
'projection' => [
'field' => [
'path' => 'JobInformation,Title'
]
]
]
]
];
$attributes = [
"entry" => [
['key' => 'pageindex', 'value' => '1'],
['key' => 'pagingsize', 'value' => '10']
]
];
try {
$client = new SoapClient($findServiceWSDL, $options);
$arguments = array('mappingVersion' => 'http://www.taleo.com/ws/art750/2006/12', 'query' => $query, 'attributes' => $attributes);
} catch (Exception $e) {
echo $e->getMessage();
echo '<br>';
echo $e->getTraceAsString();
echo htmlentities($client->__getLastRequest());
echo '<br><br><br>';
echo htmlentities($client->__getLastResponse());
}
希望对您有所帮助。