Code Comments
Programming Forum and web based access to our favorite programming groups.Hi there, I am trying to marshal/unmarshal xml-Smalltalk using the XMLObjectBinding and XMLObjectMarshalingManager stuff. The documentation is quite poor on this or I am too blind/stupid/ignorant... Here's what I do: | object xmlStream | object := MyClassToBeMapped new. xmlStream := '<xmlToSmalltalkBinding name=...' readStream. WebServices.XMLObjectBinding loadFrom: xmlStream. "Everything seems to be alright up to here... An INspect shows me an XMLObjectBinding with the marshaler in it. The classname is spelled correctly" XMLObjectMarshalingManager new marshal: object. Well, this last one doesn't work at all. It cant find a marshaler which is responsible for MyClassToBeMapped. (Message notUnderstood: #mashalerForObject:ifAbsent:) the instVar #regeisteredObjects of the XMLObjectMarshalingManager is an empty Identity Dictionary. I certainly missed the place in the docs where they tell me how to register my marshaler in at the MarshalinManager. It is not the loadFrom: alone as stated in the docs... please help... Joachim
Post Follow-up to this messageThere may be several reasons. But your code sniplet suggests that you create the MarshalingManager the wrong way. Try this: theBinding := WebServices.XMLObjectBinding bindingAtNamespace: 'myNamespace'. theMarshalManager := WebServices.XMLObjectMarshalingManager on: theBinding. theMarshalManager marshal: anObject. Hope this helps. Volker Joachim Tuchel wrote: > Hi there, > > I am trying to marshal/unmarshal xml-Smalltalk using the > XMLObjectBinding and XMLObjectMarshalingManager stuff. The documentation > is quite poor on this or I am too blind/stupid/ignorant... > > Here's what I do: > | object xmlStream | > object := MyClassToBeMapped new. > xmlStream := '<xmlToSmalltalkBinding name=...' readStream. > WebServices.XMLObjectBinding loadFrom: xmlStream. > > "Everything seems to be alright up to here... An INspect shows me an > XMLObjectBinding with the marshaler in it. The classname is spelled > correctly" > > XMLObjectMarshalingManager new marshal: object. > > Well, this last one doesn't work at all. It cant find a marshaler which > is responsible for MyClassToBeMapped. (Message notUnderstood: > #mashalerForObject:ifAbsent:) > the instVar #regeisteredObjects of the XMLObjectMarshalingManager is an > empty Identity Dictionary. > > I certainly missed the place in the docs where they tell me how to > register my marshaler in at the MarshalinManager. It is not the > loadFrom: alone as stated in the docs... > > please help... > > Joachim >
Post Follow-up to this messageVolker, thanx for answering. Volker Zink wrote: > There may be several reasons. But your code sniplet suggests that you > create the MarshalingManager the wrong way. Try this: I thought I was doing exactly what the Web Services Guide says. Which, btw, needs work. > > theBinding := WebServices.XMLObjectBinding bindingAtNamespace: > 'myNamespace'. Okay, now we have a Smalltalk Namespace and a couple of XML Namespaces. Do I pick just another one or does it have to match one of the others? > theMarshalManager := WebServices.XMLObjectMarshalingManager on: > theBinding. > theMarshalManager marshal: anObject. > I' ll give it a try. thanx Joachim > Hope this helps. > > Volker > > Joachim Tuchel wrote: > -- ------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.