Reputation: 501
I developed a java soap client using cxf. this application works fine on mac where i run it with its included jdk v6. The service i create, for example uploads images to a magento installation but here I shall introduce the problem.
In Apache Cxf I turned of chunking to avoid "crippled" xml requests. Now I experienced that this my client-app won't run on linux distributions like ubuntu, because of the open jdk. I tested this on my mac by installing openjdk 7 and oracle jdk 7 and the same error appeared.
Still, I turned of chunking the request from the client gets sliced somewhere and the upload therefore fails.
I read this could be an issue with openjdk and some xml-libs, but i can't find any really precise or even helpful information about this topic.
Maybe someone of you might help me out.
Thanks in advance.
This is the request and the response:
ID: 5 Address: http://dev.magento.com/index.php/api/v2_soap/index/ Encoding: UTF-8 Content-Type: text/xml Headers: {Accept=[*/*], SOAPAction=[""]} Messages: Outbound Message (saved to tmp file): Filename: /var/folders/z6/91v2ntss00s1786v_1_5y2540000gn/T/cxf-tmp-636617/cos5007091721474555391tmp (message truncated to 102400 bytes) Payload: 552f069112dde557bc577735fc4eb8bf 5540 /9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gODAK/9sAQwAGBAUGBQQ -------------------------------------- 14168 [main] INFO org.apache.cxf.services.MagentoService.Mage_Api_Model_Server_Wsi_HandlerPort.Mage_Api_Model_Server_Wsi_HandlerPortType - Inbound Message ---------------------------- ID: 5 Response-Code: 200 Encoding: UTF-8 Content-Type: text/xml; charset=UTF-8 Headers: {Cache-Control=[max-age=31536000], connection=[close], Content-Length=[275], content-type=[text/xml; charset=UTF-8], Date=[Fri, 17 Aug 2012 12:52:16 GMT], Expires=[Sat, 17 Aug 2013 12:52:16 GMT], Server=[Apache], Vary=[Accept-Encoding]} Payload: 102 Ungültiger Bildtyp. --------------------------------------
Here is a trace:
javax.xml.ws.soap.SOAPFaultException: unsupported imagetype at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156) at $Proxy28.catalogProductAttributeMediaCreate(Unknown Source) at at.myproject.soap.service.product.media.ProductAttributeMediaServiceImpl.create(ProductAttributeMediaServiceImpl.java:61) at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.updateProduct(ProductSyncServiceImpl.java:275) at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.updateProducts(ProductSyncServiceImpl.java:185) at at.myproject.magento.service.sync.product.ProductSyncServiceImpl.syncronize(ProductSyncServiceImpl.java:145) at at.myproject.magento.scheduler.jobs.ProductSyncJob.execute(ProductSyncJob.java:21) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: org.apache.cxf.binding.soap.SoapFault: Ungültiger Bildtyp. at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46) at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1656) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1521) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1429) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:659) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) ... 8 more
Upvotes: 1
Views: 1505
Reputation: 501
I could resolve this issue by adding those libraries to my pom,
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.1</version>
</dependency>
, after consulting the FAQs of Apache's CXF.
I ran my integration test with use of OS X's latest jdk 6 and the new openjdk7 and oracle jdk7 .
Upvotes: 1