You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by ppil1 <pp...@ausy.org> on 2009/05/07 16:48:47 UTC

Issue Ussing Service Mix CXF component with multipart WSDL

Hi,

i'm using servicemix r3.3 on windows platform, java 1.6.
I'm using Servicemix CXF component.

I'm calling an external service thru a cxf-se SU.
SOAP CALL --> CXF BC --> CXF SE --> CXF BC >> External WS.

My external WS is multipart, and i need to send a text/xml file attached.

>From a java program using apache cxf it' s works perfectly; but from
servicemix every part are serialized in soap:body (see soap enveloppe
hereafter)

Is there a way to workaround this ?
Thanks


Here soap enveloppe send from service mix
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
 <SayHelloOUT xmlns="http://servicemix.apache.org/test/types">
  <name>mon nom</name> 
  </SayHelloOUT>
  <ns2:fileattach xmlns="http://servicemix.apache.org/test/types"
xmlns:ns2="http://servicemix.apache.org/test">kljkljl</ns2:fileattach> 
  </soap:Body>
  </soap:Envelope>

Here a correct soap send from stand alone java program using apache cxf
--uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf
Content-Type: text/xml

<?xml version="1.0" ?><S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><SayHello
xmlns="http://servicemix.apache.org/test/types"
xmlns:ns2="http://servicemix.apache.org/test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/></S:Body></S:Envelope>
--uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf
Content-Id:<fi...@jaxws.sun.com>
Content-Type: text/xml
Content-Transfer-Encoding: binary

<ns2:fileattach xmlns="http://servicemix.apache.org/test/types"
xmlns:ns2="http://servicemix.apache.org/test">dklfjklklhjsdfhjslf</ns2:fileattach>
--uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf--




