I can't get betwixt to write an attribute that is empty ("").
Here's de .betwixt file:
------------------
<info primitiveTypes="attributes">
<element name="sso">
<element name="id">
<attribute name="src" property="idOrigen" />
<attribute name="dst" value="cn=AuthServer, ou=DESEIN,
o=AFIP, c=AR" />
<attribute name="unique_id" property="idMensaje" />
<attribute name="gen_time" property="fechaGeneracion" />
<attribute name="exp_time" property="fechaExpiracion" />
</element>
<element name="operation">
<attribute name="type" value="login" />
<element name="login">
<attribute name="entity" property="cuitOrigen" />
<attribute name="system" value="" />
<attribute name="username" property="cuitUsuario" />
<attribute name="authmethod" value="passphrase" />
<element name="profile">
<element name="cuit">
<attribute name="number" property="cuitUsuario"
/>
</element>
</element>
</element>
</element>
</element>
</info>
------------------
This is the class:
------------------
public class InterconexionSETI
{
private String idOrigen;
private String cuitOrigen;
private String idMensaje;
private String fechaGeneracion;
private String fechaExpiracion;
private String cuitUsuario;
[...]
}
------------------
This is the mapping rutine:
------------------
StringWriter resultWriter = new StringWriter();
BeanWriter writer = new BeanWriter(resultWriter);
writer.getBindingConfiguration().setMapIDs(false);
//writer.getBindingConfiguration().setValueSuppressionStrategy(ValueSupp
ressionStrategy.ALLOW_ALL_VALUES);
writer.enablePrettyPrint();
try {
writer.write(setiBean);
}
catch (IOException ioex) { }
catch (SAXException saxex) { }
catch (IntrospectionException iex) { }
return resultWriter.toString();
------------------
I get the following xml:
------------------
<sso>
<id src="CN=DEMO,OU=Seguridad Informatica,O=Certificacion
2,L=Capital Federal,ST=Buenos Aires,C=AR" dst="cn=AuthServer, ou=DESEIN,
o=AFIP, c=AR" unique_id="9991" gen_time="1163789407"
exp_time="1163790007"/>
<operation type="login">
<login entity="30604796357" username="27281677050"
authmethod="passphrase">
<profile>
<cuit number="27281677050"/>
</profile>
</login>
</operation>
</sso>
------------------
Where the <login> element doesn't include the "system" attribute.
I've tried using the ValueSuppressionStrategy.ALLOW_ALL_VALUES, but I
get the following xml:
------------------
<sso>
<id/>
<operation>
<login>
<profile>
<cuit/>
</profile>
</login>
</operation>
</sso>
------------------
What am I doing wrong??
---
Juan Eduardo Vicente
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]