Home > Archive > Smalltalk > October 2004 > [VW] marshaling/unmarshaling XML to Smalltalk
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[VW] marshaling/unmarshaling XML to Smalltalk
|
|
| Joachim Tuchel 2004-10-20, 4:07 pm |
| 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
| |
| Volker Zink 2004-10-21, 8:57 am |
| There 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
>
| |
| Joachim Tuchel 2004-10-21, 4:05 pm |
| Volker,
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
[color=darkred]
> 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
|
|
|
|
|