[ 
https://issues.apache.org/jira/browse/OFBIZ-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Leon Torres updated OFBIZ-309:
------------------------------

    Attachment: services.patch

Hi Scott, thanks for looking into this. 

First, that diff doesn't have anything to do with this issue, although it 
helped me pinpoint the real problem, which is this:

     <xs:attributeGroup name="attlist.implements">
         <xs:attribute type="xs:string" name="service" use="required"/>
         <xs:attribute name="optional" default="true">

According to this snippet from services.xsd and the code that handles cloning 
the optional attributes, OFBiz SVN considers all interfaces to be optional.  
That is, if you were to implement a service, by default all of its attributes 
will be optional="true".  If you had a required attribute in the service, it 
gets overruled. 

This is wrong.

Previously, attributes were inherited as-is, preserving the optional setting 
for each attribute.  That is if you have a service that has a required 
attribute, then implementing the service will preserve that.  Thus, this change 
ended up breaking a lot of services.

I've attached a patch to show what the expected behavior should be.  Since this 
is a change in behavior, it needs to be discussed some more.

Thanks again for the help. :-)

> If a service is implemented as an interface, its settings for optional 
> attributes are ignored!
> ----------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-309
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-309
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Leon Torres
>            Priority: Critical
>         Attachments: services.patch
>
>
> This is bad:
> If a service has some attributes with optional="false" and is implemented 
> with <implements service="">, the settings for optional are ignored and 
> default to "true" instead.
> As an example, look up the service definition for  upsRateEstimate  in 
> webtools and compare to the service that it implements, 
> calcShipmentEstimateInterface.  The interface defines a few optional fields 
> as false, which show up correctly for calcShipmentEstimateInterface but are 
> all set to true in upsRateEstimate.
> It used to work, something must have broken it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to