FAQ Database Discussion Community

Consecutive calls to 'SOAPMessage.writeTo' throw Read Error

SOAP message in my application contains an attachment created from a file. When I give a call to soapMessage.writeTo(System.out); for more than single time, it throws following exception : SEVERE: SAAJ0540: Error during saving a multipart message com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.writeTo(MessageImpl.java:1233) at main.SOAPMTOMUtilityTest.main(SOAPMTOMUtilityTest.java:102) Caused by:...

SOAP Client, Following an example

I need to consume a SOAP Server named "Mouser" for my company. However I have a problem when I try to send a message. The documentation of my request is : POST /service/searchapi.asmx HTTP/1.1 Host: www.mouser.fr Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Header> <MouserHeader...