Dear Firiends,
I am facing a strange issue with my
Java web service client. My findings are; whenever I send attachment more than 1 MB it give 400 Bad request (HTTP) error, small attachmets are working fine. The web service here i am using is .NET based and using a .NET client am able to attach more than 1 MB, but not from my Java client. Below is the snippet of the code to send attachment using Axis 1.4
This issue is coming production so i need to fix it urgently, looking forward for some useful information

Thank
===========
public java.lang.String hellowWorld(List files,java.lang.String nocxml) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("
http://tempuri.org/testService/hellowWorld");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("
http://tempuri.org/testService", "hellowWorld"));
_call.setProperty(org.apache.axis.client.Call.ATTACHMENT_ENCAPSULATION_FORMAT,
org.apache.axis.client.Call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);
DataSource ds = null;
DataHandler dh = null;
if(files != null && files.size() > 0){
Iterator itrFiles = files.iterator();
int _i = 0;
while(itrFiles.hasNext()){
File fileObj = (File)itrFiles.next();
ds = null;
dh = null;
File f =(File)files.get(_i);
_i++;
if(fileObj.isFile())
{
System.out.print("file is there -----------------------");
ds = new FileDataSource(fileObj);
dh = new DataHandler(ds);
org.apache.axis.attachments.AttachmentPart ap = new org.apache.axis.attachments.AttachmentPart(dh);
ap.setContentType("application/octet-stream");
ap.setContentId(fileObj.getName());
_call.addAttachmentPart(ap);
}
}
}
setRequestHeaders(_call);
setAttachments(_call);
try {
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {nocxml});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (java.lang.String) _resp;
} catch (java.lang.Exception _exception) {
return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
axisFaultException.printStackTrace();
throw axisFaultException;
}
}
==========
Below is the error i am getting
|AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (400)Bad Request
faultActor:
faultNode:
faultDetail:
{}:return code: 400
{http://xml.apache.org/axis/}HttpErrorCode:400
(400)Bad Request
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
...........
=========