Hello.
I upgraded to CXF 3.1.8 but still problems.

I can bypass, somehow, by re-setting the MessagePart index to -1 but then
Holders give strage results and are unusable (null o object address and
classCastException if I use them)

Is JAX-WS with SwA functioning properly with multiple Holders?

Look to me that values aren't assigned correctly (beside the fact that the
interceptor fails)

Any hints on using this stategy ?

Diego




2016-11-02 11:06 GMT+01:00 Diego Pietralunga <[email protected]>:

>
> 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(Phase
> InterceptorChain.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(CacheA
> ndWriteOutputStream.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$MessageS
> enderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
>     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(Phase
> InterceptorChain.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