[ 
https://issues.apache.org/jira/browse/CXF-1251?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551604
 ] 

Dain Sundstrom commented on CXF-1251:
-------------------------------------

I don't know what the problem is, but I can give you some pointers on where to 
debug.

The minOccurs schema attribute for an array is written in 
org.apache.cxf.aegis.type.basic.ArrayType.writeSchema(Element):291

The minOccurs property is set into the ArrayType by 
org.apache.cxf.aegis.type.AbstractTypeCreator.createArrayType(TypeClassInfo):185

The minOccurs value in the createArrayType method comes from the TypeClassInfo 
object, and that value is either loaded in 
org.apache.cxf.aegis.type.XMLTypeCreator.readMetadata(TypeClassInfo,Element,Element),
 or is auto created via reflection when inspecting a bean.

My guess is the ArrayType is being auto created via reflection instead of by 
reading the xml document.  With a bit of debugging you may be able to find out 
why, and either fix it yourself (hopefully, sending us the patch), or letting 
us know why it using reflection.




> Error from CXF if optional method argument is missing
> -----------------------------------------------------
>
>                 Key: CXF-1251
>                 URL: https://issues.apache.org/jira/browse/CXF-1251
>             Project: CXF
>          Issue Type: Bug
>          Components: Aegis Databinding
>            Reporter: Tawfik Lachheb
>            Priority: Blocker
>             Fix For: 2.1
>
>
> Setting the minOccurs for method parameters in the aegis mapping file does 
> not apply to the wsdl so the wsdl shows method parameters like this for 
> example (even with minOccurs set to 1):
>  
> <xsd:element name="findLocation"> 
> <xsd:complexType> 
> <xsd:sequence> 
> <xsd:element minOccurs="0" name="location" type="xsd:string"/> 
> <xsd:element minOccurs="0" name="findOptions" type="tns:FindOptions"/> 
> <xsd:element minOccurs="0" name="token" type="xsd:string"/> 
> </xsd:sequence> 
> </xsd:complexType> 
> </xsd:element> 
> With minOccurs = 0, some toolkits would send the parameters like this if the 
> findOptions parameter is null: 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
> xmlns:v20="http://arcwebservices.com/v2008";> 
>    <soapenv:Body> 
>       <v20:findLocation> 
>          <v20:location>Redlands</v20:location> 
>          
> <v20:token>YXd4MmRlbW86MTE5NTE2jI3MzpGbGV4OjZjNmZlzQ21ZTljMTA4OTNVlY2NmOWF2Fl</v20:token>
>  
>       </v20:findLocation> 
>    </soapenv:Body> 
> </soapenv:Envelope> 
> Wich returns: 
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";> 
>    <soap:Body> 
>       <soap:Fault> 
>          <faultcode>soap:Server</faultcode> 
>          <faultstring>Current state not START_ELEMENT</faultstring> 
>       </soap:Fault> 
>    </soap:Body> 
> </soap:Envelope> 
> Not sure what the best way to fix it is but it seems like we either:
> 1- fix the code to apply the minOccurs from the aegis mapping files so 
> clients don't send this kind of request
> 2- fix the code to be able to handle the minOccurs of 0 on the server side
> Please let me know if yo need any more info.
> Thanks

-- 
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