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 Mark DeVries <de...@xyenterprise.com> on 2002/07/22 16:36:10 UTC

base64Binary [was: data confusion with base64 return from SOAP::Lite]

Following up on leads from Martin Gainty and things we found from running a SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP client to SOAP 2.3.  We now converse using the 2001 XML schema and the base64Binary datatype.  When the client sets 2001 as the version to use, the server sticks to it.  I'm still getting the same result, though:

The SOAP response below makes sense when dumped as an Object with:
    response.getBodyPart(0).getContent().toString()
and when parsed with org.w3c.dom.Node methods.  But:
    response.getReturnValue().getType().toString returns "class [B" and
    response.getReturnValue().getValue().toString() returns "[B@361fd1".

With a different service call that returns the same structural pattern but a Body element of type String, getType() and getValue() return "java.lang.String" and the ASCII value of the string, respectively.

Is there something I'm overlooking in the routines to access the response?

Here's that SOAP response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:namesp2="http://namespaces.soaplite.com/perl"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <SOAP-ENV:Header>
  <namesp219:MD__Graphic
   xmlns:namesp219="http://namespaces.soaplite.com/header"
   xsi:type="namesp2:MD__Graphic">
   <_graphic xsi:type="xsd:string">default</_graphic>
  </namesp219:MD__Graphic>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
   <name xsi:type="xsd:base64Binary">
    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
   </name>
  </namesp220:getgraphicResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>"

--
*****  Mark.DeVries@xyenterprise.com
****  Xyvision Enterprise Solutions 781-756-5303
***  30 New Crossing Road, Reading MA 01867 USA



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Mark DeVries <de...@xyenterprise.com>.
Erich,

Aha -- success!  Adapting your example slightly,

  String b64 = new String( (byte[]) response.getReturnValue().getValue() );

gave me the reconstructed data I was looking for.  Thanks a bunch!

-Mark
____________________

