You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Florin Moldovan <fl...@art-net.ro> on 2001/02/07 11:26:55 UTC
I send a complex object via SOAP
Hi all,
I succesfully send a complex object using SOAP.
-an object like this:
public class ObjectType{
String s;
Vector v;
AnotherType a;
............
}
The point is to use a java serializer not a SOAP serializer on the client side. Send an array of bytes or a string via SOAP. Then, on the server side use a java deserializer and rebuild the object.
Re: Understanding SOAP
Posted by William Brogden <wb...@bga.com>.
"John E. Conlon" wrote:
>
> Question for the list:
>
> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
> buy or read?
>
> Context:
> I am not interested in a Microsoft perspective (but I do want to write Java
> to talk with MS implementations) nor one that will confuse me coming up to
> speed with my Java - SOAP implementation.
>
> Anyone read it and have an opinion?
>
> thanks,
>
> John
I am using it as a reference - it is pretty clearly written.
--
WBB - wbrogden@lanw.com
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP
ISBN 0-7821-2809-2
Re: Understanding SOAP
Posted by "John L. Webber - jentro AG" <Jo...@jentro.com>.
It can also mean "strange".
John
Aleksandar Milanovic wrote:
>
> As far as I know, komish (and not comish) means funny in German.
> Alex
>
> -----Original Message-----
> From: John E. Conlon [mailto:jconlon@verticon.com]
> Sent: Monday, February 12, 2001 8:29 AM
> To: soap-user@xml.apache.org
> Subject: Re: Understanding SOAP
>
> Isn't the word 'comish', a German word for strange? ;-)
>
> John
>
> At 08:43 PM 2/11/01 -0600, you wrote:
> >It is very Com-ish.
> >Regads - George
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jentro AG
John L. Webber, Software Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Peter-Henlein-Strasse 28-30, 85540 Haar/Munich, Germany
Tel.: +49 89 462 385 0 (switchboard)
Tel.: +49 89 462 385 38 (direct)
Fax: +49 89 462 385 29
mailto:John.Webber@jentro.com
http://www.jentro.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: Understanding SOAP
Posted by "John L. Webber - jentro AG" <Jo...@jentro.com>.
It can also mean "strange".
John
Aleksandar Milanovic wrote:
>
> As far as I know, komish (and not comish) means funny in German.
> Alex
>
> -----Original Message-----
> From: John E. Conlon [mailto:jconlon@verticon.com]
> Sent: Monday, February 12, 2001 8:29 AM
> To: soap-user@xml.apache.org
> Subject: Re: Understanding SOAP
>
> Isn't the word 'comish', a German word for strange? ;-)
>
> John
>
> At 08:43 PM 2/11/01 -0600, you wrote:
> >It is very Com-ish.
> >Regads - George
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jentro AG
John L. Webber, Software Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Peter-Henlein-Strasse 28-30, 85540 Haar/Munich, Germany
Tel.: +49 89 462 385 0 (switchboard)
Tel.: +49 89 462 385 38 (direct)
Fax: +49 89 462 385 29
mailto:John.Webber@jentro.com
http://www.jentro.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RE: Understanding SOAP
Posted by Aleksandar Milanovic <am...@galdosinc.com>.
As far as I know, komish (and not comish) means funny in German.
Alex
-----Original Message-----
From: John E. Conlon [mailto:jconlon@verticon.com]
Sent: Monday, February 12, 2001 8:29 AM
To: soap-user@xml.apache.org
Subject: Re: Understanding SOAP
Isn't the word 'comish', a German word for strange? ;-)
John
At 08:43 PM 2/11/01 -0600, you wrote:
>It is very Com-ish.
>Regads - George
>
>"John E. Conlon" wrote:
>
>> Question for the list:
>>
>> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
>> buy or read?
>>
>> Context:
>> I am not interested in a Microsoft perspective (but I do want to write
Java
>> to talk with MS implementations) nor one that will confuse me coming up
to
>> speed with my Java - SOAP implementation.
>>
>> Anyone read it and have an opinion?
>>
>> thanks,
>>
>> John
>> ************************************************************************
>> John E. Conlon
>> jconlon@verticon.com
>> tel: (770) 886-5470
>> fax: (770) 888-6894
>> <http://www.verticon.com/>www.verticon.com
>> ************************************************************************
>
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
RE: Understanding SOAP
Posted by Aleksandar Milanovic <am...@galdosinc.com>.
As far as I know, komish (and not comish) means funny in German.
Alex
-----Original Message-----
From: John E. Conlon [mailto:jconlon@verticon.com]
Sent: Monday, February 12, 2001 8:29 AM
To: soap-user@xml.apache.org
Subject: Re: Understanding SOAP
Isn't the word 'comish', a German word for strange? ;-)
John
At 08:43 PM 2/11/01 -0600, you wrote:
>It is very Com-ish.
>Regads - George
>
>"John E. Conlon" wrote:
>
>> Question for the list:
>>
>> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
>> buy or read?
>>
>> Context:
>> I am not interested in a Microsoft perspective (but I do want to write
Java
>> to talk with MS implementations) nor one that will confuse me coming up
to
>> speed with my Java - SOAP implementation.
>>
>> Anyone read it and have an opinion?
>>
>> thanks,
>>
>> John
>> ************************************************************************
>> John E. Conlon
>> jconlon@verticon.com
>> tel: (770) 886-5470
>> fax: (770) 888-6894
>> <http://www.verticon.com/>www.verticon.com
>> ************************************************************************
>
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Re: Understanding SOAP
Posted by "John E. Conlon" <jc...@verticon.com>.
Isn't the word 'comish', a German word for strange? ;-)
John
At 08:43 PM 2/11/01 -0600, you wrote:
>It is very Com-ish.
>Regads - George
>
>"John E. Conlon" wrote:
>
>> Question for the list:
>>
>> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
>> buy or read?
>>
>> Context:
>> I am not interested in a Microsoft perspective (but I do want to write Java
>> to talk with MS implementations) nor one that will confuse me coming up to
>> speed with my Java - SOAP implementation.
>>
>> Anyone read it and have an opinion?
>>
>> thanks,
>>
>> John
>> ************************************************************************
>> John E. Conlon
>> jconlon@verticon.com
>> tel: (770) 886-5470
>> fax: (770) 888-6894
>> <http://www.verticon.com/>www.verticon.com
>> ************************************************************************
>
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Re: Understanding SOAP
Posted by "John E. Conlon" <jc...@verticon.com>.
Isn't the word 'comish', a German word for strange? ;-)
John
At 08:43 PM 2/11/01 -0600, you wrote:
>It is very Com-ish.
>Regads - George
>
>"John E. Conlon" wrote:
>
>> Question for the list:
>>
>> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
>> buy or read?
>>
>> Context:
>> I am not interested in a Microsoft perspective (but I do want to write Java
>> to talk with MS implementations) nor one that will confuse me coming up to
>> speed with my Java - SOAP implementation.
>>
>> Anyone read it and have an opinion?
>>
>> thanks,
>>
>> John
>> ************************************************************************
>> John E. Conlon
>> jconlon@verticon.com
>> tel: (770) 886-5470
>> fax: (770) 888-6894
>> <http://www.verticon.com/>www.verticon.com
>> ************************************************************************
>
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Re: Understanding SOAP
Posted by George I Matkovits <ma...@uswest.net>.
It is very Com-ish.
Regads - George
"John E. Conlon" wrote:
> Question for the list:
>
> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
> buy or read?
>
> Context:
> I am not interested in a Microsoft perspective (but I do want to write Java
> to talk with MS implementations) nor one that will confuse me coming up to
> speed with my Java - SOAP implementation.
>
> Anyone read it and have an opinion?
>
> thanks,
>
> John
> ************************************************************************
> John E. Conlon
> jconlon@verticon.com
> tel: (770) 886-5470
> fax: (770) 888-6894
> <http://www.verticon.com/>www.verticon.com
> ************************************************************************
Re: Understanding SOAP
Posted by George I Matkovits <ma...@uswest.net>.
It is very Com-ish.
Regads - George
"John E. Conlon" wrote:
> Question for the list:
>
> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
> buy or read?
>
> Context:
> I am not interested in a Microsoft perspective (but I do want to write Java
> to talk with MS implementations) nor one that will confuse me coming up to
> speed with my Java - SOAP implementation.
>
> Anyone read it and have an opinion?
>
> thanks,
>
> John
> ************************************************************************
> John E. Conlon
> jconlon@verticon.com
> tel: (770) 886-5470
> fax: (770) 888-6894
> <http://www.verticon.com/>www.verticon.com
> ************************************************************************
Re: Understanding SOAP
Posted by William Brogden <wb...@bga.com>.
"John E. Conlon" wrote:
>
> Question for the list:
>
> Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
> buy or read?
>
> Context:
> I am not interested in a Microsoft perspective (but I do want to write Java
> to talk with MS implementations) nor one that will confuse me coming up to
> speed with my Java - SOAP implementation.
>
> Anyone read it and have an opinion?
>
> thanks,
>
> John
I am using it as a reference - it is pretty clearly written.
--
WBB - wbrogden@lanw.com
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP
ISBN 0-7821-2809-2
RE: Understanding SOAP
Posted by Cory Isaacson <ci...@capita2.com>.
I found that just reading the first sections of the SOAP spec from the W3c
was easier and faster.
Cory
-----Original Message-----
From: John E. Conlon [mailto:jconlon@verticon.com]
Sent: Friday, February 09, 2001 9:10 AM
To: soap-user@xml.apache.org
Subject: Understanding SOAP
Question for the list:
Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
buy or read?
Context:
I am not interested in a Microsoft perspective (but I do want to write Java
to talk with MS implementations) nor one that will confuse me coming up to
speed with my Java - SOAP implementation.
Anyone read it and have an opinion?
thanks,
John
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
RE: Understanding SOAP
Posted by Cory Isaacson <ci...@capita2.com>.
I found that just reading the first sections of the SOAP spec from the W3c
was easier and faster.
Cory
-----Original Message-----
From: John E. Conlon [mailto:jconlon@verticon.com]
Sent: Friday, February 09, 2001 9:10 AM
To: soap-user@xml.apache.org
Subject: Understanding SOAP
Question for the list:
Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
buy or read?
Context:
I am not interested in a Microsoft perspective (but I do want to write Java
to talk with MS implementations) nor one that will confuse me coming up to
speed with my Java - SOAP implementation.
Anyone read it and have an opinion?
thanks,
John
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Understanding SOAP
Posted by "John E. Conlon" <jc...@verticon.com>.
Question for the list:
Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
buy or read?
Context:
I am not interested in a Microsoft perspective (but I do want to write Java
to talk with MS implementations) nor one that will confuse me coming up to
speed with my Java - SOAP implementation.
Anyone read it and have an opinion?
thanks,
John
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Understanding SOAP
Posted by "John E. Conlon" <jc...@verticon.com>.
Question for the list:
Is the book "Understanding SOAP: The Authoritative Solution" a worthwhile
buy or read?
Context:
I am not interested in a Microsoft perspective (but I do want to write Java
to talk with MS implementations) nor one that will confuse me coming up to
speed with my Java - SOAP implementation.
Anyone read it and have an opinion?
thanks,
John
************************************************************************
John E. Conlon
jconlon@verticon.com
tel: (770) 886-5470
fax: (770) 888-6894
<http://www.verticon.com/>www.verticon.com
************************************************************************
Re: how to send a complex object via SOAP
Posted by Olivier Brand <ol...@intraware.com>.
Sure you can reduce the size by creating a GZIPOutputStream. Then encode
with Base64.
Olivier
Mahendra Babu wrote:
> Hi Florin, I was able to serialize and de-serialize successfully.
> Thanks for all your inputs. One thing I observed was that
> Base64.encode() and Base64.decode() functions seemto consume a lot of
> time. Are there an any other alternate encoding methods available? Is
> it possible to compress the byte array before encoding? so that I
> would be able to reducethe payload. Thanks once again. -Mahendra
> Babu
>
> soap.jarorg.apache.soap.encoding.soapenc.Base64
>
> ----- Original Message -----
> From: Mahendra Babu
> To: Florin Moldovan
> Sent: Thursday, February 08, 2001 6:24 PM
> Subject: Re: how to send a complex object via SOAP
> Hi Florin, Could you please point me where I
> could get the Base64 class. It seemsthat it is not
> a part of core Java. Thanks,Mahendra Babu
>
> Hi Mahendra, Let it be a class for
> serialization/deserialization: public
> class ObjectSerializerDeserializer {
> public static byte[]
> serialize(Object obj){ // like
> you said }
> public static Object
> deserialize(byte deser[]){ // the
> reversed task }
> } Client side: ComplexObject co = new
> ComplexObject(......);
> String s=
> Base64.encode(ObjectSerializerDeserializer.serialize(co));
>
> // send the string s via SOAP Server
> side: ComplexObject co =
> (ComplexObject)ObjectSerializerDeserializer.deserialize(Base64.decode(s));
>
> // s - is the received string // now
> you have the initial object Good luck
> again.
>
Re: how to send a complex object via SOAP
Posted by Olivier Brand <ol...@intraware.com>.
Sure you can reduce the size by creating a GZIPOutputStream. Then encode
with Base64.
Olivier
Mahendra Babu wrote:
> Hi Florin, I was able to serialize and de-serialize successfully.
> Thanks for all your inputs. One thing I observed was that
> Base64.encode() and Base64.decode() functions seemto consume a lot of
> time. Are there an any other alternate encoding methods available? Is
> it possible to compress the byte array before encoding? so that I
> would be able to reducethe payload. Thanks once again. -Mahendra
> Babu
>
> soap.jarorg.apache.soap.encoding.soapenc.Base64
>
> ----- Original Message -----
> From: Mahendra Babu
> To: Florin Moldovan
> Sent: Thursday, February 08, 2001 6:24 PM
> Subject: Re: how to send a complex object via SOAP
> Hi Florin, Could you please point me where I
> could get the Base64 class. It seemsthat it is not
> a part of core Java. Thanks,Mahendra Babu
>
> Hi Mahendra, Let it be a class for
> serialization/deserialization: public
> class ObjectSerializerDeserializer {
> public static byte[]
> serialize(Object obj){ // like
> you said }
> public static Object
> deserialize(byte deser[]){ // the
> reversed task }
> } Client side: ComplexObject co = new
> ComplexObject(......);
> String s=
> Base64.encode(ObjectSerializerDeserializer.serialize(co));
>
> // send the string s via SOAP Server
> side: ComplexObject co =
> (ComplexObject)ObjectSerializerDeserializer.deserialize(Base64.decode(s));
>
> // s - is the received string // now
> you have the initial object Good luck
> again.
>
Re: how to send a complex object via SOAP
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi Florin,
I was able to serialize and de-serialize successfully. Thanks for all your inputs.
One thing I observed was that Base64.encode() and Base64.decode() functions seem
to consume a lot of time. Are there an any other alternate encoding methods available?
Is it possible to compress the byte array before encoding? so that I would be able to reduce
the payload.
Thanks once again.
-Mahendra Babu
soap.jar
org.apache.soap.encoding.soapenc.Base64
----- Original Message -----
From: Mahendra Babu
To: Florin Moldovan
Sent: Thursday, February 08, 2001 6:24 PM
Subject: Re: how to send a complex object via SOAP
Hi Florin,
Could you please point me where I could get the Base64 class. It seems
that it is not a part of core Java.
Thanks,
Mahendra Babu
Hi Mahendra,
Let it be a class for serialization/deserialization:
public class ObjectSerializerDeserializer {
public static byte[] serialize(Object obj){
// like you said
}
public static Object deserialize(byte deser[]){
// the reversed task
}
}
Client side:
ComplexObject co = new ComplexObject(......);
String s= Base64.encode(ObjectSerializerDeserializer.serialize(co));
// send the string s via SOAP
Server side:
ComplexObject co = (ComplexObject)ObjectSerializerDeserializer.deserialize(Base64.decode(s));
// s - is the received string
// now you have the initial object
Good luck again.
Re: how to send a complex object via SOAP
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi Florin,
I was able to serialize and de-serialize successfully. Thanks for all your inputs.
One thing I observed was that Base64.encode() and Base64.decode() functions seem
to consume a lot of time. Are there an any other alternate encoding methods available?
Is it possible to compress the byte array before encoding? so that I would be able to reduce
the payload.
Thanks once again.
-Mahendra Babu
soap.jar
org.apache.soap.encoding.soapenc.Base64
----- Original Message -----
From: Mahendra Babu
To: Florin Moldovan
Sent: Thursday, February 08, 2001 6:24 PM
Subject: Re: how to send a complex object via SOAP
Hi Florin,
Could you please point me where I could get the Base64 class. It seems
that it is not a part of core Java.
Thanks,
Mahendra Babu
Hi Mahendra,
Let it be a class for serialization/deserialization:
public class ObjectSerializerDeserializer {
public static byte[] serialize(Object obj){
// like you said
}
public static Object deserialize(byte deser[]){
// the reversed task
}
}
Client side:
ComplexObject co = new ComplexObject(......);
String s= Base64.encode(ObjectSerializerDeserializer.serialize(co));
// send the string s via SOAP
Server side:
ComplexObject co = (ComplexObject)ObjectSerializerDeserializer.deserialize(Base64.decode(s));
// s - is the received string
// now you have the initial object
Good luck again.
Re: I send a complex object via SOAP
Posted by Florin Moldovan <fl...@art-net.ro>.
Hi Mahendra,
I have some suggestions for you:
FacetData faceData = (FacetData) src;
String fdata = faceData.format().toString();
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
ObjectOutputStream oos = new ObjectOutputStream (baos);
oos.writeObject (faceData);
oos.flush();
// String fdata = baos.toString();
You must encode the byte array and not to transform it into String. You can use the Base64.encode methode.
oos.close();
baos.close();
System.out.println("marshalled string = "+ fdata);
sink.write(fdata);
sink.write("</" + context + '>');
On the client side you have to decode the String into byte array and deserialize the byte array in your object.
Good luck.
Re: I send a complex object via SOAP
Posted by Florin Moldovan <fl...@art-net.ro>.
Hi Mahendra,
I have some suggestions for you:
FacetData faceData = (FacetData) src;
String fdata = faceData.format().toString();
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
ObjectOutputStream oos = new ObjectOutputStream (baos);
oos.writeObject (faceData);
oos.flush();
// String fdata = baos.toString();
You must encode the byte array and not to transform it into String. You can use the Base64.encode methode.
oos.close();
baos.close();
System.out.println("marshalled string = "+ fdata);
sink.write(fdata);
sink.write("</" + context + '>');
On the client side you have to decode the String into byte array and deserialize the byte array in your object.
Good luck.
Re: I send a complex object via SOAP
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi Florin,
As suggested by you I am using a java serializer not a SOAP serializer on the client side and sending
array of bytes or a string via SOAP. as below.
FacetData faceData = (FacetData) src;
String fdata = faceData.format().toString();
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
ObjectOutputStream oos = new ObjectOutputStream (baos);
oos.writeObject (faceData);
oos.flush();
String fdata = baos.toString();
oos.close();
baos.close();
System.out.println("marshalled string = "+ fdata);
sink.write(fdata);
sink.write("</" + context + '>');
But I get the following exception being thrown.
Could you please explain how you were able to pass an array of bytes.
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found
in the element content of the document.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1056
)
at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
LDocumentScanner.java:644)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1356)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
at org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison
.java:85)
at org.apache.soap.rpc.Call.invoke(Call.java:157)
at MySoapClient.main(MySoapClient.java:54)
SOAPException= SOAP-ENV:Protocol, <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sche
mas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst
ance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getFacetDataResponse xmlns:ns1="urn:demo2:Faceter1" SOAP-ENV:encodingStyle=
"http://schemas.xmlsoap.org/soap/encoding/">
<return xmlns:ns2="urn:xml-soap-faceter" xsi:type="ns2:facetData">┬¼├¡ ♣sr
FacetDatac{ΓÇá├í4PyF☻ ☻I ♦size[
facetArrayt ☻[Dxp ♥ur ☻[D>┬ª┼ƶ┬½cZ▲☻ xp ♥ ?├░ @ </return
>
</ns1:getFacetDataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks in advance,
Mahendra Babu
---
Visit me at: http://www.mahendrab.cjb.net
``I'll tell you what the trick is: What you get is what you actually give away. '' - Tom Maxwell
Hi all,
I succesfully send a complex object using SOAP.
-an object like this:
public class ObjectType{
String s;
Vector v;
AnotherType a;
............
}
The point is to use a java serializer not a SOAP serializer on the client side. Send an array of bytes or a string via SOAP. Then, on the server side use a java deserializer and rebuild the object.
Re: I send a complex object via SOAP
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi Florin,
As suggested by you I am using a java serializer not a SOAP serializer on the client side and sending
array of bytes or a string via SOAP. as below.
FacetData faceData = (FacetData) src;
String fdata = faceData.format().toString();
ByteArrayOutputStream baos = new ByteArrayOutputStream ();
ObjectOutputStream oos = new ObjectOutputStream (baos);
oos.writeObject (faceData);
oos.flush();
String fdata = baos.toString();
oos.close();
baos.close();
System.out.println("marshalled string = "+ fdata);
sink.write(fdata);
sink.write("</" + context + '>');
But I get the following exception being thrown.
Could you please explain how you were able to pass an array of bytes.
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x0) was found
in the element content of the document.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1056
)
at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
LDocumentScanner.java:644)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1356)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:948)
at org.apache.soap.util.xml.XercesParserLiaison.read(XercesParserLiaison
.java:85)
at org.apache.soap.rpc.Call.invoke(Call.java:157)
at MySoapClient.main(MySoapClient.java:54)
SOAPException= SOAP-ENV:Protocol, <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sche
mas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-inst
ance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:getFacetDataResponse xmlns:ns1="urn:demo2:Faceter1" SOAP-ENV:encodingStyle=
"http://schemas.xmlsoap.org/soap/encoding/">
<return xmlns:ns2="urn:xml-soap-faceter" xsi:type="ns2:facetData">┬¼├¡ ♣sr
FacetDatac{ΓÇá├í4PyF☻ ☻I ♦size[
facetArrayt ☻[Dxp ♥ur ☻[D>┬ª┼ƶ┬½cZ▲☻ xp ♥ ?├░ @ </return
>
</ns1:getFacetDataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Thanks in advance,
Mahendra Babu
---
Visit me at: http://www.mahendrab.cjb.net
``I'll tell you what the trick is: What you get is what you actually give away. '' - Tom Maxwell
Hi all,
I succesfully send a complex object using SOAP.
-an object like this:
public class ObjectType{
String s;
Vector v;
AnotherType a;
............
}
The point is to use a java serializer not a SOAP serializer on the client side. Send an array of bytes or a string via SOAP. Then, on the server side use a java deserializer and rebuild the object.
Re: Help ..
Posted by George I Matkovits <ma...@uswest.net>.
JSWDK will not work with Soap, please start using Tomcat.
Regards - George
Shashikant Sonawane wrote:
> Hi All,
> Can anybody please tell me how do I install and test
> the sample examples using the JSWDK.
>
> thanks
> Shashi
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
Re: Help ..
Posted by George I Matkovits <ma...@uswest.net>.
JSWDK will not work with Soap, please start using Tomcat.
Regards - George
Shashikant Sonawane wrote:
> Hi All,
> Can anybody please tell me how do I install and test
> the sample examples using the JSWDK.
>
> thanks
> Shashi
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
Help ..
Posted by Shashikant Sonawane <sh...@yahoo.com>.
Hi All,
Can anybody please tell me how do I install and test
the sample examples using the JSWDK.
thanks
Shashi
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
Re: I send a complex object via SOAP
Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Florin- the approach of doing Java serialization to send complex
types works only if u r doing Java-Java and you're in charge of
both sides to know that this particular byte array should be
viewed as a serialized object. In that case you're using SOAP
basically as a way to tunnel RMI in XML carried over
HTTP/<whatever you're carrying your SOAP on>.
Is that what you want? Yes, you can do it, but totally Java-Java
only.
Apache SOAP fully suports arbitrary complex types. If you look
at the addressbook sample you'll see a Java type called Address
which contains another complex type called PhoneNumber and you'll
see how to use the BeanSerializer to do the work of carrying this
from A to B in an interoperable way.
Sanjiva.
----- Original Message -----
From: "craig mclaughlin" <cp...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Wednesday, February 07, 2001 9:52 AM
Subject: Re: I send a complex object via SOAP
> Hello Florin.
>
> Congrats! I am in the process of developing a similar
> prototype. I was wondering if you would be willing to
> forward the client and server .java files...I could
> certainly use the help!
>
> Thanks,
> Craig McLaughlin
>
>
> --- Florin Moldovan <fl...@art-net.ro> wrote:
> > Hi all,
> >
> > I succesfully send a complex object using SOAP.
> > -an object like this:
> >
> > public class ObjectType{
> >
> > String s;
> > Vector v;
> > AnotherType a;
> > ............
> > }
> >
> > The point is to use a java serializer not a SOAP
> > serializer on the client side. Send an array of
> > bytes or a string via SOAP. Then, on the server side
> > use a java deserializer and rebuild the object.
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
Re: I send a complex object via SOAP
Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
Florin- the approach of doing Java serialization to send complex
types works only if u r doing Java-Java and you're in charge of
both sides to know that this particular byte array should be
viewed as a serialized object. In that case you're using SOAP
basically as a way to tunnel RMI in XML carried over
HTTP/<whatever you're carrying your SOAP on>.
Is that what you want? Yes, you can do it, but totally Java-Java
only.
Apache SOAP fully suports arbitrary complex types. If you look
at the addressbook sample you'll see a Java type called Address
which contains another complex type called PhoneNumber and you'll
see how to use the BeanSerializer to do the work of carrying this
from A to B in an interoperable way.
Sanjiva.
----- Original Message -----
From: "craig mclaughlin" <cp...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Wednesday, February 07, 2001 9:52 AM
Subject: Re: I send a complex object via SOAP
> Hello Florin.
>
> Congrats! I am in the process of developing a similar
> prototype. I was wondering if you would be willing to
> forward the client and server .java files...I could
> certainly use the help!
>
> Thanks,
> Craig McLaughlin
>
>
> --- Florin Moldovan <fl...@art-net.ro> wrote:
> > Hi all,
> >
> > I succesfully send a complex object using SOAP.
> > -an object like this:
> >
> > public class ObjectType{
> >
> > String s;
> > Vector v;
> > AnotherType a;
> > ............
> > }
> >
> > The point is to use a java serializer not a SOAP
> > serializer on the client side. Send an array of
> > bytes or a string via SOAP. Then, on the server side
> > use a java deserializer and rebuild the object.
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
Re: I send a complex object via SOAP
Posted by craig mclaughlin <cp...@yahoo.com>.
Hello Florin.
Congrats! I am in the process of developing a similar
prototype. I was wondering if you would be willing to
forward the client and server .java files...I could
certainly use the help!
Thanks,
Craig McLaughlin
--- Florin Moldovan <fl...@art-net.ro> wrote:
> Hi all,
>
> I succesfully send a complex object using SOAP.
> -an object like this:
>
> public class ObjectType{
>
> String s;
> Vector v;
> AnotherType a;
> ............
> }
>
> The point is to use a java serializer not a SOAP
> serializer on the client side. Send an array of
> bytes or a string via SOAP. Then, on the server side
> use a java deserializer and rebuild the object.
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
Help ..
Posted by Shashikant Sonawane <sh...@yahoo.com>.
Hi All,
Can anybody please tell me how do I install and test
the sample examples using the JSWDK.
thanks
Shashi
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
Re: I send a complex object via SOAP
Posted by craig mclaughlin <cp...@yahoo.com>.
Hello Florin.
Congrats! I am in the process of developing a similar
prototype. I was wondering if you would be willing to
forward the client and server .java files...I could
certainly use the help!
Thanks,
Craig McLaughlin
--- Florin Moldovan <fl...@art-net.ro> wrote:
> Hi all,
>
> I succesfully send a complex object using SOAP.
> -an object like this:
>
> public class ObjectType{
>
> String s;
> Vector v;
> AnotherType a;
> ............
> }
>
> The point is to use a java serializer not a SOAP
> serializer on the client side. Send an array of
> bytes or a string via SOAP. Then, on the server side
> use a java deserializer and rebuild the object.
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/