DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13175

Deserialization of two arguments with the same object fails

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |



------- Additional Comments From [EMAIL PROTECTED]  2002-10-01 20:37 
-------
Server:
public boolean test (dvBundesland land1, dvBundesland land2)
{
  System.out.println("land1: " + land1.toString());
  System.out.println("land2: " + land2.toString());
  return land1 == land2;
}
-> output "land1: Hamburg\nland2: #undefined#" -> Bug: land2 should be Hamburg 
too

Client:
public boolean test (dvBundesland land1, dvBundesland land2)
{
  boolean result = false;
  _call = (Call) _service.createCall();
  _call.setTargetEndpointAddress(new URL(ENDPOINT));
  result = ((Boolean) _call.invoke(new QName(null, "test"), new Object[]{land1, 
land2})).booleanValue();
  return result;
}
public static void main (String[] args)
{
  TestProxyImpl proxy = new TestProxyImpl();
  dvBundesland land = (dvBundesland) dvBundesland.Factory.instance().value
("Hamburg");
  System.out.println("result: " + proxy.test(land, land)); // same object 
here!!!
}
-> output "result: false"

Deserializer:
public dvBundeslandDeserializer ()
{
  typesByMemberName.put(LAND, Constants.XSD_STRING);
}
public SOAPHandler onStartChild (
   String namespace, String localName, String prefix,
   Attributes attributes, DeserializationContext context) throws SAXException
{
  _land = null;
  QName typeQName = (QName) typesByMemberName.get(localName);
  Deserializer dSer = context.getDeserializerForType(typeQName);
  dSer.registerValueTarget(new DeserializerTarget(this, localName));
  return (SOAPHandler) dSer;
}
public void valueComplete () throws SAXException
{
  dvBundesland.Factory fact = dvBundesland.Factory.instance();
  if (_land != null && fact.isValid(_land))
  {
    setValue(fact.value(_land));
  }
  else
  {
    setValue(fact.undefinedValue());
  }
  super.valueComplete();
}
public void setValue (Object value, Object hint) throws SAXException
{
  if (hint.equals(LAND))
  {
    _land = (String) value;
  }
}
private String _land;

Factory returns new de-/serializer object everytime.


Code is reduced to the max. It produces the error reproduceable.
If you want the complete files I may upload them to you.

Reply via email to