Hi,
Thanks for the quick reply. If I remember correctly putting
nillable=true and minOccurs=0 together results in some strange behaviour
in Xfire. Instead of generating Strings you get JAXBElement<String> or
something or is this fixed in the current release?
Regards,
Ivo van Dongen
Daniel Brake wrote:
Hi there,
You could add nillable="true" to your userId element. The generated
payload would then match the contract.
Dan
------------------------------------------------------------------------
*From:* Ivo van Dongen [mailto:[EMAIL PROTECTED]
*Sent:* 26 April 2007 14:03
*To:* [email protected]
*Subject:* [xfire-user] Xfire generates invalid messages (xsi:nil="true")
Hi,
We use Xfire on our server and client side, but we ran into a problem
after turning validation on. We have an operation witch takes the
folloing element as a payload:
<xs:element name="getUserProfileRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="userId" type="xs:string"
minOccurs="0">
<xs:annotation>
<xs:documentation>You'll only have to
specify a userId if you want to read somebody else's profile
(assuming you have the authorization to do this)</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
The message that is generated on the client side:
<ns2:getUserProfileRequest
xmlns:ns2="http://tesis.nl/webservices/types">
<userId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true" />
</ns2:getUserProfileRequest>
This leads to the following error message when validating:
Exception in startElement: cvc-elt.3.1: Attribute
'http://www.w3.org/2001/XMLSchema-instance,nil' must not appear on
element 'userId', because the {nillable} property of 'userId' is
false.
Is this expected behaviour? And if so is there a way to control this?
Thanks in advance,
Ivo van Dongen
--
Ivo van Dongen
Func. Internet Integration
Prins Hendrikkade 20-21, 1012 TL Amsterdam
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500
=======================================================================
Message has been scanned for viruses by MessageLabs Protect
This email and any files transmitted with it are intended only for the
person(s) or entity to which they are addressed and may contain
confidential information. Any review, retransmission, dissemination,
copying or other use of, this information by persons or entities other
than the intended recipient is prohibited. If you have received this
in error and/or, are not the named addressee, please contact the
sender and
delete the material from all computers.
Optimad does not accept any liability for the content of the email.
Although emails are routinely screened for viruses Optimad does not
accept responsibility for any damage caused.
Replies to this email and all emails sent to Optimad Media Systems may
be intercepted by Message Labs and screened for viruses. Optimad
excludes all liability (to the extent permitted by law) to the senders
of emails to Optimad for the access to emails granted to Message Labs.
--
Ivo van Dongen
Func. Internet Integration
Prins Hendrikkade 20-21, 1012 TL Amsterdam
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email