"The directory \"" + filename + "\" has no files to send.");
}
Service service = new Service(); //A new axis Service.
Call call = (Call) service.createCall(); //Create a call to the service.
/*Un comment the below statement to do HTTP/1.1 protocol*/
//call.setScopedProperty(MessageContext.HTTP_TRANSPORT_VERSION,HTTPConstants.HEADER_PROTOCOL_V11);
Hashtable myhttp= new Hashtable();
myhttp.put("dddd","yyy"); //Send extra soap headers
myhttp.put("SOAPAction","dyyy");
myhttp.put("SOAPActions","prova");
/*Un comment the below to do http chunking to avoid the need to calculate content-length. (Needs HTTP/1.1)*/
//myhttp.put(HTTPConstants.HEADER_TRANSFER_ENCODING, HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED);
/*Un comment the below to force a 100-Continue... This will cause httpsender to wait for
* this response on a post. If HTTP 1.1 and this is not set, *SOME* servers *MAY* reply with this anyway.
* Currently httpsender won't handle this situation, this will require the resp. which it will handle.
*/
//myhttp.put(HTTPConstants.HEADER_EXPECT, HTTPConstants.HEADER_EXPECT_100_Continue);
call.setScopedProperty(HTTPConstants.REQUEST_HEADERS,myhttp);
call.setTargetEndpointAddress( new URL(opts.getURL()) ); //Set the target service host and service location,
call.setOperationName( new QName("urn:EchoAttachmentsService", "echoDir") ); //This is the target services method to invoke.
QName qnameAttachment = new QName("urn:EchoAttachmentsService", "DataHandler");
call.registerTypeMapping(attachments[0].getClass(),//Add serializer for attachment.
qnameAttachment,
JAFDataHandlerSerializerFactory.class,
JAFDataHandlerDeserializerFactory.class);
call.addParameter( "source", XMLType.SOAP_ARRAY , // new XMLType(qnameAttachment),
ParameterMode.IN ); //Add the file.
call.setReturnType(XMLType.SOAP_ARRAY); // new XMLType(qnameAttachment));
call.setUsername( opts.getUser());
call.setPassword( opts.getPassword() );
if(doTheDIME)
call.setProperty(call.ATTACHMENT_ENCAPSULATION_FORMAT,
call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);
Object ret = call.invoke( new Object[] {
attachments
}
); //Add the attachment.
if (null == ret) {