Thanks a lot. This is what I'm looking for to get the attachment from the
client. ((BindingProvider)proxy).getRequestContext().get("ATTACHMENTS");
It was a third party web service. I have already have the interceptor but I
did not know how to get the attachment back to the client.
This will solve my problem.
--Thanks
Vijay
On 4/4/08 12:15 PM, "Daniel Kulp" <[EMAIL PROTECTED]> wrote:
>
> Ick... If their wsdl properly declared the attachments like a good
> contract would, it would be easy as the generated code would just handle
> it.
>
> I just spent some time trying to figure out something and I'm not
> succeeding unless you write an interceptor. The Message object sent
> into an interceptor has the attachements collection on it. Thus, if
> you did something like:
>
>
> public static class MyInterceptor
> extends AbstractPhaseInterceptor<Message> {
>
> public MyInterceptor() {
> super(Phase.USER_LOGICAL);
> }
>
> public void handleMessage(Message message) throws Fault {
> message.put("ATTACHMENTS", message.getAttachments());
> }
> }
>
> That will copy the attachment list to the message properties and you can
> then retrieve it in the client code like:
>
> ((BindingProvider)proxy).getRequestContext().get("ATTACHMENTS");
>
>
> Dan
>
>
>
> On Friday 04 April 2008, Vijay Allam wrote:
>> In this case I do not have element that represents the attachment in
>> WSDL. It comes as part of the Soap message as multi part attachment.
>> So not sure how do I get the attachment. I could only find code that
>> can easily get attachment using axis1.1 for the request.
>>
>> --Vijay
>>
>> On 4/3/08 7:58 PM, "Freeman Fang" <[EMAIL PROTECTED]> wrote:
>>> Hi Vijay,
>>>
>>> We have mtom demo in the kit, which shows how SOAP message
>>> with an attachment and XML-binary Optimized Packaging(mtom) work.
>>>
>>> Regards
>>>
>>> Freeman
>>>
>>> Vijay Allam wrote:
>>>> I have a third part webservice that returns an attachment. How do I
>>>> get the attachment with CXF client. Any example code is apreciated.
>>>>
>>>> --Vijay
>
>