Bug 779823 (SOA-2184) - Bug with SoapClient and optional parameters
Summary: Bug with SoapClient and optional parameters
Keywords:
Status: CLOSED WONTFIX
Alias: SOA-2184
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: JBossESB
Version: 5.0.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: FUTURE
Assignee: Kevin Conner
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-27 13:48 UTC by david.boeren
Modified: 2012-02-07 15:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-07 15:17:06 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-2184 0 None Closed Bug with SoapClient and optional parameters 2012-02-07 15:14:21 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.