You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Eric Borisow <eb...@yahoo.com> on 2010/07/21 19:18:45 UTC

Question about using byte array

Hi,

I am trying to pass an LDAP cookie in a byte array from my web service using Axis2 1.4.1.  In my wsdl, I have this entry:

<xs:element maxOccurs="unbounded" minOccurs="0" name="cookie" nillable="true" type="xs:byte"/>

Using ADB, a setCookie method is generated for me that takes a byte array as a parameter.  I pass in the byte array directly from the LDAP code.  It all looks good when the message is going out.

In the output from the call, I see a bunch of <cookie> elements in the XML getting returned from the service.

On the client-side, I am once again using ADB which provides a getCookie method to retrieve the byte array.  I output the value by using the toString method.

The problem is that the byte array on the way out of the service is not matching the byte array that is coming into the client.  I've compared the individual values that are in the array between server and client and it does look different.  Most notably, it looks like some empty elements appear in the service output that are not there when debugged on the server side.  As a result, when I try to pass the array back for the next call, it fails.

Hopefully, there is a simple answer to this.  Any help is appreciated.

Thanks,
Eric


      

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Question about using byte array

Posted by eb...@yahoo.com.
Hi Andreas,

Thanks!  That worked.

Regards,
Eric
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Eric Borisow <eb...@yahoo.com>
Date: Wed, 21 Jul 2010 11:16:14 
To: <ja...@axis.apache.org>
Reply-To: java-user@axis.apache.org
Subject: Re: Question about using byte array

Thanks Andreas, let me try that.

Eric

--- On Wed, 7/21/10, Andreas Veithen <an...@gmail.com> wrote:

> From: Andreas Veithen <an...@gmail.com>
> Subject: Re: Question about using byte array
> To: java-user@axis.apache.org
> Date: Wednesday, July 21, 2010, 1:28 PM
> On Wed, Jul 21, 2010 at 19:18, Eric
> Borisow <eb...@yahoo.com>
> wrote:
> > Hi,
> >
> > I am trying to pass an LDAP cookie in a byte array
> from my web service using Axis2 1.4.1.  In my wsdl, I have
> this entry:
> >
> > <xs:element maxOccurs="unbounded" minOccurs="0"
> name="cookie" nillable="true" type="xs:byte"/>
> 
> That is not a good way to model binary data. A much better
> way is to
> use a single instance of xsd:base64Binary.
> 
> > Using ADB, a setCookie method is generated for me that
> takes a byte array as a parameter.  I pass in the byte
> array directly from the LDAP code.  It all looks good when
> the message is going out.
> >
> > In the output from the call, I see a bunch of
> <cookie> elements in the XML getting returned from the
> service.
> >
> > On the client-side, I am once again using ADB which
> provides a getCookie method to retrieve the byte array.  I
> output the value by using the toString method.
> >
> > The problem is that the byte array on the way out of
> the service is not matching the byte array that is coming
> into the client.  I've compared the individual values that
> are in the array between server and client and it does look
> different.  Most notably, it looks like some empty elements
> appear in the service output that are not there when
> debugged on the server side.  As a result, when I try to
> pass the array back for the next call, it fails.
> >
> > Hopefully, there is a simple answer to this.  Any
> help is appreciated.
> >
> > Thanks,
> > Eric
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> > For additional commands, e-mail: java-user-help@axis.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Question about using byte array

Posted by Eric Borisow <eb...@yahoo.com>.
Thanks Andreas, let me try that.

Eric

--- On Wed, 7/21/10, Andreas Veithen <an...@gmail.com> wrote:

