Thanks Adam,
 
The problem I am having is that I try to send a Vector to the server instead of Element.  But I expect an Element sending back from the server.  I did try to use the NS_URI_Literal_XML but the Client said something like 'I can only talk with Element'.
 
So, you meant if I pass an Element to the server, then I don't have to create my own Serializer/Deserializer and map them for both Client and Server??
 
Thanks again
 
Danh Hoai
----- Original Message -----
Sent: Monday, July 09, 2001 11:46 AM
Subject: RE: How to map Element Object?

If you are just wanting to send XML Element type then why not use literal xml in the soap envelope body
 
ie:
 
Parameter inputArg =
  new Parameter(
   "inputXML",
   Element.class,
   element,
   Constants.NS_URI_LITERAL_XML);
 
 Call call = null;
 
 call =
  this.buildCall(targetURI, "createXML", this.setParams(inputArg));
 
 call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
  
 this.outputResult(call.invoke(url, ""),"createXML");
 
Hope this helps,
 
Adam
-----Original Message-----
From: Danh Hoai [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 4:11 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: How to map Element Object?

 
Thanks Kanq,
 
I tried to use BeanSerializer as you said.  But now I have different message as following:
   SOAPException : SOAP-ENV:Client  Unable to instantiate 'org.w3c.dom.Element': org/w3c/dom/Element
 
At the client side I try to map as following:
 
   SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
 
    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:xml-soap-address-demo", "address"),
                 Element.class, beanSer, beanSer);
 
      Call call = new Call();
      call.setSOAPMappingRegistry(smr);
      call.setTargetObjectURI(urn);
      call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
      call.setMethodName("createXML");
 
      Vector parameters = new Vector();
      Vector data = new Vector();
...
...
 
At the server end point to pass back to the client an Element document.
 
Anyone has any ideas, please help me. 
 
Thank you for your help.
 
Danh Hoai
 
>I think you are supposed to use the Message object from the client.  If
>you really want to serialize a Message object I would use the BeanSerializer
>class (if Message is a java bean) or write your own.

>You might want to look at the GetAddress.java example in samples.addressbook
>package for how to use the BeanSerializer class.

Reply via email to