You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Leonardo battagli <ba...@sdb.it> on 2001/06/29 14:57:40 UTC

DomSerializer?

I have created a simple example using the addressbook one, now instead
of serialize an 'Address object'
I want to serialize an 'XMLDocument object', I added the followind
description in the 'deploy file'

    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-dom-demo" qname="x:domrpc"
             javaType="oracle.xml.parser.v2.XMLDocument"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-demo" qname="x:address"
             javaType="com.lulli.soap.Address"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

but it obviously doesn't work because
'No Serializer found to serialize a 'org.w3c.dom.Node' using encoding
style 'http://schemas.xmlsoap.org/soap/encoding/'.'

So should I use a DOMserialize , but which?
org.apache.soap.util.xml.Serialize
org.apache.soap.util.xml.Deserialize

Thks in advance
Leonardo




Re: DomSerializer?

Posted by Leonardo battagli <ba...@sdb.it>.
Ranjith Chinni wrote:

> Try ur luck with both of them

Do you really think I should try them?

Instead I have read the tutorial on 'Creating Type Mappings' and I have
created a 'BeanSoap object' like this one:

import java.io.*;
import java.util.*;
mport java.net.*;
import org.w3c.dom.Document;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.*;
import org.xml.sax.InputSource;

import oracle.xml.parser.v2.*;
public class BeanSOAP {

 public BeanSOAP() {
  }

  public void setXmldom_soap(oracle.xml.parser.v2.XMLDocument
newXmldom_soap) {
    xmldom_soap = newXmldom_soap;
  }
  public oracle.xml.parser.v2.XMLDocument getXmldom_soap() {
    return xmldom_soap;
  }
  private oracle.xml.parser.v2.XMLDocument xmldom_soap;
}

I have correct the 'deployment descriptor file'
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-demo" qname="x:bsoap"
             javaType="com.lulli.WebBeans.BeanSOAP"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-demo" qname="x:address"
             javaType="com.lulli.soap.Address"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

and inside the main class in the server side

  public com.lulli.WebBeans.BeanSOAP getXMLDocumentFromQuery(String name)
    throws IllegalArgumentException
  {

    XMLDocument newdom = new XMLDocument();

     com.lulli.WebBeans.BeanSOAP bsoap = new com.lulli.WebBeans.BeanSOAP();

     bsoap.setXmldom_soap(newdom);

     return bsoap;
   }

So I think it's good since I am serializing/deserializing a Bean Object,
not a non-Bean java class !!!

Instead I continue to have the following error

URLhttp://ced70.sdb.it:8080/soap/servlet/rpcrouter
  Fault Code   = SOAP-ENV:Server
  Fault String = java.lang.IllegalArgumentException: No Serializer found to
serialize a 'oracle.xml.parser.v2.XMLDocument' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.
Generated fault:



My 'java class' in the client side has this lines changed
    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:xml-soap-address-demo", "bsoap"),
                 com.lulli.WebBeans.BeanSOAP.class, beanSer, beanSer);

    // Build the call.
    Call call = new Call();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:RemoteQuery");
    call.setMethodName("getXMLDocumentFromQuery");
    call.setEncodingStyleURI(encodingStyleURI);


Tips??
Thks in advance
Leonardo




>
>
> Leonardo battagli wrote:
> >
> > I have created a simple example using the addressbook one, now instead
> > of serialize an 'Address object'
> > I want to serialize an 'XMLDocument object', I added the followind
> > description in the 'deploy file'
> >
> >     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:x="urn:xml-soap-dom-demo" qname="x:domrpc"
> >              javaType="oracle.xml.parser.v2.XMLDocument"
> >
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> >
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> >
> >     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:x="urn:xml-soap-address-demo" qname="x:address"
> >              javaType="com.lulli.soap.Address"
> >
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> >
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> >
> > but it obviously doesn't work because
> > 'No Serializer found to serialize a 'org.w3c.dom.Node' using encoding
> > style 'http://schemas.xmlsoap.org/soap/encoding/'.'
> >
> > So should I use a DOMserialize , but which?
> > org.apache.soap.util.xml.Serialize
> > org.apache.soap.util.xml.Deserialize
> >
> > Thks in advance
> > Leonardo


Re: DomSerializer?

Posted by Leonardo battagli <ba...@sdb.it>.
Ranjith Chinni wrote:

> Try ur luck with both of them

Do you really think I should try them?

Instead I have read the tutorial on 'Creating Type Mappings' and I have
created a 'BeanSoap object' like this one:

import java.io.*;
import java.util.*;
mport java.net.*;
import org.w3c.dom.Document;
import javax.xml.parsers.*;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.w3c.dom.*;
import org.xml.sax.InputSource;

import oracle.xml.parser.v2.*;
public class BeanSOAP {

 public BeanSOAP() {
  }

  public void setXmldom_soap(oracle.xml.parser.v2.XMLDocument
newXmldom_soap) {
    xmldom_soap = newXmldom_soap;
  }
  public oracle.xml.parser.v2.XMLDocument getXmldom_soap() {
    return xmldom_soap;
  }
  private oracle.xml.parser.v2.XMLDocument xmldom_soap;
}

I have correct the 'deployment descriptor file'
    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-demo" qname="x:bsoap"
             javaType="com.lulli.WebBeans.BeanSOAP"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

    <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:x="urn:xml-soap-address-demo" qname="x:address"
             javaType="com.lulli.soap.Address"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>