At 07/23/2002 11:04, Erich Izdepski wrote:
>Mark-
>you just need to know what the object type the service is returning, based
>on its WSDL or other info about it. If you do look at the soap response xml
>you could see the type argument, i.e., xsi:type="xsd:base64Binary". The soap
>api can show you this response, but I can't say exactly where (I just use
>the high-level API).
>
>In your case, cast the response to a byte[] and then decode the data in the
>array. To get the data as a String you could do this:
>
>String b64 = new String(((byte[])response.getReturnValue()));
>
>Just calling toString on the response object does what you guessed.
>
>Just so you know, all the primitive java types have class names. B- byte,
>I-int, F-float, and so on. [B or [I just makes it an array. Be careful- if
>it is [B; that is a Byte object array, not a byte primitive array.
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Tuesday, July 23, 2002 10:54 AM
>To: soap-user@xml.apache.org
>Subject: RE: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Erich,
>
>So "[B" is the name of a real class?  That's certainly a point I missed!
>But haven't I lost some critical information?  If [B means it's a binary
>array, where do I get the information that it's base64 encoded?
>
>When I look at the XML, the data starts this way:
>	JSFQUy1BZG9iZS0...
>
>When I getReturnValue(), the data via .toString() is reported this way:
>	[B@361fd1
>(Is that really the datatype [B and an address or offset?)
>
>The original data file starts this way:
>	%!PS-Adobe-2.0 EPSF-1.0
>
>How do I transform the return value to get the original form of the data
>back?  Where might I read and learn?  I can't find "[B" class in any books
>or javadocs.
>
>(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite
>server, although at some point I'll want to send it, too.)
>
>Thanks for all your help.
>-Mark
>
>At 07/23/2002 09:45, Erich Izdepski wrote:
>>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>>with SOAP:Lite and pass base 64 data. The client could send data as either
>a
>>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>>schema. You have a byte primitive array ([B). You can cast the response
>>object to a byte[].
>>
>>byte[] bytes = (byte[])response.getReturnValue();
>>
>>Erich Izdepski
>>Senior Software Engineer
>>Cysive, Inc.
>>
>>
>>-----Original Message-----
>>From: Mark DeVries [mailto:devries@xyenterprise.com]
>>Sent: Monday, July 22, 2002 10:36 AM
>>To: soap-user@xml.apache.org
>>Subject: base64Binary [was: data confusion with base64 return from
>>SOAP::Lite]
>>
>>
>>Following up on leads from Martin Gainty and things we found from running a
>>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>>base64Binary datatype.  When the client sets 2001 as the version to use,
>the
>>server sticks to it.  I'm still getting the same result, though:
>>
>>The SOAP response below makes sense when dumped as an Object with:
>>    response.getBodyPart(0).getContent().toString()
>>and when parsed with org.w3c.dom.Node methods.  But:
>>    response.getReturnValue().getType().toString returns "class [B" and
>>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>>
>>With a different service call that returns the same structural pattern but
>a
>>Body element of type String, getType() and getValue() return
>>"java.lang.String" and the ASCII value of the string, respectively.
>>
>>Is there something I'm overlooking in the routines to access the response?
>>
>>Here's that SOAP response:
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><SOAP-ENV:Envelope
>> xmlns:namesp2="http://namespaces.soaplite.com/perl"
>> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>> <SOAP-ENV:Header>
>>  <namesp219:MD__Graphic
>>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>>   xsi:type="namesp2:MD__Graphic">
>>   <_graphic xsi:type="xsd:string">default</_graphic>
>>  </namesp219:MD__Graphic>
>> </SOAP-ENV:Header>
>> <SOAP-ENV:Body>
>>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>>   <name xsi:type="xsd:base64Binary">
>>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>>   </name>
>>  </namesp220:getgraphicResponse>
>> </SOAP-ENV:Body>
>></SOAP-ENV:Envelope>"
>>
>>--
>>*****  Mark.DeVries@xyenterprise.com
>>****  Xyvision Enterprise Solutions 781-756-5303
>>***  30 New Crossing Road, Reading MA 01867 USA
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>>For additional commands, e-mail: <ma...@xml.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Mark DeVries <de...@xyenterprise.com>.
Erich,

Aha -- success!  Adapting your example slightly,

  String b64 = new String( (byte[]) response.getReturnValue().getValue() );

gave me the reconstructed data I was looking for.  Thanks a bunch!

-Mark
____________________

At 07/23/2002 11:04, Erich Izdepski wrote:
>Mark-
>you just need to know what the object type the service is returning, based
>on its WSDL or other info about it. If you do look at the soap response xml
>you could see the type argument, i.e., xsi:type="xsd:base64Binary". The soap
>api can show you this response, but I can't say exactly where (I just use
>the high-level API).
>
>In your case, cast the response to a byte[] and then decode the data in the
>array. To get the data as a String you could do this:
>
>String b64 = new String(((byte[])response.getReturnValue()));
>
>Just calling toString on the response object does what you guessed.
>
>Just so you know, all the primitive java types have class names. B- byte,
>I-int, F-float, and so on. [B or [I just makes it an array. Be careful- if
>it is [B; that is a Byte object array, not a byte primitive array.
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Tuesday, July 23, 2002 10:54 AM
>To: soap-user@xml.apache.org
>Subject: RE: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Erich,
>
>So "[B" is the name of a real class?  That's certainly a point I missed!
>But haven't I lost some critical information?  If [B means it's a binary
>array, where do I get the information that it's base64 encoded?
>
>When I look at the XML, the data starts this way:
>	JSFQUy1BZG9iZS0...
>
>When I getReturnValue(), the data via .toString() is reported this way:
>	[B@361fd1
>(Is that really the datatype [B and an address or offset?)
>
>The original data file starts this way:
>	%!PS-Adobe-2.0 EPSF-1.0
>
>How do I transform the return value to get the original form of the data
>back?  Where might I read and learn?  I can't find "[B" class in any books
>or javadocs.
>
>(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite
>server, although at some point I'll want to send it, too.)
>
>Thanks for all your help.
>-Mark
>
>At 07/23/2002 09:45, Erich Izdepski wrote:
>>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>>with SOAP:Lite and pass base 64 data. The client could send data as either
>a
>>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>>schema. You have a byte primitive array ([B). You can cast the response
>>object to a byte[].
>>
>>byte[] bytes = (byte[])response.getReturnValue();
>>
>>Erich Izdepski
>>Senior Software Engineer
>>Cysive, Inc.
>>
>>
>>-----Original Message-----
>>From: Mark DeVries [mailto:devries@xyenterprise.com]
>>Sent: Monday, July 22, 2002 10:36 AM
>>To: soap-user@xml.apache.org
>>Subject: base64Binary [was: data confusion with base64 return from
>>SOAP::Lite]
>>
>>
>>Following up on leads from Martin Gainty and things we found from running a
>>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>>base64Binary datatype.  When the client sets 2001 as the version to use,
>the
>>server sticks to it.  I'm still getting the same result, though:
>>
>>The SOAP response below makes sense when dumped as an Object with:
>>    response.getBodyPart(0).getContent().toString()
>>and when parsed with org.w3c.dom.Node methods.  But:
>>    response.getReturnValue().getType().toString returns "class [B" and
>>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>>
>>With a different service call that returns the same structural pattern but
>a
>>Body element of type String, getType() and getValue() return
>>"java.lang.String" and the ASCII value of the string, respectively.
>>
>>Is there something I'm overlooking in the routines to access the response?
>>
>>Here's that SOAP response:
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><SOAP-ENV:Envelope
>> xmlns:namesp2="http://namespaces.soaplite.com/perl"
>> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>> <SOAP-ENV:Header>
>>  <namesp219:MD__Graphic
>>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>>   xsi:type="namesp2:MD__Graphic">
>>   <_graphic xsi:type="xsd:string">default</_graphic>
>>  </namesp219:MD__Graphic>
>> </SOAP-ENV:Header>
>> <SOAP-ENV:Body>
>>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>>   <name xsi:type="xsd:base64Binary">
>>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>>   </name>
>>  </namesp220:getgraphicResponse>
>> </SOAP-ENV:Body>
>></SOAP-ENV:Envelope>"
>>
>>--
>>*****  Mark.DeVries@xyenterprise.com
>>****  Xyvision Enterprise Solutions 781-756-5303
>>***  30 New Crossing Road, Reading MA 01867 USA
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>>For additional commands, e-mail: <ma...@xml.apache.org>
>>
>>
>>--
>>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Erich Izdepski <ei...@cysive.com>.
Mark-
you just need to know what the object type the service is returning, based
on its WSDL or other info about it. If you do look at the soap response xml
you could see the type argument, i.e., xsi:type="xsd:base64Binary". The soap
api can show you this response, but I can't say exactly where (I just use
the high-level API).

In your case, cast the response to a byte[] and then decode the data in the
array. To get the data as a String you could do this:

String b64 = new String(((byte[])response.getReturnValue()));

Just calling toString on the response object does what you guessed.

Just so you know, all the primitive java types have class names. B- byte,
I-int, F-float, and so on. [B or [I just makes it an array. Be careful- if
it is [B; that is a Byte object array, not a byte primitive array.

Erich Izdepski
Senior Software Engineer
Cysive, Inc.


-----Original Message-----
From: Mark DeVries [mailto:devries@xyenterprise.com]
Sent: Tuesday, July 23, 2002 10:54 AM
To: soap-user@xml.apache.org
Subject: RE: base64Binary [was: data confusion with base64 return from
SOAP::Lite]


Erich,

So "[B" is the name of a real class?  That's certainly a point I missed!
But haven't I lost some critical information?  If [B means it's a binary
array, where do I get the information that it's base64 encoded?

When I look at the XML, the data starts this way:
	JSFQUy1BZG9iZS0...

When I getReturnValue(), the data via .toString() is reported this way:
	[B@361fd1
(Is that really the datatype [B and an address or offset?)

The original data file starts this way:
	%!PS-Adobe-2.0 EPSF-1.0

How do I transform the return value to get the original form of the data
back?  Where might I read and learn?  I can't find "[B" class in any books
or javadocs.

(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite
server, although at some point I'll want to send it, too.)

Thanks for all your help.
-Mark

At 07/23/2002 09:45, Erich Izdepski wrote:
>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>with SOAP:Lite and pass base 64 data. The client could send data as either
a
>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>schema. You have a byte primitive array ([B). You can cast the response
>object to a byte[].
>
>byte[] bytes = (byte[])response.getReturnValue();
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Monday, July 22, 2002 10:36 AM
>To: soap-user@xml.apache.org
>Subject: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Following up on leads from Martin Gainty and things we found from running a
>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>base64Binary datatype.  When the client sets 2001 as the version to use,
the
>server sticks to it.  I'm still getting the same result, though:
>
>The SOAP response below makes sense when dumped as an Object with:
>    response.getBodyPart(0).getContent().toString()
>and when parsed with org.w3c.dom.Node methods.  But:
>    response.getReturnValue().getType().toString returns "class [B" and
>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>
>With a different service call that returns the same structural pattern but
a
>Body element of type String, getType() and getValue() return
>"java.lang.String" and the ASCII value of the string, respectively.
>
>Is there something I'm overlooking in the routines to access the response?
>
>Here's that SOAP response:
>
><?xml version="1.0" encoding="UTF-8"?>
><SOAP-ENV:Envelope
> xmlns:namesp2="http://namespaces.soaplite.com/perl"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>  <namesp219:MD__Graphic
>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>   xsi:type="namesp2:MD__Graphic">
>   <_graphic xsi:type="xsd:string">default</_graphic>
>  </namesp219:MD__Graphic>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>   <name xsi:type="xsd:base64Binary">
>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>   </name>
>  </namesp220:getgraphicResponse>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>"
>
>--
>*****  Mark.DeVries@xyenterprise.com
>****  Xyvision Enterprise Solutions 781-756-5303
>***  30 New Crossing Road, Reading MA 01867 USA
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Erich Izdepski <ei...@cysive.com>.
Mark-
you just need to know what the object type the service is returning, based
on its WSDL or other info about it. If you do look at the soap response xml
you could see the type argument, i.e., xsi:type="xsd:base64Binary". The soap
api can show you this response, but I can't say exactly where (I just use
the high-level API).

In your case, cast the response to a byte[] and then decode the data in the
array. To get the data as a String you could do this:

String b64 = new String(((byte[])response.getReturnValue()));

Just calling toString on the response object does what you guessed.

Just so you know, all the primitive java types have class names. B- byte,
I-int, F-float, and so on. [B or [I just makes it an array. Be careful- if
it is [B; that is a Byte object array, not a byte primitive array.

Erich Izdepski
Senior Software Engineer
Cysive, Inc.


-----Original Message-----
From: Mark DeVries [mailto:devries@xyenterprise.com]
Sent: Tuesday, July 23, 2002 10:54 AM
To: soap-user@xml.apache.org
Subject: RE: base64Binary [was: data confusion with base64 return from
SOAP::Lite]


Erich,

So "[B" is the name of a real class?  That's certainly a point I missed!
But haven't I lost some critical information?  If [B means it's a binary
array, where do I get the information that it's base64 encoded?

When I look at the XML, the data starts this way:
	JSFQUy1BZG9iZS0...

When I getReturnValue(), the data via .toString() is reported this way:
	[B@361fd1
(Is that really the datatype [B and an address or offset?)

The original data file starts this way:
	%!PS-Adobe-2.0 EPSF-1.0

How do I transform the return value to get the original form of the data
back?  Where might I read and learn?  I can't find "[B" class in any books
or javadocs.

(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite
server, although at some point I'll want to send it, too.)

Thanks for all your help.
-Mark

At 07/23/2002 09:45, Erich Izdepski wrote:
>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>with SOAP:Lite and pass base 64 data. The client could send data as either
a
>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>schema. You have a byte primitive array ([B). You can cast the response
>object to a byte[].
>
>byte[] bytes = (byte[])response.getReturnValue();
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Monday, July 22, 2002 10:36 AM
>To: soap-user@xml.apache.org
>Subject: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Following up on leads from Martin Gainty and things we found from running a
>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>base64Binary datatype.  When the client sets 2001 as the version to use,
the
>server sticks to it.  I'm still getting the same result, though:
>
>The SOAP response below makes sense when dumped as an Object with:
>    response.getBodyPart(0).getContent().toString()
>and when parsed with org.w3c.dom.Node methods.  But:
>    response.getReturnValue().getType().toString returns "class [B" and
>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>
>With a different service call that returns the same structural pattern but
a
>Body element of type String, getType() and getValue() return
>"java.lang.String" and the ASCII value of the string, respectively.
>
>Is there something I'm overlooking in the routines to access the response?
>
>Here's that SOAP response:
>
><?xml version="1.0" encoding="UTF-8"?>
><SOAP-ENV:Envelope
> xmlns:namesp2="http://namespaces.soaplite.com/perl"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>  <namesp219:MD__Graphic
>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>   xsi:type="namesp2:MD__Graphic">
>   <_graphic xsi:type="xsd:string">default</_graphic>
>  </namesp219:MD__Graphic>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>   <name xsi:type="xsd:base64Binary">
>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>   </name>
>  </namesp220:getgraphicResponse>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>"
>
>--
>*****  Mark.DeVries@xyenterprise.com
>****  Xyvision Enterprise Solutions 781-756-5303
>***  30 New Crossing Road, Reading MA 01867 USA
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Mark DeVries <de...@xyenterprise.com>.
Erich,

So "[B" is the name of a real class?  That's certainly a point I missed!  But haven't I lost some critical information?  If [B means it's a binary array, where do I get the information that it's base64 encoded?

When I look at the XML, the data starts this way:
	JSFQUy1BZG9iZS0...

When I getReturnValue(), the data via .toString() is reported this way:
	[B@361fd1
(Is that really the datatype [B and an address or offset?)

The original data file starts this way:
	%!PS-Adobe-2.0 EPSF-1.0

How do I transform the return value to get the original form of the data back?  Where might I read and learn?  I can't find "[B" class in any books or javadocs.

(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite server, although at some point I'll want to send it, too.)

Thanks for all your help.
-Mark

At 07/23/2002 09:45, Erich Izdepski wrote:
>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>with SOAP:Lite and pass base 64 data. The client could send data as either a
>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>schema. You have a byte primitive array ([B). You can cast the response
>object to a byte[].
>
>byte[] bytes = (byte[])response.getReturnValue();
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Monday, July 22, 2002 10:36 AM
>To: soap-user@xml.apache.org
>Subject: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Following up on leads from Martin Gainty and things we found from running a
>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>base64Binary datatype.  When the client sets 2001 as the version to use, the
>server sticks to it.  I'm still getting the same result, though:
>
>The SOAP response below makes sense when dumped as an Object with:
>    response.getBodyPart(0).getContent().toString()
>and when parsed with org.w3c.dom.Node methods.  But:
>    response.getReturnValue().getType().toString returns "class [B" and
>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>
>With a different service call that returns the same structural pattern but a
>Body element of type String, getType() and getValue() return
>"java.lang.String" and the ASCII value of the string, respectively.
>
>Is there something I'm overlooking in the routines to access the response?
>
>Here's that SOAP response:
>
><?xml version="1.0" encoding="UTF-8"?>
><SOAP-ENV:Envelope
> xmlns:namesp2="http://namespaces.soaplite.com/perl"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>  <namesp219:MD__Graphic
>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>   xsi:type="namesp2:MD__Graphic">
>   <_graphic xsi:type="xsd:string">default</_graphic>
>  </namesp219:MD__Graphic>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>   <name xsi:type="xsd:base64Binary">
>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>   </name>
>  </namesp220:getgraphicResponse>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>"
>
>--
>*****  Mark.DeVries@xyenterprise.com
>****  Xyvision Enterprise Solutions 781-756-5303
>***  30 New Crossing Road, Reading MA 01867 USA
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Mark DeVries <de...@xyenterprise.com>.
Erich,

So "[B" is the name of a real class?  That's certainly a point I missed!  But haven't I lost some critical information?  If [B means it's a binary array, where do I get the information that it's base64 encoded?

When I look at the XML, the data starts this way:
	JSFQUy1BZG9iZS0...

When I getReturnValue(), the data via .toString() is reported this way:
	[B@361fd1
(Is that really the datatype [B and an address or offset?)

The original data file starts this way:
	%!PS-Adobe-2.0 EPSF-1.0

How do I transform the return value to get the original form of the data back?  Where might I read and learn?  I can't find "[B" class in any books or javadocs.

(At the moment I'm concentrating on receiving base 64 data from a SOAP::Lite server, although at some point I'll want to send it, too.)

Thanks for all your help.
-Mark

At 07/23/2002 09:45, Erich Izdepski wrote:
>I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
>with SOAP:Lite and pass base 64 data. The client could send data as either a
>byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
>schema. You have a byte primitive array ([B). You can cast the response
>object to a byte[].
>
>byte[] bytes = (byte[])response.getReturnValue();
>
>Erich Izdepski
>Senior Software Engineer
>Cysive, Inc.
>
>
>-----Original Message-----
>From: Mark DeVries [mailto:devries@xyenterprise.com]
>Sent: Monday, July 22, 2002 10:36 AM
>To: soap-user@xml.apache.org
>Subject: base64Binary [was: data confusion with base64 return from
>SOAP::Lite]
>
>
>Following up on leads from Martin Gainty and things we found from running a
>SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
>client to SOAP 2.3.  We now converse using the 2001 XML schema and the
>base64Binary datatype.  When the client sets 2001 as the version to use, the
>server sticks to it.  I'm still getting the same result, though:
>
>The SOAP response below makes sense when dumped as an Object with:
>    response.getBodyPart(0).getContent().toString()
>and when parsed with org.w3c.dom.Node methods.  But:
>    response.getReturnValue().getType().toString returns "class [B" and
>    response.getReturnValue().getValue().toString() returns "[B@361fd1".
>
>With a different service call that returns the same structural pattern but a
>Body element of type String, getType() and getValue() return
>"java.lang.String" and the ASCII value of the string, respectively.
>
>Is there something I'm overlooking in the routines to access the response?
>
>Here's that SOAP response:
>
><?xml version="1.0" encoding="UTF-8"?>
><SOAP-ENV:Envelope
> xmlns:namesp2="http://namespaces.soaplite.com/perl"
> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <SOAP-ENV:Header>
>  <namesp219:MD__Graphic
>   xmlns:namesp219="http://namespaces.soaplite.com/header"
>   xsi:type="namesp2:MD__Graphic">
>   <_graphic xsi:type="xsd:string">default</_graphic>
>  </namesp219:MD__Graphic>
> </SOAP-ENV:Header>
> <SOAP-ENV:Body>
>  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
>   <name xsi:type="xsd:base64Binary">
>    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
>   </name>
>  </namesp220:getgraphicResponse>
> </SOAP-ENV:Body>
></SOAP-ENV:Envelope>"
>
>--
>*****  Mark.DeVries@xyenterprise.com
>****  Xyvision Enterprise Solutions 781-756-5303
>***  30 New Crossing Road, Reading MA 01867 USA
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@xml.apache.org>
>For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Erich Izdepski <ei...@cysive.com>.
I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
with SOAP:Lite and pass base 64 data. The client could send data as either a
byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
schema. You have a byte primitive array ([B). You can cast the response
object to a byte[].

byte[] bytes = (byte[])response.getReturnValue();

Erich Izdepski
Senior Software Engineer
Cysive, Inc.


-----Original Message-----
From: Mark DeVries [mailto:devries@xyenterprise.com]
Sent: Monday, July 22, 2002 10:36 AM
To: soap-user@xml.apache.org
Subject: base64Binary [was: data confusion with base64 return from
SOAP::Lite]


Following up on leads from Martin Gainty and things we found from running a
SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
client to SOAP 2.3.  We now converse using the 2001 XML schema and the
base64Binary datatype.  When the client sets 2001 as the version to use, the
server sticks to it.  I'm still getting the same result, though:

The SOAP response below makes sense when dumped as an Object with:
    response.getBodyPart(0).getContent().toString()
and when parsed with org.w3c.dom.Node methods.  But:
    response.getReturnValue().getType().toString returns "class [B" and
    response.getReturnValue().getValue().toString() returns "[B@361fd1".

With a different service call that returns the same structural pattern but a
Body element of type String, getType() and getValue() return
"java.lang.String" and the ASCII value of the string, respectively.

Is there something I'm overlooking in the routines to access the response?

Here's that SOAP response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:namesp2="http://namespaces.soaplite.com/perl"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <SOAP-ENV:Header>
  <namesp219:MD__Graphic
   xmlns:namesp219="http://namespaces.soaplite.com/header"
   xsi:type="namesp2:MD__Graphic">
   <_graphic xsi:type="xsd:string">default</_graphic>
  </namesp219:MD__Graphic>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
   <name xsi:type="xsd:base64Binary">
    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
   </name>
  </namesp220:getgraphicResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>"

--
*****  Mark.DeVries@xyenterprise.com
****  Xyvision Enterprise Solutions 781-756-5303
***  30 New Crossing Road, Reading MA 01867 USA



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: base64Binary [was: data confusion with base64 return from SOAP::Lite]

Posted by Erich Izdepski <ei...@cysive.com>.
I'm a little late here, but I've use Apache SOAP 2.3 as a client to talk
with SOAP:Lite and pass base 64 data. The client could send data as either a
byte[] or a Byte[] and SOAP:Lite could handle it. This was using the 2001
schema. You have a byte primitive array ([B). You can cast the response
object to a byte[].

byte[] bytes = (byte[])response.getReturnValue();

Erich Izdepski
Senior Software Engineer
Cysive, Inc.


-----Original Message-----
From: Mark DeVries [mailto:devries@xyenterprise.com]
Sent: Monday, July 22, 2002 10:36 AM
To: soap-user@xml.apache.org
Subject: base64Binary [was: data confusion with base64 return from
SOAP::Lite]


Following up on leads from Martin Gainty and things we found from running a
SOAP::Lite client to our SOAP::Lite server, I have upgraded my Apache SOAP
client to SOAP 2.3.  We now converse using the 2001 XML schema and the
base64Binary datatype.  When the client sets 2001 as the version to use, the
server sticks to it.  I'm still getting the same result, though:

The SOAP response below makes sense when dumped as an Object with:
    response.getBodyPart(0).getContent().toString()
and when parsed with org.w3c.dom.Node methods.  But:
    response.getReturnValue().getType().toString returns "class [B" and
    response.getReturnValue().getValue().toString() returns "[B@361fd1".

With a different service call that returns the same structural pattern but a
Body element of type String, getType() and getValue() return
"java.lang.String" and the ASCII value of the string, respectively.

Is there something I'm overlooking in the routines to access the response?

Here's that SOAP response:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:namesp2="http://namespaces.soaplite.com/perl"
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <SOAP-ENV:Header>
  <namesp219:MD__Graphic
   xmlns:namesp219="http://namespaces.soaplite.com/header"
   xsi:type="namesp2:MD__Graphic">
   <_graphic xsi:type="xsd:string">default</_graphic>
  </namesp219:MD__Graphic>
 </SOAP-ENV:Header>
 <SOAP-ENV:Body>
  <namesp220:getgraphicResponse xmlns:namesp220="MD/Graphic">
   <name xsi:type="xsd:base64Binary">
    JSFQUy1BZG9 [..much data deleted..] hoBBQGMkhsBBQGUkgo=
   </name>
  </namesp220:getgraphicResponse>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>"

--
*****  Mark.DeVries@xyenterprise.com
****  Xyvision Enterprise Solutions 781-756-5303
***  30 New Crossing Road, Reading MA 01867 USA



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>