M
mate.bestek
Oj,
i wan't my webservice to return two parameters: an array of files
(multiple files) and an array of info about files (file name,
mimetype...). I'm using wsdl2java to generate the server skeleton and
the client stub. The method signature that axis generates looks like
this:
sendFile(com.bestek.mate.FileInfoType[] fileInfo,
org.apache.axis.attachments.OctetStream[] file,
org.apache.axis.holders.OctetStreamHolder[] responseFiles,
com.bestek.mate.holders.ReturnFileInfoHolder responseFilesInfo) throws
java.rmi.RemoteException
My wsdl looks like this:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s1="http://www.crea.si/Schemas/2004/Document"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mb="http://mate.bestek.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://mate.bestek.com">
<wsdl:types>
<xs:schema targetNamespace="http://mate.bestek.com">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:complexType name="ArrayOfFilesType">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="file"
type="xs:hexBinary"/>
</xs:sequence>
<xs:attribute ref="soapenc:arrayType"
wsdl:arrayType="xs:hexBinary[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ReturnFileInfo">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Podatki"
type="mb:FileInfoType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArrayOfFilesInfoType">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Podatki"
type="mb:FileInfoType"/>
</xs:sequence>
<xs:attribute ref="soapenc:arrayType"
wsdl:arrayType="mb:FileInfoType[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="FileInfoType">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="fileName"
type="xs:string"/>
<xs:element minOccurs="1" maxOccurs="1" name="fileLength"
type="xs:string"/>
<xs:element minOccurs="1" maxOccurs="1" name="mimeType"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="FileSoapIn">
<wsdl
art name="FileInfo" type="mb:ArrayOfFilesInfoType"/>
<wsdl
art name="File" type="mb:ArrayOfFilesType"/>
</wsdl:message>
<wsdl:message name="FileSoapOut">
<wsdl
art name="ResponseFiles" type="mb:ArrayOfFilesType"/>
<wsdl
art name="ResponseFilesInfo" type="mb:ReturnFileInfo"/>
</wsdl:message>
<wsdl
ortType name="FileSoap">
<wsdl
peration name="SendFile">
<wsdl:input message="mb:FileSoapIn"/>
<wsdl
utput message="mb:FileSoapOut"/>
</wsdl
peration>
</wsdl
ortType>
<wsdl:binding name="FileSoap" type="mb:FileSoap">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl
peration name="SendFile">
<soap
peration soapAction="http://mate.bestek.com/SendFile"
style="document"/>
<wsdl:input>
<mime:multipartRelated>
<mime
art>
<soap:body parts="FileInfo" use="literal"/>
</mime
art>
<mime
art>
<mime:content part="File" type="application/octet-stream"/>
</mime
art>
</mime:multipartRelated>
</wsdl:input>
<wsdl
utput>
<mime:multipartRelated>
<mime
art>
<soap:body parts="ResponseFilesInfo" use="literal"/>
</mime
art>
<mime
art>
<mime:content part="ResponseFiles"
type="application/octet-stream"/>
</mime
art>
</mime:multipartRelated>
</wsdl
utput>
</wsdl
peration>
</wsdl:binding>
<wsdl:service name="FileLoader">
<wsdl
ort name="FileSoap" binding="mb:FileSoap">
<soap:address location="http://localhost:8080/"/>
</wsdl
ort>
</wsdl:service>
</wsdl:definitions>
The problem is, that in the client stub code axis generates this:
try {
responseFiles.value =
(org.apache.axis.attachments.OctetStream[]) _output.get(new
javax.xml.namespace.QName("", "ResponseFiles"));
} catch (java.lang.Exception _exception) {
responseFiles.value =
(org.apache.axis.attachments.OctetStream[])
org.apache.axis.utils.JavaUtils.convert(_output.get(new
javax.xml.namespace.QName("", "ResponseFiles")), byte[][].class);
}
As you can see here, responseFile.value doesn't exist !!!
Can anyone help?
i wan't my webservice to return two parameters: an array of files
(multiple files) and an array of info about files (file name,
mimetype...). I'm using wsdl2java to generate the server skeleton and
the client stub. The method signature that axis generates looks like
this:
sendFile(com.bestek.mate.FileInfoType[] fileInfo,
org.apache.axis.attachments.OctetStream[] file,
org.apache.axis.holders.OctetStreamHolder[] responseFiles,
com.bestek.mate.holders.ReturnFileInfoHolder responseFilesInfo) throws
java.rmi.RemoteException
My wsdl looks like this:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s1="http://www.crea.si/Schemas/2004/Document"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mb="http://mate.bestek.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://mate.bestek.com">
<wsdl:types>
<xs:schema targetNamespace="http://mate.bestek.com">
<xs:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xs:complexType name="ArrayOfFilesType">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="file"
type="xs:hexBinary"/>
</xs:sequence>
<xs:attribute ref="soapenc:arrayType"
wsdl:arrayType="xs:hexBinary[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ReturnFileInfo">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Podatki"
type="mb:FileInfoType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArrayOfFilesInfoType">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Podatki"
type="mb:FileInfoType"/>
</xs:sequence>
<xs:attribute ref="soapenc:arrayType"
wsdl:arrayType="mb:FileInfoType[]"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="FileInfoType">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="fileName"
type="xs:string"/>
<xs:element minOccurs="1" maxOccurs="1" name="fileLength"
type="xs:string"/>
<xs:element minOccurs="1" maxOccurs="1" name="mimeType"
type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="FileSoapIn">
<wsdl
<wsdl
</wsdl:message>
<wsdl:message name="FileSoapOut">
<wsdl
<wsdl
</wsdl:message>
<wsdl
<wsdl
<wsdl:input message="mb:FileSoapIn"/>
<wsdl
</wsdl
</wsdl
<wsdl:binding name="FileSoap" type="mb:FileSoap">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl
<soap
style="document"/>
<wsdl:input>
<mime:multipartRelated>
<mime
<soap:body parts="FileInfo" use="literal"/>
</mime
<mime
<mime:content part="File" type="application/octet-stream"/>
</mime
</mime:multipartRelated>
</wsdl:input>
<wsdl
<mime:multipartRelated>
<mime
<soap:body parts="ResponseFilesInfo" use="literal"/>
</mime
<mime
<mime:content part="ResponseFiles"
type="application/octet-stream"/>
</mime
</mime:multipartRelated>
</wsdl
</wsdl
</wsdl:binding>
<wsdl:service name="FileLoader">
<wsdl
<soap:address location="http://localhost:8080/"/>
</wsdl
</wsdl:service>
</wsdl:definitions>
The problem is, that in the client stub code axis generates this:
try {
responseFiles.value =
(org.apache.axis.attachments.OctetStream[]) _output.get(new
javax.xml.namespace.QName("", "ResponseFiles"));
} catch (java.lang.Exception _exception) {
responseFiles.value =
(org.apache.axis.attachments.OctetStream[])
org.apache.axis.utils.JavaUtils.convert(_output.get(new
javax.xml.namespace.QName("", "ResponseFiles")), byte[][].class);
}
As you can see here, responseFile.value doesn't exist !!!
Can anyone help?