-- 
View this message in context: http://www.nabble.com/Issue-Ussing-Service-Mix-CXF-component-with-multipart-WSDL-tp23428472p23428472.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by Freeman Fang <fr...@gmail.com>.
ppil1 wrote:
> Hi,
>
> I change my wsdl file
> <element name="fileattach" type="xsd:base64Binary" 
> xmime:expectedContentTypes="application/octet-stream"/>
> but i'm still getting same result except fileattach element is base64
> encoded.
>
> After checking release & bug reported
> (http://issues.apache.org/activemq/browse/SMXCOMP-32)
> seems that i need cxf-se & cxf-bc 2009-02 release ? 
> Is fix included in 3.4.0.2 servicemix fuse release ?
>   
Yes, I believe so
> Thanks
>
>
>
>
>
> Freeman Fang wrote:
>   
>> Hi,
>> Your wsdl is the problem,
>> you must change
>> <xsd:element name="fileattach" type="xsd:string"/>
>> to
>> <element name="fileattach" type="xsd:base64Binary" 
>> xmime:expectedContentTypes="application/octet-stream"/>
>> and use wsdl2java regenerate the cxf client proxy 
>> org.apache.servicemix.test.HelloOUT, which means you can use DataHandler 
>> from org.apache.servicemix.test.HelloOUT
>> You can get more details about how to use MTOM in cxf from [1]
>> [1]http://cwiki.apache.org/CXF20DOC/mtom.html
>>
>> Freeman
>>
>> ppil1 wrote:
>>     
>>> Hi,
>>>
>>> i downloaded latest fuse esb release and deployer my SA whith mtomEnabled
>>> pn
>>> cxfse:proxy, but i get the same issue: fileattach element not send as
>>> attachement but send as soapbody element.
>>> I don't known if my issue is related to mtom or because my fileattach
>>> element is defined as a string element in WSDL provided to me. 
>>> Here the whole WSDL :
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
>>> 	xmlns:tns="http://servicemix.apache.org/test_out" 
>>> 	xmlns:typens="http://servicemix.apache.org/test_out/types"
>>> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
>>> 	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>>> 	xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
>>> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>>> 	name="HelloOUT" 
>>> 	targetNamespace="http://servicemix.apache.org/test_out">
>>>
>>> <wsdl:types>
>>> 		<xsd:schema
>>> targetNamespace="http://servicemix.apache.org/test_out/types"
>>> 		            elementFormDefault="qualified">
>>> 			<xsd:element name="SayHelloOUT">
>>> 			  <xsd:complexType>
>>> 					<xsd:sequence>
>>> 						<xsd:element name="name" type="xsd:string"/>
>>> 						<xsd:element name="fileattach" type="xsd:string"/>
>>> 					</xsd:sequence>
>>> 				</xsd:complexType>
>>> 			</xsd:element>
>>> 			<xsd:element name="SayHelloOUTResponse">
>>> 			  <xsd:complexType>
>>> 					<xsd:sequence>
>>> 						<xsd:element name="name" type="xsd:string"/>
>>> 					</xsd:sequence>
>>> 				</xsd:complexType>
>>> 			</xsd:element>
>>> 			<xsd:element name="UnknownWordFault">
>>> 			  <xsd:complexType>
>>> 					<xsd:sequence>
>>> 					    <xsd:element name="word" type="xsd:string"/>
>>> 					</xsd:sequence>
>>> 				</xsd:complexType>
>>> 			</xsd:element>
>>> 		</xsd:schema>
>>>   </wsdl:types>
>>>
>>> 	<wsdl:message name="SayHelloOUTRequest">
>>> 		<wsdl:part name="request" element="typens:SayHelloOUT"/>
>>> 		<wsdl:part name="fileattach" type="xsd:string"/>
>>>
>>> 	</wsdl:message>
>>> 	<wsdl:message name="SayHelloOUTResponse">
>>> 		<wsdl:part name="payload" element="typens:SayHelloOUTResponse"/>
>>> 	</wsdl:message>
>>> 	<wsdl:message name="UnknownWordFault">
>>> 		<wsdl:part name="payload" element="typens:UnknownWordFault"/>
>>> 	</wsdl:message>
>>>
>>>     <wsdl:portType name="HelloOUT">
>>> 		<wsdl:operation name="SayHelloOUT">
>>> 			<wsdl:input message="tns:SayHelloOUTRequest"/>
>>> 			<wsdl:output message="tns:SayHelloOUTResponse"/>
>>> 			<wsdl:fault name="UnknownWord" message="tns:UnknownWordFault"/>
>>> 		</wsdl:operation>
>>> 	</wsdl:portType>
>>>
>>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>>     	<soap:binding style="document"
>>> transport="http://schemas.xmlsoap.org/soap/http" />
>>> 		<wsdl:operation name="SayHelloOUT">
>>> 			<wsdl:input>
>>> 				<mime:multipartRelated>
>>>             				<mime:part>
>>> 						<soap:body parts="request" use="literal" />
>>> 				</mime:part>
>>> 				<mime:part>
>>>               					<mime:content part="fileattach" type="text/xml"/>
>>>             			</mime:part>
>>>           			</mime:multipartRelated>
>>>
>>> 			</wsdl:input>
>>> 			<wsdl:output>
>>> 				<soap:body use="literal" />
>>> 			</wsdl:output>
>>> 			<wsdl:fault name="UnknownWord">
>>> 				<soap:fault use="literal" name="UnknownWord" />
>>> 			</wsdl:fault>
>>>        </wsdl:operation>
>>> </wsdl:binding>
>>>
>>> <wsdl:service name="HelloOUTService">
>>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>>            <soap:address
>>> location="http://localhost:8080/HelloOUTService/"
>>> />
>>>        </wsdl:port>
>>> </wsdl:service>
>>> </wsdl:definitions>
>>>
>>>
>>>
>>>
>>>
>>> Freeman Fang wrote:
>>>   
>>>       
>>>> Hi,
>>>> You need also add mtomEnabled="true" to your cxfse:proxy.
>>>> This is a new added feature so there is no apache servicemix release 
>>>> including it, try play with the latest FUSE ESB(FUSE ESB is based on 
>>>> apache servicemix and get released more frequently) from [1]
>>>> [1]http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/3.3.1.17-fuse/
>>>> Freeman
>>>>
>>>> ppil1 wrote:
>>>>     
>>>>         
>>>>> Hi on both endpoint i 've set mtomEnabled=true but issue is still the
>>>>> same.
>>>>> Only the proxied webservice is a multipart WS.
>>>>> CxfSe component seems to send a wrong jbi message to cxf bc proxied
>>>>> endpoint.
>>>>> Instead of sending a jbi attachement for my fileattach element,
>>>>> coponent
>>>>> is
>>>>> sending element in jbi body message.
>>>>>
>>>>> Thanks for help.
>>>>>
>>>>> Here my configuration
>>>>>
>>>>> ...
>>>>> <cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
>>>>>                       locationURI="http://localhost:8080/test"
>>>>>                       service="test:HelloOUTService"
>>>>>                       endpoint="soap"
>>>>>                        	/>
>>>>>
>>>>> .....
>>>>> <cxfse:endpoint mtomEnabled="true"  >
>>>>>         <cxfse:pojo>
>>>>>           <bean class="org.apache.servicemix.test.HelloIn" >
>>>>>           	<property name="myHelloOUT">
>>>>>           		<cxfse:proxy  service="test:HelloOUTService"
>>>>> endpoint="soap"
>>>>> context="#context" type="org.apache.servicemix.test.HelloOUT" />
>>>>>        		</property>
>>>>>           </bean>
>>>>> ...
>>>>>
>>>>> Helloout WSDL
>>>>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>>>>     	<soap:binding style="document"
>>>>> transport="http://schemas.xmlsoap.org/soap/http" />
>>>>> 		<wsdl:operation name="SayHelloOUT">
>>>>> 			<wsdl:input>
>>>>> 				<mime:multipartRelated>
>>>>>             				<mime:part>
>>>>> 						<soap:body parts="request" use="literal" />
>>>>> 				</mime:part>
>>>>> 				<mime:part>
>>>>>               					<mime:content part="fileattach" type="text/xml"/>
>>>>>             			</mime:part>
>>>>>           			</mime:multipartRelated>
>>>>>
>>>>> 			</wsdl:input>
>>>>> 			<wsdl:output>
>>>>> 				<soap:body use="literal" />
>>>>> 			</wsdl:output>
>>>>> 			<wsdl:fault name="UnknownWord">
>>>>> 				<soap:fault use="literal" name="UnknownWord" />
>>>>> 			</wsdl:fault>
>>>>>        </wsdl:operation>
>>>>> </wsdl:binding>
>>>>>
>>>>> <wsdl:service name="HelloOUTService">
>>>>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>>>>            <soap:address
>>>>> location="http://localhost:8080/HelloOUTService/"
>>>>> />
>>>>>        </wsdl:port>
>>>>> </wsdl:service>
>>>>>   
>>>>>       
>>>>>           
>>>> -- 
>>>> Freeman Fang
>>>> ------------------------
>>>> Open Source SOA: http://fusesource.com
>>>>
>>>>
>>>>
>>>>     
>>>>         
>>>   
>>>       
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>>     
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by ppil1 <pp...@ausy.org>.

Hi,

I change my wsdl file
<element name="fileattach" type="xsd:base64Binary" 
xmime:expectedContentTypes="application/octet-stream"/>
but i'm still getting same result except fileattach element is base64
encoded.

After checking release & bug reported
(http://issues.apache.org/activemq/browse/SMXCOMP-32)
seems that i need cxf-se & cxf-bc 2009-02 release ? 
Is fix included in 3.4.0.2 servicemix fuse release ?

Thanks





Freeman Fang wrote:
> 
> Hi,
> Your wsdl is the problem,
> you must change
> <xsd:element name="fileattach" type="xsd:string"/>
> to
> <element name="fileattach" type="xsd:base64Binary" 
> xmime:expectedContentTypes="application/octet-stream"/>
> and use wsdl2java regenerate the cxf client proxy 
> org.apache.servicemix.test.HelloOUT, which means you can use DataHandler 
> from org.apache.servicemix.test.HelloOUT
> You can get more details about how to use MTOM in cxf from [1]
> [1]http://cwiki.apache.org/CXF20DOC/mtom.html
> 
> Freeman
> 
> ppil1 wrote:
>> Hi,
>>
>> i downloaded latest fuse esb release and deployer my SA whith mtomEnabled
>> pn
>> cxfse:proxy, but i get the same issue: fileattach element not send as
>> attachement but send as soapbody element.
>> I don't known if my issue is related to mtom or because my fileattach
>> element is defined as a string element in WSDL provided to me. 
>> Here the whole WSDL :
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
>> 	xmlns:tns="http://servicemix.apache.org/test_out" 
>> 	xmlns:typens="http://servicemix.apache.org/test_out/types"
>> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
>> 	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
>> 	xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
>> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
>> 	name="HelloOUT" 
>> 	targetNamespace="http://servicemix.apache.org/test_out">
>>
>> <wsdl:types>
>> 		<xsd:schema
>> targetNamespace="http://servicemix.apache.org/test_out/types"
>> 		            elementFormDefault="qualified">
>> 			<xsd:element name="SayHelloOUT">
>> 			  <xsd:complexType>
>> 					<xsd:sequence>
>> 						<xsd:element name="name" type="xsd:string"/>
>> 						<xsd:element name="fileattach" type="xsd:string"/>
>> 					</xsd:sequence>
>> 				</xsd:complexType>
>> 			</xsd:element>
>> 			<xsd:element name="SayHelloOUTResponse">
>> 			  <xsd:complexType>
>> 					<xsd:sequence>
>> 						<xsd:element name="name" type="xsd:string"/>
>> 					</xsd:sequence>
>> 				</xsd:complexType>
>> 			</xsd:element>
>> 			<xsd:element name="UnknownWordFault">
>> 			  <xsd:complexType>
>> 					<xsd:sequence>
>> 					    <xsd:element name="word" type="xsd:string"/>
>> 					</xsd:sequence>
>> 				</xsd:complexType>
>> 			</xsd:element>
>> 		</xsd:schema>
>>   </wsdl:types>
>>
>> 	<wsdl:message name="SayHelloOUTRequest">
>> 		<wsdl:part name="request" element="typens:SayHelloOUT"/>
>> 		<wsdl:part name="fileattach" type="xsd:string"/>
>>
>> 	</wsdl:message>
>> 	<wsdl:message name="SayHelloOUTResponse">
>> 		<wsdl:part name="payload" element="typens:SayHelloOUTResponse"/>
>> 	</wsdl:message>
>> 	<wsdl:message name="UnknownWordFault">
>> 		<wsdl:part name="payload" element="typens:UnknownWordFault"/>
>> 	</wsdl:message>
>>
>>     <wsdl:portType name="HelloOUT">
>> 		<wsdl:operation name="SayHelloOUT">
>> 			<wsdl:input message="tns:SayHelloOUTRequest"/>
>> 			<wsdl:output message="tns:SayHelloOUTResponse"/>
>> 			<wsdl:fault name="UnknownWord" message="tns:UnknownWordFault"/>
>> 		</wsdl:operation>
>> 	</wsdl:portType>
>>
>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>     	<soap:binding style="document"
>> transport="http://schemas.xmlsoap.org/soap/http" />
>> 		<wsdl:operation name="SayHelloOUT">
>> 			<wsdl:input>
>> 				<mime:multipartRelated>
>>             				<mime:part>
>> 						<soap:body parts="request" use="literal" />
>> 				</mime:part>
>> 				<mime:part>
>>               					<mime:content part="fileattach" type="text/xml"/>
>>             			</mime:part>
>>           			</mime:multipartRelated>
>>
>> 			</wsdl:input>
>> 			<wsdl:output>
>> 				<soap:body use="literal" />
>> 			</wsdl:output>
>> 			<wsdl:fault name="UnknownWord">
>> 				<soap:fault use="literal" name="UnknownWord" />
>> 			</wsdl:fault>
>>        </wsdl:operation>
>> </wsdl:binding>
>>
>> <wsdl:service name="HelloOUTService">
>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>            <soap:address
>> location="http://localhost:8080/HelloOUTService/"
>> />
>>        </wsdl:port>
>> </wsdl:service>
>> </wsdl:definitions>
>>
>>
>>
>>
>>
>> Freeman Fang wrote:
>>   
>>> Hi,
>>> You need also add mtomEnabled="true" to your cxfse:proxy.
>>> This is a new added feature so there is no apache servicemix release 
>>> including it, try play with the latest FUSE ESB(FUSE ESB is based on 
>>> apache servicemix and get released more frequently) from [1]
>>> [1]http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/3.3.1.17-fuse/
>>> Freeman
>>>
>>> ppil1 wrote:
>>>     
>>>> Hi on both endpoint i 've set mtomEnabled=true but issue is still the
>>>> same.
>>>> Only the proxied webservice is a multipart WS.
>>>> CxfSe component seems to send a wrong jbi message to cxf bc proxied
>>>> endpoint.
>>>> Instead of sending a jbi attachement for my fileattach element,
>>>> coponent
>>>> is
>>>> sending element in jbi body message.
>>>>
>>>> Thanks for help.
>>>>
>>>> Here my configuration
>>>>
>>>> ...
>>>> <cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
>>>>                       locationURI="http://localhost:8080/test"
>>>>                       service="test:HelloOUTService"
>>>>                       endpoint="soap"
>>>>                        	/>
>>>>
>>>> .....
>>>> <cxfse:endpoint mtomEnabled="true"  >
>>>>         <cxfse:pojo>
>>>>           <bean class="org.apache.servicemix.test.HelloIn" >
>>>>           	<property name="myHelloOUT">
>>>>           		<cxfse:proxy  service="test:HelloOUTService"
>>>> endpoint="soap"
>>>> context="#context" type="org.apache.servicemix.test.HelloOUT" />
>>>>        		</property>
>>>>           </bean>
>>>> ...
>>>>
>>>> Helloout WSDL
>>>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>>>     	<soap:binding style="document"
>>>> transport="http://schemas.xmlsoap.org/soap/http" />
>>>> 		<wsdl:operation name="SayHelloOUT">
>>>> 			<wsdl:input>
>>>> 				<mime:multipartRelated>
>>>>             				<mime:part>
>>>> 						<soap:body parts="request" use="literal" />
>>>> 				</mime:part>
>>>> 				<mime:part>
>>>>               					<mime:content part="fileattach" type="text/xml"/>
>>>>             			</mime:part>
>>>>           			</mime:multipartRelated>
>>>>
>>>> 			</wsdl:input>
>>>> 			<wsdl:output>
>>>> 				<soap:body use="literal" />
>>>> 			</wsdl:output>
>>>> 			<wsdl:fault name="UnknownWord">
>>>> 				<soap:fault use="literal" name="UnknownWord" />
>>>> 			</wsdl:fault>
>>>>        </wsdl:operation>
>>>> </wsdl:binding>
>>>>
>>>> <wsdl:service name="HelloOUTService">
>>>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>>>            <soap:address
>>>> location="http://localhost:8080/HelloOUTService/"
>>>> />
>>>>        </wsdl:port>
>>>> </wsdl:service>
>>>>   
>>>>       
>>> -- 
>>> Freeman Fang
>>> ------------------------
>>> Open Source SOA: http://fusesource.com
>>>
>>>
>>>
>>>     
>>
>>   
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-Ussing-Service-Mix-CXF-component-with-multipart-WSDL-tp23428472p23505527.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Your wsdl is the problem,
you must change
<xsd:element name="fileattach" type="xsd:string"/>
to
<element name="fileattach" type="xsd:base64Binary" 
xmime:expectedContentTypes="application/octet-stream"/>
and use wsdl2java regenerate the cxf client proxy 
org.apache.servicemix.test.HelloOUT, which means you can use DataHandler 
from org.apache.servicemix.test.HelloOUT
You can get more details about how to use MTOM in cxf from [1]
[1]http://cwiki.apache.org/CXF20DOC/mtom.html

Freeman

ppil1 wrote:
> Hi,
>
> i downloaded latest fuse esb release and deployer my SA whith mtomEnabled pn
> cxfse:proxy, but i get the same issue: fileattach element not send as
> attachement but send as soapbody element.
> I don't known if my issue is related to mtom or because my fileattach
> element is defined as a string element in WSDL provided to me. 
> Here the whole WSDL :
> <?xml version="1.0" encoding="UTF-8"?>
>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> 	xmlns:tns="http://servicemix.apache.org/test_out" 
> 	xmlns:typens="http://servicemix.apache.org/test_out/types"
> 	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> 	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
> 	xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
> 	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> 	name="HelloOUT" 
> 	targetNamespace="http://servicemix.apache.org/test_out">
>
> <wsdl:types>
> 		<xsd:schema targetNamespace="http://servicemix.apache.org/test_out/types"
> 		            elementFormDefault="qualified">
> 			<xsd:element name="SayHelloOUT">
> 			  <xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element name="name" type="xsd:string"/>
> 						<xsd:element name="fileattach" type="xsd:string"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="SayHelloOUTResponse">
> 			  <xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element name="name" type="xsd:string"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="UnknownWordFault">
> 			  <xsd:complexType>
> 					<xsd:sequence>
> 					    <xsd:element name="word" type="xsd:string"/>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 		</xsd:schema>
>   </wsdl:types>
>
> 	<wsdl:message name="SayHelloOUTRequest">
> 		<wsdl:part name="request" element="typens:SayHelloOUT"/>
> 		<wsdl:part name="fileattach" type="xsd:string"/>
>
> 	</wsdl:message>
> 	<wsdl:message name="SayHelloOUTResponse">
> 		<wsdl:part name="payload" element="typens:SayHelloOUTResponse"/>
> 	</wsdl:message>
> 	<wsdl:message name="UnknownWordFault">
> 		<wsdl:part name="payload" element="typens:UnknownWordFault"/>
> 	</wsdl:message>
>
>     <wsdl:portType name="HelloOUT">
> 		<wsdl:operation name="SayHelloOUT">
> 			<wsdl:input message="tns:SayHelloOUTRequest"/>
> 			<wsdl:output message="tns:SayHelloOUTResponse"/>
> 			<wsdl:fault name="UnknownWord" message="tns:UnknownWordFault"/>
> 		</wsdl:operation>
> 	</wsdl:portType>
>
>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>     	<soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http" />
> 		<wsdl:operation name="SayHelloOUT">
> 			<wsdl:input>
> 				<mime:multipartRelated>
>             				<mime:part>
> 						<soap:body parts="request" use="literal" />
> 				</mime:part>
> 				<mime:part>
>               					<mime:content part="fileattach" type="text/xml"/>
>             			</mime:part>
>           			</mime:multipartRelated>
>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal" />
> 			</wsdl:output>
> 			<wsdl:fault name="UnknownWord">
> 				<soap:fault use="literal" name="UnknownWord" />
> 			</wsdl:fault>
>        </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:service name="HelloOUTService">
> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>            <soap:address location="http://localhost:8080/HelloOUTService/"
> />
>        </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
>
>
>
>
>
> Freeman Fang wrote:
>   
>> Hi,
>> You need also add mtomEnabled="true" to your cxfse:proxy.
>> This is a new added feature so there is no apache servicemix release 
>> including it, try play with the latest FUSE ESB(FUSE ESB is based on 
>> apache servicemix and get released more frequently) from [1]
>> [1]http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/3.3.1.17-fuse/
>> Freeman
>>
>> ppil1 wrote:
>>     
>>> Hi on both endpoint i 've set mtomEnabled=true but issue is still the
>>> same.
>>> Only the proxied webservice is a multipart WS.
>>> CxfSe component seems to send a wrong jbi message to cxf bc proxied
>>> endpoint.
>>> Instead of sending a jbi attachement for my fileattach element, coponent
>>> is
>>> sending element in jbi body message.
>>>
>>> Thanks for help.
>>>
>>> Here my configuration
>>>
>>> ...
>>> <cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
>>>                       locationURI="http://localhost:8080/test"
>>>                       service="test:HelloOUTService"
>>>                       endpoint="soap"
>>>                        	/>
>>>
>>> .....
>>> <cxfse:endpoint mtomEnabled="true"  >
>>>         <cxfse:pojo>
>>>           <bean class="org.apache.servicemix.test.HelloIn" >
>>>           	<property name="myHelloOUT">
>>>           		<cxfse:proxy  service="test:HelloOUTService" endpoint="soap"
>>> context="#context" type="org.apache.servicemix.test.HelloOUT" />
>>>        		</property>
>>>           </bean>
>>> ...
>>>
>>> Helloout WSDL
>>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>>     	<soap:binding style="document"
>>> transport="http://schemas.xmlsoap.org/soap/http" />
>>> 		<wsdl:operation name="SayHelloOUT">
>>> 			<wsdl:input>
>>> 				<mime:multipartRelated>
>>>             				<mime:part>
>>> 						<soap:body parts="request" use="literal" />
>>> 				</mime:part>
>>> 				<mime:part>
>>>               					<mime:content part="fileattach" type="text/xml"/>
>>>             			</mime:part>
>>>           			</mime:multipartRelated>
>>>
>>> 			</wsdl:input>
>>> 			<wsdl:output>
>>> 				<soap:body use="literal" />
>>> 			</wsdl:output>
>>> 			<wsdl:fault name="UnknownWord">
>>> 				<soap:fault use="literal" name="UnknownWord" />
>>> 			</wsdl:fault>
>>>        </wsdl:operation>
>>> </wsdl:binding>
>>>
>>> <wsdl:service name="HelloOUTService">
>>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>>            <soap:address
>>> location="http://localhost:8080/HelloOUTService/"
>>> />
>>>        </wsdl:port>
>>> </wsdl:service>
>>>   
>>>       
>> -- 
>> Freeman Fang
>> ------------------------
>> Open Source SOA: http://fusesource.com
>>
>>
>>
>>     
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by ppil1 <pp...@ausy.org>.

Hi,

i downloaded latest fuse esb release and deployer my SA whith mtomEnabled pn
cxfse:proxy, but i get the same issue: fileattach element not send as
attachement but send as soapbody element.
I don't known if my issue is related to mtom or because my fileattach
element is defined as a string element in WSDL provided to me. 
Here the whole WSDL :
<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:tns="http://servicemix.apache.org/test_out" 
	xmlns:typens="http://servicemix.apache.org/test_out/types"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
	xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	name="HelloOUT" 
	targetNamespace="http://servicemix.apache.org/test_out">

<wsdl:types>
		<xsd:schema targetNamespace="http://servicemix.apache.org/test_out/types"
		            elementFormDefault="qualified">
			<xsd:element name="SayHelloOUT">
			  <xsd:complexType>
					<xsd:sequence>
						<xsd:element name="name" type="xsd:string"/>
						<xsd:element name="fileattach" type="xsd:string"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="SayHelloOUTResponse">
			  <xsd:complexType>
					<xsd:sequence>
						<xsd:element name="name" type="xsd:string"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			<xsd:element name="UnknownWordFault">
			  <xsd:complexType>
					<xsd:sequence>
					    <xsd:element name="word" type="xsd:string"/>
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:schema>
  </wsdl:types>

	<wsdl:message name="SayHelloOUTRequest">
		<wsdl:part name="request" element="typens:SayHelloOUT"/>
		<wsdl:part name="fileattach" type="xsd:string"/>

	</wsdl:message>
	<wsdl:message name="SayHelloOUTResponse">
		<wsdl:part name="payload" element="typens:SayHelloOUTResponse"/>
	</wsdl:message>
	<wsdl:message name="UnknownWordFault">
		<wsdl:part name="payload" element="typens:UnknownWordFault"/>
	</wsdl:message>

    <wsdl:portType name="HelloOUT">
		<wsdl:operation name="SayHelloOUT">
			<wsdl:input message="tns:SayHelloOUTRequest"/>
			<wsdl:output message="tns:SayHelloOUTResponse"/>
			<wsdl:fault name="UnknownWord" message="tns:UnknownWordFault"/>
		</wsdl:operation>
	</wsdl:portType>

 <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
    	<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="SayHelloOUT">
			<wsdl:input>
				<mime:multipartRelated>
            				<mime:part>
						<soap:body parts="request" use="literal" />
				</mime:part>
				<mime:part>
              					<mime:content part="fileattach" type="text/xml"/>
            			</mime:part>
          			</mime:multipartRelated>

			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
			<wsdl:fault name="UnknownWord">
				<soap:fault use="literal" name="UnknownWord" />
			</wsdl:fault>
       </wsdl:operation>
</wsdl:binding>

<wsdl:service name="HelloOUTService">
	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
           <soap:address location="http://localhost:8080/HelloOUTService/"
/>
       </wsdl:port>
</wsdl:service>
</wsdl:definitions>





Freeman Fang wrote:
> 
> Hi,
> You need also add mtomEnabled="true" to your cxfse:proxy.
> This is a new added feature so there is no apache servicemix release 
> including it, try play with the latest FUSE ESB(FUSE ESB is based on 
> apache servicemix and get released more frequently) from [1]
> [1]http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/3.3.1.17-fuse/
> Freeman
> 
> ppil1 wrote:
>> Hi on both endpoint i 've set mtomEnabled=true but issue is still the
>> same.
>> Only the proxied webservice is a multipart WS.
>> CxfSe component seems to send a wrong jbi message to cxf bc proxied
>> endpoint.
>> Instead of sending a jbi attachement for my fileattach element, coponent
>> is
>> sending element in jbi body message.
>>
>> Thanks for help.
>>
>> Here my configuration
>>
>> ...
>> <cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
>>                       locationURI="http://localhost:8080/test"
>>                       service="test:HelloOUTService"
>>                       endpoint="soap"
>>                        	/>
>>
>> .....
>> <cxfse:endpoint mtomEnabled="true"  >
>>         <cxfse:pojo>
>>           <bean class="org.apache.servicemix.test.HelloIn" >
>>           	<property name="myHelloOUT">
>>           		<cxfse:proxy  service="test:HelloOUTService" endpoint="soap"
>> context="#context" type="org.apache.servicemix.test.HelloOUT" />
>>        		</property>
>>           </bean>
>> ...
>>
>> Helloout WSDL
>>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>>     	<soap:binding style="document"
>> transport="http://schemas.xmlsoap.org/soap/http" />
>> 		<wsdl:operation name="SayHelloOUT">
>> 			<wsdl:input>
>> 				<mime:multipartRelated>
>>             				<mime:part>
>> 						<soap:body parts="request" use="literal" />
>> 				</mime:part>
>> 				<mime:part>
>>               					<mime:content part="fileattach" type="text/xml"/>
>>             			</mime:part>
>>           			</mime:multipartRelated>
>>
>> 			</wsdl:input>
>> 			<wsdl:output>
>> 				<soap:body use="literal" />
>> 			</wsdl:output>
>> 			<wsdl:fault name="UnknownWord">
>> 				<soap:fault use="literal" name="UnknownWord" />
>> 			</wsdl:fault>
>>        </wsdl:operation>
>> </wsdl:binding>
>>
>> <wsdl:service name="HelloOUTService">
>> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>>            <soap:address
>> location="http://localhost:8080/HelloOUTService/"
>> />
>>        </wsdl:port>
>> </wsdl:service>
>>   
> 
> 
> -- 
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Issue-Ussing-Service-Mix-CXF-component-with-multipart-WSDL-tp23428472p23502132.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
You need also add mtomEnabled="true" to your cxfse:proxy.
This is a new added feature so there is no apache servicemix release 
including it, try play with the latest FUSE ESB(FUSE ESB is based on 
apache servicemix and get released more frequently) from [1]
[1]http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/3.3.1.17-fuse/
Freeman

ppil1 wrote:
> Hi on both endpoint i 've set mtomEnabled=true but issue is still the same.
> Only the proxied webservice is a multipart WS.
> CxfSe component seems to send a wrong jbi message to cxf bc proxied
> endpoint.
> Instead of sending a jbi attachement for my fileattach element, coponent is
> sending element in jbi body message.
>
> Thanks for help.
>
> Here my configuration
>
> ...
> <cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
>                       locationURI="http://localhost:8080/test"
>                       service="test:HelloOUTService"
>                       endpoint="soap"
>                        	/>
>
> .....
> <cxfse:endpoint mtomEnabled="true"  >
>         <cxfse:pojo>
>           <bean class="org.apache.servicemix.test.HelloIn" >
>           	<property name="myHelloOUT">
>           		<cxfse:proxy  service="test:HelloOUTService" endpoint="soap"
> context="#context" type="org.apache.servicemix.test.HelloOUT" />
>        		</property>
>           </bean>
> ...
>
> Helloout WSDL
>  <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
>     	<soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http" />
> 		<wsdl:operation name="SayHelloOUT">
> 			<wsdl:input>
> 				<mime:multipartRelated>
>             				<mime:part>
> 						<soap:body parts="request" use="literal" />
> 				</mime:part>
> 				<mime:part>
>               					<mime:content part="fileattach" type="text/xml"/>
>             			</mime:part>
>           			</mime:multipartRelated>
>
> 			</wsdl:input>
> 			<wsdl:output>
> 				<soap:body use="literal" />
> 			</wsdl:output>
> 			<wsdl:fault name="UnknownWord">
> 				<soap:fault use="literal" name="UnknownWord" />
> 			</wsdl:fault>
>        </wsdl:operation>
> </wsdl:binding>
>
> <wsdl:service name="HelloOUTService">
> 	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
>            <soap:address location="http://localhost:8080/HelloOUTService/"
> />
>        </wsdl:port>
> </wsdl:service>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by ppil1 <pp...@ausy.org>.

Hi on both endpoint i 've set mtomEnabled=true but issue is still the same.
Only the proxied webservice is a multipart WS.
CxfSe component seems to send a wrong jbi message to cxf bc proxied
endpoint.
Instead of sending a jbi attachement for my fileattach element, coponent is
sending element in jbi body message.

Thanks for help.

Here my configuration

...
<cxfbc:provider mtomEnabled="true"  wsdl="classpath:service.wsdl"
                      locationURI="http://localhost:8080/test"
                      service="test:HelloOUTService"
                      endpoint="soap"
                       	/>

.....
<cxfse:endpoint mtomEnabled="true"  >
        <cxfse:pojo>
          <bean class="org.apache.servicemix.test.HelloIn" >
          	<property name="myHelloOUT">
          		<cxfse:proxy  service="test:HelloOUTService" endpoint="soap"
context="#context" type="org.apache.servicemix.test.HelloOUT" />
       		</property>
          </bean>
...

Helloout WSDL
 <wsdl:binding name="HelloOUTSOAPBinding" type="tns:HelloOUT">
    	<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="SayHelloOUT">
			<wsdl:input>
				<mime:multipartRelated>
            				<mime:part>
						<soap:body parts="request" use="literal" />
				</mime:part>
				<mime:part>
              					<mime:content part="fileattach" type="text/xml"/>
            			</mime:part>
          			</mime:multipartRelated>

			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
			<wsdl:fault name="UnknownWord">
				<soap:fault use="literal" name="UnknownWord" />
			</wsdl:fault>
       </wsdl:operation>
</wsdl:binding>

<wsdl:service name="HelloOUTService">
	<wsdl:port binding="tns:HelloOUTSOAPBinding" name="soap">
           <soap:address location="http://localhost:8080/HelloOUTService/"
/>
       </wsdl:port>
</wsdl:service>
-- 
View this message in context: http://www.nabble.com/Issue-Ussing-Service-Mix-CXF-component-with-multipart-WSDL-tp23428472p23498073.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Issue Ussing Service Mix CXF component with multipart WSDL

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Add mtomEnabled="true" to your cxf bc consumer/provider and cxf se 
endpoint configuration.
So that you can get the multiple part attachment instead of the base64 
binary encoded in your soap message...
Freeman
ppil1 wrote:
> Hi,
>
> i'm using servicemix r3.3 on windows platform, java 1.6.
> I'm using Servicemix CXF component.
>
> I'm calling an external service thru a cxf-se SU.
> SOAP CALL --> CXF BC --> CXF SE --> CXF BC >> External WS.
>
> My external WS is multipart, and i need to send a text/xml file attached.
>
> >From a java program using apache cxf it' s works perfectly; but from
> servicemix every part are serialized in soap:body (see soap enveloppe
> hereafter)
>
> Is there a way to workaround this ?
> Thanks
>
>
> Here soap enveloppe send from service mix
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>  <soap:Body>
>  <SayHelloOUT xmlns="http://servicemix.apache.org/test/types">
>   <name>mon nom</name> 
>   </SayHelloOUT>
>   <ns2:fileattach xmlns="http://servicemix.apache.org/test/types"
> xmlns:ns2="http://servicemix.apache.org/test">kljkljl</ns2:fileattach> 
>   </soap:Body>
>   </soap:Envelope>
>
> Here a correct soap send from stand alone java program using apache cxf
> --uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf
> Content-Type: text/xml
>
> <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><SayHello
> xmlns="http://servicemix.apache.org/test/types"
> xmlns:ns2="http://servicemix.apache.org/test"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:nil="true"/></S:Body></S:Envelope>
> --uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf
> Content-Id:<fi...@jaxws.sun.com>
> Content-Type: text/xml
> Content-Transfer-Encoding: binary
>
> <ns2:fileattach xmlns="http://servicemix.apache.org/test/types"
> xmlns:ns2="http://servicemix.apache.org/test">dklfjklklhjsdfhjslf</ns2:fileattach>
> --uuid:a1a9ac94-f059-4f6e-9a87-711b125957bf--
>
>
>
>
>   


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com