在调用外部Web服务时,Oracle的jDeveloper似乎忽略了WSDL中的声明? [英] Oracle's jDeveloper seems to ignore declarations in a WSDL when calling an external web service?

查看:64
本文介绍了在调用外部Web服务时,Oracle的jDeveloper似乎忽略了WSDL中的声明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Oracle的jDeveloper在调用外部Web服务时似乎忽略了WSDL中的ignore声明,我不确定为什么...?

Oracle's jDeveloper seems to ignore ignore declarations in a WSDL when calling an external web service and I'm not sure why...?

我们正尝试使用通过此WSDL找到的第三方Web服务: http://tbe .taleo.net/wsdl/WebAPI.wsdl

We are trying to consume a third party web service found using this WSDL: http://tbe.taleo.net/wsdl/WebAPI.wsdl

如果将其弹出到SoapUI中并打开searchCandidate操作,则会发现请求结构如下.请注意,in1中包含一个<item>节点,该节点在WSDL中定义.

If you pop that into SoapUI and open the searchCandidate operation you'll find the request structure to be the following. Note that in1 contains an <item> node within it, which is defined in the WSDL.

<urn:searchCandidate>
    <in0>?</in0>
    <in1>
        <!--Zero or more repetitions:-->
        <item>
            <key>?</key>
            <value>?</value>
        </item>
    </in1>
</urn:searchCandidate>

奇怪的是,当我们在jDeveloper中使用此WSDL并调用searchCandidate操作时,出于某种原因,jdeveloper会构建以下xml soap消息.请注意,这里没有<item>,而是在其中放置了<mapEntry>.

The weird part is that when we use this WSDL in jDeveloper and call the searchCandidate operation, for some reason jdeveloper builds the following xml soap message. Note that <item> is not there, but instead <mapEntry> is in its place.

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:ns0="urn:TBEWebAPI"
              xmlns:ns1="http://xml.apache.org/xml-soap">
  <env:Body>
    <ns0:searchCandidate>
      <in0>STRING DATA</in0>
      <in1 xmlns:ans1="http://www.oracle.com/webservices/internal/literal"
            xsi:type="ans1:hashMap">
        <ans1:mapEntry xsi:type="ans1:mapEntry">
          <ans1:key xsi:type="xsd:string">HireDate</ans1:key>
          <ans1:value xsi:type="xsd:string">2011-12-31</ans1:value>
        </ans1:mapEntry>
        <ans1:mapEntry xsi:type="ans1:mapEntry">
          <ans1:key xsi:type="xsd:string">status</ans1:key>
          <ans1:value xsi:type="xsd:string">Hired</ans1:value>
        </ans1:mapEntry>
      </in1>
    </ns0:searchCandidate>
  </env:Body>
</env:Envelope>

这是我们填充searchCandidate参数并调用Web服务的方式.这只是一个摘要,因为从头到尾的整个过程都有些复杂,只会使我要在此处传达的问题变得混乱.为了对此进行测试,我建议将Web服务的端点更改为类似 http://localhost:6667 的内容,然后进行嗅探http流量以查看肥皂消息,因为该错误是在对Web服务的实际调用之前创建的,因此无需完成对其服务器的调用.我们的企业软件是Oracle的EnterpriseOne,其Web服务被称为业务服务",并使用jDeveloper来创建它们并与主要的ERP系统交互,不确定是否很重要,但以防万一我想提及它.

Here is how we are populate the searchCandidate parameters and calling the web service. This is only a snippet because the whole process from start to finish is a little complicated and will just clutter the issue I'm trying to convey here. To test this out I would recommend changing the endpoint of the webservice to something like http://localhost:6667 and then just sniff the http traffic to see the soap message, since the error is created before the actual call to the web service is made it's not necessary to complete the call to their servers. Our enterprise software is Oracle's EnterpriseOne and their web services are referred to as "Business Services" and uses jDeveloper to create them and interface with the main ERP system, not sure if that matters but just in case I wanted to mention it.

RpcrouterSoapBinding_searchCandidate_ReqS inParam = new RpcrouterSoapBinding_searchCandidate_ReqS();

// Set in0
inParam.setIn0("String Data");

// Set in1
Map inputParamMap = new HashMap();
inputParamMap.put("HireDate", "2011-12-31");
inputParamMap.put("status", "Hired");
inParam.setIn1(inputParamMap);

// Begin service call
oracle.e1.bssv.J5706002.proxy.SearchResultArr searchReturn;
RpcrouterSoapBinding_searchCandidate_RespS outParam = new RpcrouterSoapBinding_searchCandidate_RespS();
try {
    searchReturn = myPort.searchCandidate(inParam.getIn0().toString(),inParam.getIn1);
    outParam.setSearchCandidateReturn(searchReturn);
} catch(Exception err){
    System.out.println("I got an error.");                
}

您以前见过类似的东西吗?似乎序列化程序正在忽略WSDL.根据WSDL,<in1>应该具有apachesoap:Map类型,但是正如您可以在此处看到将其设置为ans1:hashMap一样,但是我不知道如何告诉它使用正确的类型?

Have you ever seen anything like this before? It seems like the serializer is ignoring the WSDL. <in1> should have a type of apachesoap:Map per the WSDL, but as you can see here somehow its getting set to ans1:hashMap but I have no idea how to tell it to use the correct type?

有人以前见过这种行为吗?

Has anyone see this type of behavior before?

推荐答案

事实证明这是jDeveloper中的错误. Oracle正在修复错误.很高兴知道我不疯狂. :D

It turns out this was a bug in jDeveloper. Oracle is working on a bug fix. Glad to know Im not crazy. :D

这篇关于在调用外部Web服务时,Oracle的jDeveloper似乎忽略了WSDL中的声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