2016-07-26 80 views
0

试图解决抱怨丢失MIME边界的问题。org.apache.cxf.interceptor.Fault:找不到MIME边界

我打电话给一个肥皂web服务,看起来像来自解析响应的异常?剂量谁知道任何可能的原因?

2016-07-25 18:39:51.373 +0000 [lcbatch-scheduler_Worker-1] [WARN] o.a.cxf.phase.PhaseInterceptorChain - Interceptor for {http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/}ErpIntegrationServiceService#{http://xmlns.oracle.com/apps/financials/commonModules/shared/model/erpIntegrationService/}uploadFileToUcm has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: Couldn't find MIME boundary: ------=_Part_679_384721743.1469471991267 
     at org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(AttachmentInInterceptor.java:60) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) 
     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) 
     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1641) 
     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1532) 
     at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) 
     at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) 
     at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652) 
     at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) 
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) 
     at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) 
     at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277) 
     at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) 
     at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) 
     at com.sun.proxy.$Proxy156.uploadFileToUcm(Unknown Source) 

阿帕奇CXF依赖我使用:

+- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.1.2:compile 
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:compile 
[INFO] | | +- org.apache.cxf:cxf-core:jar:3.1.2:compile 
[INFO] | | | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile 
[INFO] | | | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile 
[INFO] | | | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile 
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.1.2:compile 
[INFO] | | | +- org.apache.cxf:cxf-rt-wsdl:jar:3.1.2:compile 
[INFO] | | | | \- wsdl4j:wsdl4j:jar:1.6.3:compile 
[INFO] | | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.1.2:compile 
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.1.2:compile 
[INFO] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.1.2:compile 
[INFO] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:3.1.2:compile 
[INFO] | |  \- org.apache.cxf:cxf-rt-ws-policy:jar:3.1.2:compile 
[INFO] | |  \- org.apache.neethi:neethi:jar:3.0.3:compile 
[INFO] | \- org.apache.cxf:cxf-rt-transports-http:jar:3.1.2:compile 

回答

1

您正在接收多部分消息(如在https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html描述)。

您可以从验证标头“Content-Type”的值开始。它应该像

Content-Type : multipart/related; type="application/xop+xml"; boundary="----=_Part_679_384721743.1469471991267" 

然后,您可以检查的响应,这可能会给你缺少什么的想法的内容。 为了检查内容,您可以使用Wiremock作为代理来拦截通过网络传输的所有内容(http://wiremock.org/docs/proxying/)。比如,我最近做的是和Wiremock记录这对我来说

--uuid:0a6c8ffe-9f63-4fdb-a416-43acd1044b8b 
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml" 
Content-Transfer-Encoding: binary 
Content-ID: <[email protected]> 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body> <myxml>....</myxml></soap:Body></soap:Envelope> 
--uuid:0a6c8ffe-9f63-4fdb-a416-43acd1044b8b-- 

在我的情况下,UUID:0a6c8ffe-9f63-4fdb-a416-43acd1044b8b是MIME边界。