History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: WS-10
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Chad Brandon
Reporter: Andrew Kinard
Votes: (View)
Watchers: (View)
Operations

If you were logged in you would be able to see more operations.
WebService Cartridge

Spurious Model Validation Error on service method with parameter of type collection

Created: 13/Mar/06 08:56 PM   Updated: 30/Nov/06 08:28 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File TestAppModel.xmi (166 kb)
2. Zip Archive WebServiceMetafacadeModel.xml.zip (18 kb)

Environment: Occurs on both MacOSX and Linux under Java 1.4.2


 Description   
I just switched to using 3.2-RC1-SNAPSHOT and I'm getting a validation error on a non-webservice service method. The error states that I cannot have a parameter of type "Collection" in a webservice method.

I agree that webservices should use arrays instead of collections, but neither the service class or method in question are marked as being a webservice or webservice operation. I have found this error to be consistent on two separate models. I have attached a sample model to this bug.

I get the following error and stack trace:

ERROR [AndroMDA] Model Validation Failed - 1 VALIDATION ERROR
ERROR [AndroMDA] 1) [Data::CarService::getTask::resources]:A web service parameter can NOT be a collection type You'll need to model an array instead.
org.andromda.core.ModelValidationException: Model validation failed!
        at org.andromda.core.engine.ModelProcessor.printValidationMessages(ModelProcessor.java:434)
        at org.andromda.core.engine.ModelProcessor.validateModel(ModelProcessor.java:374)
        at org.andromda.core.engine.ModelProcessor.loadModelIfNecessary(ModelProcessor.java:324)
        at org.andromda.core.engine.ModelProcessor.loadIfNecessary(ModelProcessor.java:504)
        at org.andromda.core.engine.ModelProcessor.processModels(ModelProcessor.java:217)
        at org.andromda.core.engine.ModelProcessor.process(ModelProcessor.java:143)
        at org.andromda.core.engine.ModelProcessor.process(ModelProcessor.java:79)
        at org.andromda.core.engine.Engine.run(Engine.java:82)
        at org.andromda.core.AndroMDA.run(AndroMDA.java:197)
  ...


 All   Comments   Change History      Sort Order:
Comment by Andrew Kinard [13/Mar/06 08:57 PM]
Here is a sample model that produces the spurious error.

Comment by David Ignjic [30/Nov/06 08:26 PM]
solution for this bug is simple change constraint validation
from
context WebServiceParameter inv :
return=false implies
type.collectionType = false
to
context WebServiceParameter inv :
operation.exposed implies
type.collectionType = false

i don't why is return=false, but if it needed
change to
context WebServiceParameter inv :
(operation.exposed and return=false) implies
type.collectionType = false

Comment by David Ignjic [30/Nov/06 08:28 PM]
SOLUTION