Hi,

Sorry if I bother you.
I try to use attachments with Axis. I have been reading about SwA, Basic Profile 1.1 etc etc..Then I found this conversation in axis news.
I would like to ask you about that example message sent to the service: how did you manage to get such a message with multipart/related stuff? I don't understand it as I can't see any use of 'mime:part' in the binding in the wsdl.
Did you also use wsdl2java to generate stubs for the client?

Rgds,
-R



Jason Boehle wrote:

Hi all,

I'm having some problems getting SOAP attachments working in my
webservice, and was wondering

Here are the relevant snippets from the WSDL:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<definitions name="ActuateAPI"
xmlns="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:typens="http://schemas.actuate.com/actuate8";
xmlns:wsdlns="http://schemas.actuate.com/actuate8/wsdl";
targetNamespace="http://schemas.actuate.com/actuate8/wsdl";>
        <types>
                <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema";
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
targetNamespace="http://schemas.actuate.com/actuate8";
elementFormDefault="qualified">
                        <xsd:complexType name="Attachment">
                                <xsd:all>
                                        <xsd:element name="ContentId" 
type="xsd:string"/>
                                        <xsd:element name="ContentType" 
type="xsd:string"/>
                                        <xsd:element name="ContentLength" type="xsd:long" 
minOccurs="0"/>
                                        <xsd:element name="ContentEncoding" 
type="xsd:string" minOccurs="0"/>
                                        <xsd:element name="Locale" type="xsd:string" 
minOccurs="0"/>
                                        <xsd:element name="ContentData" 
type="xsd:base64Binary" minOccurs="0"/>
                                </xsd:all>
                        </xsd:complexType>
                        <xsd:complexType name="OSISubmitExec">
                                <xsd:sequence>
                                        <xsd:element name="JobID" 
type="xsd:int"/>
                                        <xsd:element name="ExecutableFile" 
type="typens:Attachment" minOccurs="0"/>
                                        <xsd:element name="ExecutableFilePhysicalPath" 
type="xsd:string"
minOccurs="0"/>
                                </xsd:sequence>
                        </xsd:complexType>
                        <xsd:element name="OSISubmitExec" 
type="typens:OSISubmitExec"/>
                </xsd:schema>
        </types>
        <message name="OSISubmitExec">
                <part name="Request" element="typens:OSISubmitExec"/>
        </message>
        <portType name="ActuateSoapPort">
                <operation name="oSISubmitExec">
                        <input message="wsdlns:OSISubmitExec"/>
                        <output message="wsdlns:OSISubmitExecResponse"/>
                </operation>
        </portType>
        <binding name="ActuateSoapBinding" type="wsdlns:ActuateSoapPort">
                <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
                <operation name="oSISubmitExec">
                        <soap:operation soapAction=""/>
                        <input>
                                <soap:body use="literal" parts="Request"/>
                        </input>
                        <output>
                                <soap:body use="literal" parts="Response"/>
                        </output>
                </operation>
        </binding>
        <service name="ActuateAPI">
                <port name="ActuateSoapPort" 
binding="wsdlns:ActuateSoapBinding">
                        <soap:address location="http://greenwich:8000"/>
                </port>
        </service>
</definitions>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Here is the msg sent to my service: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ POST /server/ss/services/ActuateSoapPort HTTP/1.1 Content-Type: Multipart/Related;boundary=MIME_boundary;type="text/xml";start="<response.xml>" Transfer-Encoding:chunked HOST:jboehle7 SOAPAction:""

375

--MIME_boundary
Content-Type: text/xml;charset=utf-8
Content-Transfer-Encoding:8bit
Content-ID:<response.xml>

<?xml version='1.0' ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<SOAP-ENV:Header xmlns="http://schemas.actuate.com/actuate8";></SOAP-ENV:Header>
<SOAP-ENV:Body>
<ACTU:OSISubmitExec xmlns:ACTU="http://schemas.actuate.com/actuate8";
xmlns="http://schemas.actuate.com/actuate8";>
<JobID xsi:type="xsd:unsignedInt">27</JobID>
<ExecutableFile xsi:type="Attachment">
<ContentId xsi:type="xsd:string">ExecutableFile</ContentId>
<ContentType xsi:type="xsd:string">binary</ContentType>
<ContentEncoding xsi:type="xsd:string">binary</ContentEncoding>
</ExecutableFile>
</ACTU:OSISubmitExec>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

5E

--MIME_boundary
Content-Type: binary
Content-Transfer-Encoding:binary
Content-ID:file


2A9 PK <<plus a bunch of other binary data>>


--MIME_boundary--

0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Here is the response sent back by Axis, it never calls my service (at least my breakpoint is never hit): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HTTP/1.1 500 Internal Server Error Date: Wed, 20 Oct 2004 22:26:25 GMT Server: Jetty/4.2.21 (Windows XP/5.1 x86 java/1.4.2_05) Content-Type: text/xml; charset=utf-8 Transfer-Encoding: chunked

1cd

<?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>
 <soapenv:Fault>
  <faultcode>soapenv:Server.userException</faultcode>
  <faultstring>java.lang.IllegalArgumentException: argument type
mismatch</faultstring>
  <detail/>
 </soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I imagine I have to add something to the WSDL to specify
mimeMultipart/Related or something like that?  Sorry for my naïve
question, I'm a SOAP newbie.  So what is it in the WSDL that doesn't
match the message that is sent?

Thanks!

Jason Boehle
[EMAIL PROTECTED]




Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to