将 WCF getURL 映射到字符串始终返回 NULL (Taleo SOAP)
快速摘要:
Taleo 有一个操作“Dispatcher WSDL”,该操作应该返回一个与其 WebAPI WSDL 一起使用的 URL ...目的是允许对 URL 进行软编码以用于所有意图和目的。
对于操作 getURL, WcfTestClient.exe XML 视图显示 SOAP 信封中已返回 URL。
但是,WcfTestClient.exe 格式化视图显示
名称:(返回)值:(null) 类型:NullObject
我的 c# vs2010 .NET 4 代码; taleoURL 始终为 null
DispatcherAPIClient dispatcherClient = new DispatcherAPIClient("rpcrouter");
string taleoOrgCode = "TALEOSK";
string taleoURL = dispatcherClient.getURL(taleoOrgCode);
if (taleoURL == null) Console.WriteLine("null returned for " + taleoOrgCode);
这个 null 很奇怪,因为这是来自 WcfTestClient.exe 的 XML 响应:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
<SOAP-ENV:Body>
<ns1:getURLResponse xmlns:ns1="urn:TBEDispatcherAPI" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">https://tbe.taleo.net/NA12/ats/services/rpcrouter</return>
</ns1:getURLResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
https://tbe.taleo.net/NA12/ats/services/rpcrouter 是值 <返回>元素。
为了能够使用上面的链接,显然我需要 taleoURL 不为空。
Taleo API 指南的第 154-155 页说 getURL 定义为 string getURL(string orgCode)
http://tbe.taleo.net/products/TBE_API_Guide.pdf 来自
http://www.taleo.com/solutions/taleo-business -edition-web-integration-api
还有
http://tbe.taleo.net/wsdl/DispatcherAPI.wsdl
http://tbe.taleo.net/wsdl/WebAPI.wsdl
这是请求/ DispatcherAPI.wsdl 的响应部分:
<wsdl:message name="getURLRequest">
<wsdl:part name="orgCode" type="xsd:string" />
</wsdl:message>
<wsdl:message name="getURLResponse">
<wsdl:part name="getURLReturn" type="xsd:string" />
</wsdl:message>
我最好的猜测是我遗漏了一些东西。
在这种情况下,我自己的无知并不幸福。
MSDN 和 Google 没有提供帮助。
谢谢你...格里
QUICK SUMMARY:
Taleo has a single operation "Dispatcher WSDL" that is supposed to return a URL for use with its WebAPI WSDL ... the purpose is to allow the URL to be for all intents and purposes soft coded.
For operation getURL,
WcfTestClient.exe XML view shows that in the SOAP envelope a URL has been returned.
However, WcfTestClient.exe formatted view shows
Name: (return) Value: (null) Type: NullObject
My c# vs2010 .NET 4 code; taleoURL is always null
DispatcherAPIClient dispatcherClient = new DispatcherAPIClient("rpcrouter");
string taleoOrgCode = "TALEOSK";
string taleoURL = dispatcherClient.getURL(taleoOrgCode);
if (taleoURL == null) Console.WriteLine("null returned for " + taleoOrgCode);
This null is strange because here is the XML response from WcfTestClient.exe:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
<SOAP-ENV:Body>
<ns1:getURLResponse xmlns:ns1="urn:TBEDispatcherAPI" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">https://tbe.taleo.net/NA12/ats/services/rpcrouter</return>
</ns1:getURLResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
https://tbe.taleo.net/NA12/ats/services/rpcrouter is the value
of the <return> element.
To be able to use the above link, obviously I need taleoURL to be not null.
Pages 154-155 of the Taleo API guide say that
getURL's defined as string getURL(string orgCode)
http://tbe.taleo.net/products/TBE_API_Guide.pdf from
http://www.taleo.com/solutions/taleo-business-edition-web-integration-api
also
http://tbe.taleo.net/wsdl/DispatcherAPI.wsdl
http://tbe.taleo.net/wsdl/WebAPI.wsdl
Here's the Request/Response part of DispatcherAPI.wsdl:
<wsdl:message name="getURLRequest">
<wsdl:part name="orgCode" type="xsd:string" />
</wsdl:message>
<wsdl:message name="getURLResponse">
<wsdl:part name="getURLReturn" type="xsd:string" />
</wsdl:message>
My best guess is that I'm missing something.
This is a case where my own ignorance is not bliss.
MSDN and Google have not helped.
Thank you ... Gerry
我刚刚开始使用 Taleo WebAPI,遇到了同样的问题。
更新:我将引用从 VS2010 C# 服务引用更改为“旧式”Web 引用,然后它就起作用了。我仍在研究“真正的”解决方案,但这确实有效。
I just started working with the Taleo WebAPI and I'm having the same issue.
Update: I changed the reference from a VS2010 C# Service Reference to an "old school" Web Reference and then it worked. I'm still working on a "real" solution, but that does work.