开发者

Oracle's jDeveloper seems to ignore declarations in a WSDL when calling an external web service?

开发者 https://www.devze.com 2023-02-08 14:20 出处:网络
Oracle\'s jDeveloper seems to ignore ignore declarations in a WSDL when calling an external web service and I\'m not sure why...?

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

We are try开发者_如何学编程ing to consume a third party web service found using this WSDL: http://tbe.taleo.net/wsdl/WebAPI.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>

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>

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.");                
}

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号