:) My guess is that you are writing a SOAP interface to mathematica :) Right?
-- dims --- Chris Williamson <[EMAIL PROTECTED]> wrote: > Hmmm. I don't mind getting rid of setType all that much, as long as I can > still set the type using attributes. Which means fixing that last bug I > submitted :) I have a fix btw, if you would like to see it. It is pretty > simple, but I am not sure it is as efficient as you would like. It is > however, similar to how you set the encoding style. > > I don't really want to go into my environment for using Axis, but lets just > say it is not a typical environment. The interface to the users is not > Java, and hence I am not using Java objects to store user input. I am > building SOAPEnvelopes by hand, because of this. Which means that I would > like to set everything I can (type, name, namespace, array attributes, etc.) > directly in the MessageElement. So something like the example you provided > will not really work for me for complex objects. I could do something like > this for the base types, but for complex objects, I certainly do not have a > Java object that corresponds to the data structures I am using. And I would > still like to be able to set the type for these objects and other things > about the object. > > It appears I can using attributes to set this information. Anyway this has > worked very well for me thus far except for this minor little glitch of > setting the type. I know this is a bit strange, but I think it very > desirable to provide functionality that will allows a developer to build a > SOAPEnvelope from ground up. > > Chris > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:dims@;apache.org] > > Sent: Tuesday, November 05, 2002 10:39 AM > > To: [EMAIL PROTECTED] > > Subject: cvs commit: xml-axis/java/src/org/apache/axis/message > > MessageElement.java > > > > > > dims 2002/11/05 08:39:05 > > > > Modified: java/src/org/apache/axis/message MessageElement.java > > Log: > > Code scrub...Remove unused/dead code. > > > > Revision Changes Path > > 1.136 +0 -54 > > xml-axis/java/src/org/apache/axis/message/MessageElement.java > > > > Index: MessageElement.java > > =================================================================== > > RCS file: > > /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v > > retrieving revision 1.135 > > retrieving revision 1.136 > > diff -u -r1.135 -r1.136 > > --- MessageElement.java 5 Nov 2002 15:53:17 -0000 1.135 > > +++ MessageElement.java 5 Nov 2002 16:39:05 -0000 1.136 > > @@ -345,7 +345,6 @@ > > } > > return typeQName; > > } > > - public void setType(QName qName) { typeQName = qName; } > > > > public SAX2EventRecorder getRecorder() { return recorder; } > > public void setRecorder(SAX2EventRecorder rec) { recorder = rec; } > > @@ -816,59 +815,6 @@ > > if (namespaces == null) > > namespaces = new ArrayList(); > > namespaces.add(map); > > - } > > - > > - /* > > - * Handle transient fields. > > - * NB. order of writes in writeObject must match order of reads in > > - * readObject. > > - */ > > - > > - private void writeObject(ObjectOutputStream out) throws > > IOException { > > - if (typeQName == null) { > > - out.writeBoolean(false); > > - } else { > > - out.writeBoolean(true); > > - out.writeObject(typeQName.getNamespaceURI()); > > - out.writeObject(typeQName.getLocalPart()); > > - } > > - > > - if (attributes == null) { > > - attributes = new AttributesImpl(); > > - } > > - int n = attributes.getLength(); > > - out.writeInt(n); > > - for (int i = 0; i < n; i++) { > > - out.writeObject(attributes.getLocalName(i)); > > - out.writeObject(attributes.getQName(i)); > > - out.writeObject(attributes.getURI(i)); > > - out.writeObject(attributes.getType(i)); > > - out.writeObject(attributes.getValue(i)); > > - } > > - out.defaultWriteObject(); > > - } > > - > > - private void readObject(ObjectInputStream in) > > - throws IOException, ClassNotFoundException { > > - > > - if (in.readBoolean()) { > > - typeQName = new QName((String)in.readObject(), > > - (String)in.readObject()); > > - } else { > > - typeQName = null; > > - } > > - > > - AttributesImpl attributes = makeAttributesEditable(); > > - int n = in.readInt(); > > - for (int i = 0; i < n; i++) { > > - String localName = (String)in.readObject(); > > - String qName = (String)in.readObject(); > > - String uri = (String)in.readObject(); > > - String type = (String)in.readObject(); > > - String value = (String)in.readObject(); > > - attributes.addAttribute(uri, localName, qName, > > type, value); > > - } > > - in.defaultReadObject(); > > } > > > > // JAXM Node methods... > > > > > > > ===== Davanum Srinivas - http://xml.apache.org/~dims/ __________________________________________________ Do you Yahoo!? HotJobs - Search new jobs daily now http://hotjobs.yahoo.com/