Hi all,
I would like to send a mail (with a jpeg image in attachment) to a
webservice.
I have a multipart soap request :
- 1st part : soapPart which tell the good operation on the webservice
and give the first parameter of my operation (string)
- 2nd part : image/jpeg part which contains my picture.
I made my owner WSDL file (document/literal) in order to integrate the
mimemultipart input.
So my java file created by wsdl2java provide an operation as :
myOperation(String in java.awt.Image picture).
The WSDL file and the SOAP request are present at the bottom of this mail.
I can use the string parameter in the operation, but the problem is that
no picture is present (picture==null) when I try to use it !
No problem is found in Tomcat logs.
Can anyone help me ?
Pierre NOTEL
*******************************************************************************
*******************************************************************************
*******************************************************************************
SOAP request :
*******************************************************************************
POST /axis/services/myWS?wsdl HTTP/1.0
Content-Type: multipart/related; type="text/xml";
start="<FD273AAD052FCB9ACF5D9E8300E723BC>";
boundary="----=_Part_1_1266014.1147352523988"
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.3
Host: 127.0.0.1:8090
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 9658
org.apache.servicemix.email.from: "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]>
org.apache.servicemix.email.text: <?xml version="1.0" encoding="UTF-8"?>
<ns1:myWS xmlns:ns1="http://localhost:8080/axis/services/myWS?wsdl">
my string parameter
</ns1:myWS>
org.apache.servicemix.email.sentDate: 5/11/06 3:02 PM
org.apache.servicemix.email.to: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
org.apache.servicemix.email.replyTo: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
------=_Part_1_1266014.1147352523988
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <FD273AAD052FCB9ACF5D9E8300E723BC>
<?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:myWS
xmlns:ns1="http://localhost:8080/axis/services/myWS?wsdl">
my string parameter
</ns1:myWS></soapenv:Body></soapenv:Envelope>
------=_Part_1_1266014.1147352523988
Content-Type: image/jpeg;
name="picture.jpg"
Content-Transfer-Encoding: binary
Content-Id: <picture.jpg>
�������� ����������������� ���� ���
...
��������� ���������������
------=_Part_1_1266014.1147352523988--
*******************************************************************************
*******************************************************************************
*******************************************************************************
WSDL file :
*******************************************************************************
<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions
xmlns:types="http://localhost:8080/axis/services/myWS?wsdl"
xmlns:ref="http://ws-i.org/profiles/basic/1.1/xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://localhost:8080/axis/services/myWS?wsdl"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost:8080/axis/services/myWS?wsdl">
<wsdl:types>
<xsd:schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://localhost:8080/axis/services/myWS?wsdl"
elementFormDefault="qualified"
attributeFormDefault="qualified">
<xsd:element name="myString" type="xsd:string"/>
<xsd:element name="myBinary" type="xsd:base64Binary"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="In">
<wsdl:part name="in" element="tns:myString"/>
<wsdl:part name="picture" element="tns:myBinary"/>
</wsdl:message>
<wsdl:message name="Out">
<wsdl:part name="out" element="tns:myString"/>
</wsdl:message>
<wsdl:portType name="PortType">
<wsdl:operation name="myWS">
<wsdl:input message="tns:In"/>
<wsdl:output message="tns:Out"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="monWSBinding" type="tns:PortType">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="monWS">
<soap:operation soapAction="mySoapAction" style="document"/>
<wsdl:input>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal"/>
</mime:part>
<mime:part>
<mime:content part="picture" type="image/jpeg"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="monWSService">
<wsdl:port binding="tns:monWSBinding" name="monWS">
<soap:address location="http://localhost:8080/axis/services/myWS?wsdl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>