wood burning stoves*
The moose likes Web Services and the fly likes web service with attachment under java 1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "web service with attachment under java 1.6" Watch "web service with attachment under java 1.6" New topic
Author

web service with attachment under java 1.6

ivan stefko
Greenhorn

Joined: Jan 18, 2010
Posts: 12
hi all,
i'm trying to develop web service with attachment but i have a problem and i don't know where..

so server side:


if i deploy this web service to server (tomcat 5.5.25) and use soapUI application as client for test ... everything is OK... web service gets me 3 attachments.

so.. i need to have a look to client side:


if i run this client ... code ends with this error (- call this method: SOAPMessage response = connection.call(message, endpoint)):

EVERE: Generating fault class
AxisFault
faultCode: {http://xml.apache.org/axis/}Client.NoSOAPAction
faultSubcode:
faultString: no SOAPAction header!
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:no SOAPAction header!
at org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:1013)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:678)
....................

no SOAPAction header!
at org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:1013)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:678)
...................


-----------------------------------------------------------
develop IDE: eclipse
jar file in classpath: activation.jar, axis.jar, commons-discovery-0.2.jar, commons-logging.jar, jaxrpc.jar, mailapi_1_3_1.jar, saaj.jar, webserviceutils.jar, wsdl4j-1.5.1.jar


thanks for any help!

i.
ivan stefko
Greenhorn

Joined: Jan 18, 2010
Posts: 12
i already find the solution. is necessary to add this code to client:

MimeHeaders hd = message.getMimeHeaders();
hd.addHeader("SOAPAction", "urn:yoursoapaction");

more
See http://users.skynet.be/pascalbotte/rcx-ws-doc/saajpost.htm for a
sample SAAJ client.
 
Consider Paul's rocket mass heater.
 
subject: web service with attachment under java 1.6
 
Similar Threads
how to set an attribute like SOAPAction in the Header?
problem with SOAP attachments using JAXM
simple SOAP Request/Response
webservice package javax.xml.soap does not exist
ayyappa1