Guys,
please forget about my problem. It was somehow personal stupidity. we
have one single servlet, that is handling all requests. Before trying to
unmarshal the multipart request, we had something that was checking the
request for multipart content. Before using swa there were also html
form submits handled by this servlet. So if the request was multipart,
we tried to get the FileItemIterator. but the method that checks for
FileItems fully reads the InputStream. So, even when there were no
FileItems (thus we have a multipart/related request, and not
multipart/form-data), the InputStream is empty. Now, we just check for
an explicit multipart/form-data to avoid this problem.
So in the end, it was not a bug in saaj but my very own problem...
Sorry for assuming otherwise!
thanks again for your help!
alex
Alex Hepp schrieb:
> Dloy... Thanks for your answer. The thing is, I am using jax-ws. I
> sniffed the sent message via fiddler proxy on localhost, and it seemed
> to be correctly sent (including all the needed headers).
>
> Unfortunately I went back to a test version without swa for now, and
> will firstly have to get this working to commit it to cvs before I can
> try out the multipart again to show you the message exactly. Could
> there perhaps be a problem with encoding, so that the
> MimeMultipart#parse doesn't correctly detect the newlines? just a
> shot, since I don't set the encoding in jax-ws. All I do is generate
> my sources (the whole web service client) from wsdl. If we find out,
> that your solution is correct, we might have to inform jax-ws as well
> that they would need to change their use of saaj.
>
> Again thx for all your quick help!
> Alex
>
> dloy schrieb:
>> Hi Alex
>> An apology to the list for not saving my resolution on this problem.
>>
>> An earlier version of saaj allowed soapMessage.saveChanges() to be
>> issued BEFORE adding the attachment. This changed in later versions
>> of saaj and the version saved to java 1.6. You can still add the
>> attachment after the saveChanges(). Now however the multipart header
>> is not sent even though the format contains the attachment. This
>> causes the exception. By no longer issuing the saveChanges() my code
>> now works.
>>
>> Thanks
>> David
>>
>> Alex Hepp wrote:
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_saaj.dev.java.net
> For additional commands, e-mail: users-help_at_saaj.dev.java.net
>
>