Bug 779823 (SOA-2184)

Summary: Bug with SoapClient and optional parameters
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: david.boeren <david.boeren>
Component: JBossESBAssignee: Kevin Conner <kevin.conner>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.0.2CC: atangrin, rwagner, tbf
Target Milestone: ---   
Target Release: FUTURE   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2184
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 15:17:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description david.boeren 2010-07-27 13:48:27 UTC
Help Desk Ticket Reference: https://access.redhat.com/issue-tracker/?module=issues&action=view&tid=1168653&gid=1354
project_key: SOA

There seems to be a bug in the private void injectParameters(Element element, Map params, String soapNs) function in the org.jboss.soa.esb.services.soapui.SoapUIClientService class.

The problem is that given a WSDL than takes many optional parameters (only a simple body supplied here):

  <soapenv:Body>
     <ser:getLogicalDate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <getLogicalDateRequest xsi:type="dto:GetLogicalDateRequest" xmlns:dto="http://dto.telenor.dk">
           <businessCorrelationId xsi:type="xsd:string">?</businessCorrelationId>
           <businessCorrelationIdType xsi:type="xsd:string">?</businessCorrelationIdType>
           <systemId xsi:type="xsd:string">?</systemId>
        </getLogicalDateRequest>
     </ser:getLogicalDate>
  </soapenv:Body>

And an OGNL expression as follows:

getLogicalDateRequest.businessCorrelationId = "XXX"

That is not specifying the two other parameters the action will generate a request that looks like this:

  <soapenv:Body>
     <ser:getLogicalDate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <getLogicalDateRequest xsi:type="dto:GetLogicalDateRequest" xmlns:dto="http://dto.telenor.dk">
           <businessCorrelationId xsi:type="xsd:string">XXX</businessCorrelationId>
           <businessCorrelationIdType xsi:type="xsd:string"></businessCorrelationIdType>
           <systemId xsi:type="xsd:string"></systemId>
        </getLogicalDateRequest>
     </ser:getLogicalDate>
  </soapenv:Body>

Which is incorrect as the code behind the web service will assume that businessCorrelationIdType and systemId are the empty String not null as they should be. A more correct request would be:

  <soapenv:Body>
     <ser:getLogicalDate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <getLogicalDateRequest xsi:type="dto:GetLogicalDateRequest" xmlns:dto="http://dto.telenor.dk">
           <businessCorrelationId xsi:type="xsd:string">XXX</businessCorrelationId>
        </getLogicalDateRequest>
     </ser:getLogicalDate>
  </soapenv:Body>

This extends to complex Elements (ie. and element where nothing is set should be sent to the web service).

Comment 2 Kevin Conner 2010-07-27 13:53:06 UTC
Can you try this on ESB trunk and see if it still exists?

Please also supply a testcase.

Comment 4 Anne-Louise Tangring 2010-09-21 17:20:13 UTC
Kevin, assigning this to you, so that you can give David an answer.

Comment 5 Rick Wagner 2011-12-05 20:49:48 UTC
Rick reviewing old JIRAs.  No indication it's fixed. (But couldn't find customer 'blixen'.)  Left Open.