Hi,
this seems to be a bug in the Java2WSDL converter - we should be
having a switch to change the behavior. Please log a Jira.
Ajith
On 2/15/07, donald yang <[EMAIL PROTECTED]> wrote:
Hi, It seems AXIS2 has a bug to map java byte[] to xml base64Binary. When I
declare a complex data structure, which have a byte[] member variable, the
data type of that variable in WSDL is xsd:byte, not xsd:base64Binary.
However if the variable is not a member variable, AXIS2 map it to xml
base64Binary. It is a very strange behaviour. Here is one example[1], [2].
[1] java source code
public class ComplexTestCaseService
{
public byte[] echoByteArray(byte[] test)
{
return test;
}
public Record echoRecord(Record record)
{
return record;
}
.........................
}
public class Record implements Serializable
{
private double double_var;
private byte[] byteArray_var;
public byte[] getByteArray_var() {
return byteArray_var;
}
public void setByteArray_var(byte[] byteArray_var) {
this.byteArray_var = byteArray_var;
}
public double getDouble_var() {
return double_var;
}
public void setDouble_var(double double_var) {
this.double_var = double_var;
}
}
[2] WSDL generated by AXIS2
<wsdl:definitions targetNamespace=" http://ws.apache.org/axis2">
<wsdl:documentation>
4GL Test Service
</wsdl:documentation>
−
<wsdl:types>
−
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="
http://ws.apache.org/axis2/xsd">
−
<xs:element name="echoRecord">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="record" nillable="true" type="ns:Record"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Record" type="ns:Record"/>
−
<xs:complexType name="Record">
−
<xs:sequence>
<xs:element maxOccurs="unbounded" name="byteArray_var" type="xs:byte"/>
<xs:element name="double_var" type="xs:double"/>
</xs:sequence>
</xs:complexType>
−
<xs:element name="echoRecordResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="return" nillable="true" type="ns:Record"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="echoByteArray">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="test" nillable="true" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
−
<xs:element name="echoByteArrayResponse">
−
<xs:complexType>
−
<xs:sequence>
<xs:element name="return" nillable="true" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
−
<wsdl:message name="echoRecordMessage">
<wsdl:part name="part1" element="ns0:echoRecord"/>
</wsdl:message>
−
<wsdl:message name="echoRecordResponse">
<wsdl:part name="part1" element="ns0:echoRecordResponse"/>
</wsdl:message>
−
<wsdl:message name="echoByteArrayMessage">
<wsdl:part name="part1" element="ns0:echoByteArray"/>
</wsdl:message>
−
<wsdl:message name="echoByteArrayResponse">
<wsdl:part name="part1"
element="ns0:echoByteArrayResponse"/>
</wsdl:message>
−
<wsdl:portType name="ComplexTestCaseServicePortType">
−
<wsdl:operation name="echoRecord">
<wsdl:input message="axis2:echoRecordMessage"
wsaw:Action="urn:echoRecord"/>
<wsdl:output message="axis2:echoRecordResponse"/>
</wsdl:operation>
−
<wsdl:operation name="echoByteArray">
<wsdl:input message="axis2:echoByteArrayMessage"
wsaw:Action="urn:echoByteArray"/>
<wsdl:output message="axis2:echoByteArrayResponse"/>
</wsdl:operation>
</wsdl:portType>
−
<wsdl:binding
name="ComplexTestCaseServiceSOAP11Binding"
type="axis2:ComplexTestCaseServicePortType">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
−
<wsdl:operation name="echoRecord">
<soap:operation soapAction="urn:echoRecord" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="echoByteArray">
<soap:operation soapAction="urn:echoByteArray" style="document"/>
−
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:binding
name="ComplexTestCaseServiceSOAP12Binding"
type="axis2:ComplexTestCaseServicePortType">
<soap12:binding transport="
http://schemas.xmlsoap.org/soap/http" style="document"/>
−
<wsdl:operation name="echoRecord">
<soap12:operation soapAction="urn:echoRecord" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="echoByteArray">
<soap12:operation soapAction="urn:echoByteArray" style="document"/>
−
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
−
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:binding name="ComplexTestCaseServiceHttpBinding"
type="axis2:ComplexTestCaseServicePortType">
<http:binding verb="POST"/>
−
<wsdl:operation name="echoRecord">
<http:operation location="echoRecord"/>
−
<wsdl:input>
<mime:content type="text/xml"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml"/>
</wsdl:output>
</wsdl:operation>
−
<wsdl:operation name="echoByteArray">
<http:operation location="echoByteArray"/>
−
<wsdl:input>
<mime:content type="text/xml"/>
</wsdl:input>
−
<wsdl:output>
<mime:content type="text/xml"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
−
<wsdl:service name="ComplexTestCaseService">
−
<wsdl:port name="ComplexTestCaseServiceSOAP11port_http"
binding="axis2:ComplexTestCaseServiceSOAP11Binding">
<soap:address
location="http://localhost:8080/axis2/services/ComplexTestCaseService"/>
</wsdl:port>
−
<wsdl:port name="ComplexTestCaseServiceSOAP12port_http"
binding="axis2:ComplexTestCaseServiceSOAP12Binding">
<soap12:address
location="http://localhost:8080/axis2/services/ComplexTestCaseService"/>
</wsdl:port>
−
<wsdl:port name="ComplexTestCaseServiceHttpport1"
binding="axis2:ComplexTestCaseServiceHttpBinding">
<http:address
location="http://localhost:8080/axis2/rest/ComplexTestCaseService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
--
Ajith Ranabahu
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]