SOAPAction header for http post request
I tried to send my soap message using both soapconnectionfactory and http post. The soapconnection worked yestersday but it wont work nomore. im nt sure its the server problem or my problem. so i tried to use http post method and im told that i need to introduce soapaction in the header of the request message.
Here is some of my code:
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPPart part = message.getSOAPPart();
SOAPEnvelope env = part.getEnvelope();
MimeHeaders headers = message.getMimeHeaders();
headers.addHeader("SOAPAction", "");
Here is what the msg looks like:
POST /StockQuote HTTP/1.1
Content-Type: text/xml; charset="utf-8"
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><m:render xmlns:m="http://wit.shef.ac.uk:8080/com4280/Visualisation.jws"><userpass>somekey</googleApiKey></m:render><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>The message is not attached with the xml file</faultstring><detail><m:render xmlns:m="http://wit.shef.ac.uk:8080/com4280/Visualisation.jws">XML file is not included</m:render></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
I get error saying no soapaction was included
ok so i edited the soap message manually
POST /StockQuote HTTP/1.1
Content-Type: text/xml; charset="utf-8"
SOAPAction: ""
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><m:render xmlns:m="http://wit.shef.ac.uk:8080/com4280/Visualisation.jws"><userpass>40137337-684654</userpass><googleApiKey>somekey</googleApiKey></m:render><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>The message is not attached with the xml file</faultstring><detail><m:render xmlns:m="http://wit.shef.ac.uk:8080/com4280/Visualisation.jws">XML file is not included</m:render></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
and i still get the same error
Im wondering where should i get the soapaction to
p.s. there is a attachment aa well in the msg which is an XML file and i put soapaction in that as well