Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

WSDL with SOAP Binding and Attachement

843834Sep 22 2004 — edited Sep 24 2004
Hello

I'm trying to define a WSDL-Definition which defines a operation called getFile() which returns a file as a SOAP attachement. I created the follwing file which I can verify without any problems. However if I try to compile it with wscompile (wscompile -gen:server -mapping build/mapping.xml -d build -nd build -classpath . config.xml) I get the follwing error:

error: output message of binding operation "getFile" does not have a SOAP body extension

When I remove the line

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>

wscompile generates the classes but gives the following warnings:

warning: ignoring port "FileDistributorIFPort": not a SOAP port
warning: Service "FileDistributorService" does not contain any usable ports

Which is somehow clear because I did not define the soap binding.

Any ideas what I can do so I can transmit a file via SOAP using attachements?

Here's the file

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="FileDistributorService"
targetNamespace="urn:Foo"
xmlns:tns="urn:Foo"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<types>
<xsd:schema targetNamespace="urn:Foo"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsd:element name="getFile">
<xsd:complexType>
<xsd:all>
<xsd:element name="mySymbol" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="getFileResponse">
<xsd:complexType>
<xsd:all>
<xsd:element name="result" type="float"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ArrayOfBinary">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:binary[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
</types>
<message name="m1">
<part name="body" element="tns:getFile"/>
</message>

<message name="m2">
<part name="body" element="tns:getFileResponse"/>
<part name="file" type="tns:ArrayOfBinary"/>
</message>

<portType name="pt1">
<operation name="getFile">
<input message="tns:m1"/>
<output message="tns:m2"/>
</operation>
</portType>

<binding name="b1" type="tns:pt1">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="getFile">
<soap:operation soapAction="getFile"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<mime:multipartRelated>
<mime:part>
<soap:body parts="body" use="literal"/>
</mime:part>
<mime:part>
<mime:content part="file" type="tns:ArrayOfBinary"/>
</mime:part>
</mime:multipartRelated>
</output>
</operation>
</binding>
<service name="FileDistributorService">
<port name="FileDistributorIFPort" binding="tns:b1">
<soap:address location="http://localhost:8080/fxm/FileDistributorImpl"/>
</port>
</service>

</definitions>

Thanks a lot!

Oliver



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2004
Added on Sep 22 2004
2 comments
296 views