and inside the main class in the server side

  public com.lulli.WebBeans.BeanSOAP getXMLDocumentFromQuery(String name)
    throws IllegalArgumentException
  {

    XMLDocument newdom = new XMLDocument();

     com.lulli.WebBeans.BeanSOAP bsoap = new com.lulli.WebBeans.BeanSOAP();

     bsoap.setXmldom_soap(newdom);

     return bsoap;
   }

So I think it's good since I am serializing/deserializing a Bean Object,
not a non-Bean java class !!!

Instead I continue to have the following error

URLhttp://ced70.sdb.it:8080/soap/servlet/rpcrouter
  Fault Code   = SOAP-ENV:Server
  Fault String = java.lang.IllegalArgumentException: No Serializer found to
serialize a 'oracle.xml.parser.v2.XMLDocument' using encoding style
'http://schemas.xmlsoap.org/soap/encoding/'.
Generated fault:



My 'java class' in the client side has this lines changed
    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,
                 new QName("urn:xml-soap-address-demo", "bsoap"),
                 com.lulli.WebBeans.BeanSOAP.class, beanSer, beanSer);

    // Build the call.
    Call call = new Call();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:RemoteQuery");
    call.setMethodName("getXMLDocumentFromQuery");
    call.setEncodingStyleURI(encodingStyleURI);


Tips??
Thks in advance
Leonardo




>
>
> Leonardo battagli wrote:
> >
> > I have created a simple example using the addressbook one, now instead
> > of serialize an 'Address object'
> > I want to serialize an 'XMLDocument object', I added the followind
> > description in the 'deploy file'
> >
> >     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:x="urn:xml-soap-dom-demo" qname="x:domrpc"
> >              javaType="oracle.xml.parser.v2.XMLDocument"
> >
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> >
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> >
> >     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >              xmlns:x="urn:xml-soap-address-demo" qname="x:address"
> >              javaType="com.lulli.soap.Address"
> >
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> >
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> >
> > but it obviously doesn't work because
> > 'No Serializer found to serialize a 'org.w3c.dom.Node' using encoding
> > style 'http://schemas.xmlsoap.org/soap/encoding/'.'
> >
> > So should I use a DOMserialize , but which?
> > org.apache.soap.util.xml.Serialize
> > org.apache.soap.util.xml.Deserialize
> >
> > Thks in advance
> > Leonardo


Re: DomSerializer?

Posted by Ranjith Chinni <ra...@amsoft.net>.
Try ur luck with both of them



Leonardo battagli wrote:
> 
> I have created a simple example using the addressbook one, now instead
> of serialize an 'Address object'
> I want to serialize an 'XMLDocument object', I added the followind
> description in the 'deploy file'
> 
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-dom-demo" qname="x:domrpc"
>              javaType="oracle.xml.parser.v2.XMLDocument"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> 
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-demo" qname="x:address"
>              javaType="com.lulli.soap.Address"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> 
> but it obviously doesn't work because
> 'No Serializer found to serialize a 'org.w3c.dom.Node' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.'
> 
> So should I use a DOMserialize , but which?
> org.apache.soap.util.xml.Serialize
> org.apache.soap.util.xml.Deserialize
> 
> Thks in advance
> Leonardo


Re: DomSerializer?

Posted by Ranjith Chinni <ra...@amsoft.net>.
Try ur luck with both of them



Leonardo battagli wrote:
> 
> I have created a simple example using the addressbook one, now instead
> of serialize an 'Address object'
> I want to serialize an 'XMLDocument object', I added the followind
> description in the 'deploy file'
> 
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-dom-demo" qname="x:domrpc"
>              javaType="oracle.xml.parser.v2.XMLDocument"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> 
>     <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>              xmlns:x="urn:xml-soap-address-demo" qname="x:address"
>              javaType="com.lulli.soap.Address"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> 
> but it obviously doesn't work because
> 'No Serializer found to serialize a 'org.w3c.dom.Node' using encoding
> style 'http://schemas.xmlsoap.org/soap/encoding/'.'
> 
> So should I use a DOMserialize , but which?
> org.apache.soap.util.xml.Serialize
> org.apache.soap.util.xml.Deserialize
> 
> Thks in advance
> Leonardo


RE: DomSerializer?

Posted by Kartheek Hirode <kh...@home.com>.
Leonardo,
1) You will need tot set the Call object to NS_URI_LITERAL_XML encoding style on the client.
For an illustration, look at putListings.java in the addressbook sample:
params.addElement(new Parameter("newListings", Element.class,
                                    root, Constants.NS_URI_LITERAL_XML)); 

2) java2XMLClassName = XMLParameterSerializer
   xml2JavaClassName = XMLParameterSerializer
(Serializer and DeSerializer are interfaces which are implemented by the above class)

--KH


RE: DomSerializer?

Posted by Kartheek Hirode <kh...@home.com>.
Leonardo,
1) You will need tot set the Call object to NS_URI_LITERAL_XML encoding style on the client.
For an illustration, look at putListings.java in the addressbook sample:
params.addElement(new Parameter("newListings", Element.class,
                                    root, Constants.NS_URI_LITERAL_XML)); 

2) java2XMLClassName = XMLParameterSerializer
   xml2JavaClassName = XMLParameterSerializer
(Serializer and DeSerializer are interfaces which are implemented by the above class)

--KH