• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSWS3192E: Error: return code: ( 400 ) Bad Request when trying to invoked webservice

Bharatwaj Vedantham
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am getting the below error when i try to invoke a webservice. The webservice call works fine when i dont add the attachment part in the handleRequest().

I have replaced the asmx link and fault actor ip with some random string below.

[27/01/10 12:06:13:915 GMT] 00000048 HttpOutboundC E WSWS3514E: No HTTP response body is available from the connection for: http://xxx/abc/abc.asmx
[27/01/10 12:06:14:118 GMT] 00000048 PivotHandlerW W org.apache.commons.logging.impl.Jdk14Logger warn WSWS3734W: Warning: Exception caught from invocation to com.ibm.ws.webservices.engine.transport.http.HTTPSender:
faultCode: HTTP
faultString: ( 400 ) Bad Request
faultActor: http://xxx
null: WSWS3192E: Error: return code: ( 400 ) Bad Request

( 400 ) Bad Request
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.processStatusCode(HTTPSender.java:1104)
at com.ibm.ws.webservices.engine.transport.http.HTTPSender.invoke(HTTPSender.java:729)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:152)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:227)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:332)
at com.

Please find below the code snippet. Could somebody please advice if I am missing to add something more to the message?

I am using JAX-RPC.

My main objective is to send a rtf as a part of the SOAPMessage (first commented piece code) but the MIME type does not seem to supported. The webservice expects the rtf as soap attachment and processes it. Could somebody also advice how to add word document to attachment part?

public boolean handleRequest(MessageContext messageContext){
LOG.trace("Entered method - handleRequest");
SOAPMessageContext smc = (SOAPMessageContext) messageContext;
SOAPMessage msg = smc.getMessage();
SOAPPart part = msg.getSOAPPart();

try {

// Dig down into the message, locate or create header block.
SOAPEnvelope envelope = part.getEnvelope();

// Get or create a SOAP header, only one allowed per message
SOAPHeader header = msg.getSOAPHeader();
if (header == null) {
header = envelope.addHeader();

// Add Root Header for Trace Id
SOAPElement tiHeaderRoot = header.addChildElement(HEADER_ROOT,

// Add Child Header for Trace Id
SOAPElement tiHeaderElement = tiHeaderRoot.addChildElement(

//Add attachment part to the message
AttachmentPart attachmentPart = msg.createAttachmentPart();

LOG.trace("Attachment content is" + getDocumentByteArray());

DataHandler dataHandler = new DataHandler(new String("abc"),"text/plain");

// if (null != getDocumentByteArray()){
// attachmentPart.setContent(getDocumentByteArray(), application/msword");
// msg.addAttachmentPart(attachmentPart);
// }

// if (null != getDocumentByteArray()){
// attachmentPart.setContent("textplain", "text/plain");
// msg.addAttachmentPart(attachmentPart);
// }

} catch (SOAPException soapException) {
throw new RBSGSystemException(InterviewMessageKey.cc_46, soapException);
LOG.trace("Exited method - handleRequest");
return super.handleRequest(messageContext);


Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic