Hello everyone.
First post and getting acquainted with CXF.

I'm having troubles with a WS client call to a remote service (which I
don't own) that uses attachments. I think the name/scope is Swa but Iìm a
little confused by naming (Swa, SAAJ...)

My setup is Apache CXF 3.0.10, Linux, JDK 1.7.0_79

The problem is kind of faceted and a did some debug on cxf too.

I have the service wsdl, which uses mime:multipart (related)... the
service(s) usually return a SOAP message and a XML attached file.

SOAP message has things like OK/KO and found entries, while attached file
has actual detail data (XML).

wsdl excerpt:
********
<operation name="companySearch">
                        <soap:operation soapAction=""/>
                        <input name="companySearchInput">
                                <soap:body use="literal"/>
                        </input>
                        <output name="companySearchOutput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body parts="part0"
use="literal"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content
part="attachment" type="text/xml"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </output>
                </operation>

********
I'm not completely sure the wsdl is built ok... but that's what I got from
client...

For starters, i generated Java code via Wsdl2java using params "  -
autoNameResolution  -client " file.wsdl
Note: using "-verbose" I get " methodXXX cannot be unwrapped, input and
output messages (if present) must contain only a single part" on the methods

This generate jax-ws "Holders"... ancd a basic client.

So... first thing:

if I use a standard (?) setup and call I get a stacktrace (on any remote
method call) for an array overflow
"Standard", means no incoming interceptors added by me programmatically

****
WARNING: Interceptor for (XXX method) has thrown exception, unwinding now
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)
    at java.util.ArrayList.get(ArrayList.java:411)
    at org.apache.cxf.message.MessageContentsList.get(MessageContentsList
.java:80)
    at org.apache.cxf.jaxws.interceptors.HolderInInterceptor.handleMessage(
HolderInInterceptor.java:69)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:802)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
handleResponseInternal(HTTPConduit.java:1673)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.
handleResponse(HTTPConduit.java:1551)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
HTTPConduit.java:1348)
    at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(
CacheAndWriteOutputStream.java:56)
    at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream
.java:215)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit
.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$
MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor
.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy
.java:138)
****

This looks a message/mime parsing problem, to me.
I have used custom interceptors to handle... somehow....  this but I'd like
to know if I'm doing something wrong from the start.
To avoid clutter I just paste the content type of the response

content-type=[multipart/related; type="text/xml";
start="<70088E9547A63E75E4EB76AF7895EDCD>";
boundary="----=_Part_583_1727905182.1478080096284"

but I can post/link the whole message on request.

(This is the first part of the problem... I have more to come, like
malfunctioning Holders and MIME boundaries not found... in my custom
interceptors, which when added, go past this)

Can you suggest how to handle these calls on the remote service?

Thanks a lot.

Diego

Reply via email to