> From: Andreas Veithen <an...@gmail.com>
> Subject: Re: Question about using byte array
> To: java-user@axis.apache.org
> Date: Wednesday, July 21, 2010, 1:28 PM
> On Wed, Jul 21, 2010 at 19:18, Eric
> Borisow <eb...@yahoo.com>
> wrote:
> > Hi,
> >
> > I am trying to pass an LDAP cookie in a byte array
> from my web service using Axis2 1.4.1.  In my wsdl, I have
> this entry:
> >
> > <xs:element maxOccurs="unbounded" minOccurs="0"
> name="cookie" nillable="true" type="xs:byte"/>
> 
> That is not a good way to model binary data. A much better
> way is to
> use a single instance of xsd:base64Binary.
> 
> > Using ADB, a setCookie method is generated for me that
> takes a byte array as a parameter.  I pass in the byte
> array directly from the LDAP code.  It all looks good when
> the message is going out.
> >
> > In the output from the call, I see a bunch of
> <cookie> elements in the XML getting returned from the
> service.
> >
> > On the client-side, I am once again using ADB which
> provides a getCookie method to retrieve the byte array.  I
> output the value by using the toString method.
> >
> > The problem is that the byte array on the way out of
> the service is not matching the byte array that is coming
> into the client.  I've compared the individual values that
> are in the array between server and client and it does look
> different.  Most notably, it looks like some empty elements
> appear in the service output that are not there when
> debugged on the server side.  As a result, when I try to
> pass the array back for the next call, it fails.
> >
> > Hopefully, there is a simple answer to this.  Any
> help is appreciated.
> >
> > Thanks,
> > Eric
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> > For additional commands, e-mail: java-user-help@axis.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Question about using byte array

Posted by Andreas Veithen <an...@gmail.com>.
On Wed, Jul 21, 2010 at 19:18, Eric Borisow <eb...@yahoo.com> wrote:
> Hi,
>
> I am trying to pass an LDAP cookie in a byte array from my web service using Axis2 1.4.1.  In my wsdl, I have this entry:
>
> <xs:element maxOccurs="unbounded" minOccurs="0" name="cookie" nillable="true" type="xs:byte"/>

That is not a good way to model binary data. A much better way is to
use a single instance of xsd:base64Binary.

> Using ADB, a setCookie method is generated for me that takes a byte array as a parameter.  I pass in the byte array directly from the LDAP code.  It all looks good when the message is going out.
>
> In the output from the call, I see a bunch of <cookie> elements in the XML getting returned from the service.
>
> On the client-side, I am once again using ADB which provides a getCookie method to retrieve the byte array.  I output the value by using the toString method.
>
> The problem is that the byte array on the way out of the service is not matching the byte array that is coming into the client.  I've compared the individual values that are in the array between server and client and it does look different.  Most notably, it looks like some empty elements appear in the service output that are not there when debugged on the server side.  As a result, when I try to pass the array back for the next call, it fails.
>
> Hopefully, there is a simple answer to this.  Any help is appreciated.
>
> Thanks,
> Eric
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Question about using byte array

Posted by Eric Borisow <eb...@yahoo.com>.
A little more information about the difference in the byte array.

On the service side, the first value is:

0

On the client side, the values are:

<space>
<space>
<space>
<space>
<space>
1
0

From there until line 201, all of the values are the same.  Then, on line 201, the server side has:

-128

and the client side has an empty space.

Other than that, the other 500 lines are the same.  Any ideas?

Thanks,
Eric


--- On Wed, 7/21/10, Eric Borisow <eb...@yahoo.com> wrote:

> From: Eric Borisow <eb...@yahoo.com>
> Subject: Question about using byte array
> To: java-user@axis.apache.org
> Date: Wednesday, July 21, 2010, 1:18 PM
> Hi,
> 
> I am trying to pass an LDAP cookie in a byte array from my
> web service using Axis2 1.4.1.  In my wsdl, I have this
> entry:
> 
> <xs:element maxOccurs="unbounded" minOccurs="0"
> name="cookie" nillable="true" type="xs:byte"/>
> 
> Using ADB, a setCookie method is generated for me that
> takes a byte array as a parameter.  I pass in the byte
> array directly from the LDAP code.  It all looks good
> when the message is going out.
> 
> In the output from the call, I see a bunch of
> <cookie> elements in the XML getting returned from the
> service.
> 
> On the client-side, I am once again using ADB which
> provides a getCookie method to retrieve the byte
> array.  I output the value by using the toString
> method.
> 
> The problem is that the byte array on the way out of the
> service is not matching the byte array that is coming into
> the client.  I've compared the individual values that
> are in the array between server and client and it does look
> different.  Most notably, it looks like some empty
> elements appear in the service output that are not there
> when debugged on the server side.  As a result, when I
> try to pass the array back for the next call, it fails.
> 
> Hopefully, there is a simple answer to this.  Any help
> is appreciated.
> 
> Thanks,
> Eric
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org