axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Beaujard <thomasbeauj...@yahoo.fr>
Subject Re : Re : Tr : Axis problem returning byteArray
Date Tue, 04 Sep 2007 11:23:39 GMT
Hi

Here is the SOAP-trace:

HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 Date: Tue, 04 Sep 2007 11:10:43 GMT Server:
Apache-Coyote/1.1 Connection: close  

<soapenv:Body>
<GMDSRESPCT xmlns="hhhhhhhhhhhhhhhh">
<CONTENT xsi:type="xsd:byte" xmlns="">37</CONTENT>
<CONTENT xsi:type="xsd:byte" xmlns="">80</CONTENT>
<CONTENT xsi:type="xsd:byte" xmlns="">68</CONTENT>
<CONTENT xsi:type="xsd:byte" xmlns="">70</CONTENT>
<CONTENT xsi:type="xsd:byte" xmlns="">45</CONTENT>
<CONTENT xsi:type="xsd:byte" xmlns="">49</CONTENT
..........
<CONTENT xsi:type="xsd:byte" xmlns="">13</CONTENT>
</GMDSRESPCT></soapenv:Body></soapenv:Envelope>


As you can see the tag CONTENT appears many times with a type byte, whereas it should only
appear once with the type base64binary.
I cannot use the xs:string workaround... do you have any other idea?

Thanks for your help

Thom

----- Message d'origine ----
De : WJ Krpelan <krpelan_wj@yahoo.com>
À : axis-dev@ws.apache.org
Envoyé le : Vendredi, 31 Août 2007, 12h24mn 28s
Objet : Re: Re : Tr : Axis problem returning byteArray

Hi
Could you provice a SOAP-Trace (TCPMon)? Would it look
similar to the one below?
A less than satisfactory workaround, if you control
both sides of the wire, would be to change type to
xs:string and do the conversion within java.
Cheers

POST /axis/CalcArr.jws HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime,
multipart/related, text/*
User-Agent: Axis/1.4
Host: 127.0.0.1:8088
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 334

<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
      <soapenv:Body>
         <Add xmlns="http://tempuri.org/";>
            <i1>ITAMWA==</i1>
            <i2>FxdiAg==</i2>
         </Add>
      </soapenv:Body>
   </soapenv:Envelope>


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie:
JSESSIONID=887A1E5E02B52B88387CAD9B3FEA7F6C;
Path=/axis
Content-Type: text/xml;charset=utf-8
Date: Fri, 31 Aug 2007 10:16:54 GMT
Connection: close

<?xml version="1.0" encoding="utf-8"?>
   <soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
      <soapenv:Body>
         <ns1:AddResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns1="http://tempuri.org/";>
            <AddReturn
xsi:type="xsd:base64Binary">OEduWg==</AddReturn>
         </ns1:AddResponse>
      </soapenv:Body>
   </soapenv:Envelope>


--- Thomas Beaujard <thomasbeaujard@yahoo.fr> wrote:

> Thanks for your answer, I will try to explain my
> problem more precisely:
> In fact, I generated my code from WSDL2java with a
> wsdl file and a xsd file as input. In the xsd file I
> defined the response as being xsd:base64binary.
> Here is the service definition in my
> server-config.wsdd:
>  <service name="DocContent" provider="java:RPC"
> style="document" use="literal">
>   <operation name="getDocument" qname="getDocument"
> returnQName="ns1:GMDSRESPCT"
> returnType="ns1:GMDSRESPCT" soapAction=""
> xmlns:ns1="...">
>    <parameter qname="ns1:GMDSREQCT"
> type="ns1:GMDSREQCT"/>
>    <fault class="com.....messages.GMDSERRCT"
> qname="ns1:GMDSERRCT" type="ns1:GMDSERRCT"/>
>   </operation>
>   <parameter name="allowedMethods"
> value="getDocument"/>
>   <parameter name="typeMappingVersion" value="1.2"/>
>   <parameter name="wsdlPortType"
> value="DocContent"/>
>   <parameter name="className"
>
value="com.....webservice.GetDocumentSoapBindingImpl"/>
>   <parameter name="wsdlServicePort"
> value="DocContent"/>
>   <parameter name="wsdlTargetNamespace"
> value="...."/>
>   <parameter name="wsdlServiceElement"
> value="DocContentService"/>
>   <parameter name="schemaUnqualified"
> value="......"/>
>   <typeMapping
>
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="" qname="ns2:&gt;GMDSREQCT"
>
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:com......messages.GMDSREQCT"
> xmlns:ns2="....."/>
>   <typeMapping
>
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="" qname="ns3:&gt;GMDSRESPCT"
>
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:com.....messages.GMDSRESPCT"
> xmlns:ns3="....."/>
>   <typeMapping
>
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="" qname="ns4:&gt;GMDSERRCT"
>
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:com....messages.GMDSERRCT"
> xmlns:ns4="..."/>
>  </service>
> 
> Here is the class corresponding to the response :
>  public class GMDSRESPCT implements Serializable {
>     private byte[] CONTENT;
>     private 
>     public GMDSRESPCT() {
>     }
> 
>     public GMDSRESPCT(byte[] CONTENT) {
>            this.CONTENT = CONTENT;
>     }
> 
>     public byte[] getCONTENT() {
>         return CONTENT;
>     }
> 
> So the web service should return an object
> GMDSRESPCT. But I get the error and when I use
> tcpmon to see the messages exchanged, I notice that
> the response include <CONTENT> tag for every single
> byte instead of having the array of byte within the
> tag <CONTENT>.
> 
> Hope it's not too messy.
> 
> Cheers
> 
> Thom
> 
> 
> ----- Message d'origine ----
> De : WJ Krpelan <krpelan_wj@yahoo.com>
> À : axis-dev@ws.apache.org
> Envoyé le : Jeudi, 30 Août 2007, 17h18mn 03s
> Objet : Re: Tr : Axis problem returning byteArray
> 
> 
> Hello 
> you can't simply send binary data as on the
> transport
> level its converted to xml, which is basically plain
> text.
> 
> One simple possibility would be to use datatype
> base64binary
> Cheers,
> 
> --- Thomas Beaujard <thomasbeaujard@yahoo.fr> wrote:
> 
> > Hello,
> >  
> > I'm using Axis 1.4.
> > I have a document style web service which returns
> a
> > byteArray (actually a pdf file).
> > When I invoke the web service, I get the following
> > error:
> >  
> > org.apache.axis.encoding.ser.BeanPropertyTarget
> set
> > Could not convert java.lang.Byte to bean field
> > 'CONTENT', type [B
> >  
> > Does anyone have encounter similar problem?
> >  
> > Thanks in advance,
> >  
> > Thom
> > 
> > 
> > 
> > 
> > 
> > 
> >        
> > Ne gardez plus qu'une seule adresse mail ! Copiez
> > vos mails vers Yahoo! Mail 
> > 
> > 
> > 
> > 
> > 
> >      
> >
>
_____________________________________________________________________________
> > 
> > Ne gardez plus qu'une seule adresse mail ! Copiez
> > vos mails vers Yahoo! Mail 
> 
> 
> 
>        
>
____________________________________________________________________________________
> Moody friends. Drama queens. Your life? Nope! -
> their life, your story. Play Sims Stories at Yahoo!
> Games.
> http://sims.yahoo.com/  
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> axis-dev-help@ws.apache.org
> 
> 
> 
> 
> 
> 
> 
> 
>      
>
_____________________________________________________________________________
> 
> Ne gardez plus qu'une seule adresse mail ! Copiez
> vos mails vers Yahoo! Mail 



       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

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








      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
Mime
View raw message