Skip to main content

Issue with Axis WS methods

1 reply [Last post]
Joined: 2010-08-12

I have written a web service, which accepts two strings as parameter(echoService method). And created WSDD file for the same and it works fine. Then I created a webservice which supports attachments, this code also works fine. When I merge this two WebServices and try to invoke "echoService" from client code, I am getting the following error. Type {ElementService}DataHandler is referenced but not defined.

I assume, its the problem with the wsdd file "typeMapping". Please let me know if I am right or wrong? Also let me know the solution for the same.


Code is below: (Web Service Code)

public class ElementService {

public String echoService(String command, String data) {
System.out.println("Echo Service [" + command + "] Data [" + Data + "]");
return "Success;

public Object getDimeData(DataHandler dh) throws InputValidationException, AttachmentServiceException {
MessageContext msgContext = MessageContext.getCurrentContext();
Message rspmsg = msgContext.getResponseMessage();"org.apache.axis.attachments.Attachments.SEND_TYPE_DIME : " + org.apache.axis.attachments.Attachments.SEND_TYPE_DIME);
int inputAttachmentType = rspmsg.getAttachmentsImpl().getSendType();"inputAttachmentType : " + inputAttachmentType);
if (inputAttachmentType != Attachments.SEND_TYPE_DIME) {
String failMsg = "Attachment passed is not a DIME attachment, please check.";
throw new InputValidationException("Invalid input data error : " + failMsg);

String inputStr = getInputString(dh);

//Do some process with the input String and construct an output String.
//Since the processing is out of context for our disucussion,
//just an output xml String from a file is returned.
String result = null;
try {
result = "Successfully Read the input file";
} catch (IOException e) {
String errorMsg = "Error occured while sending the output xml in DIME format.";
log.error(errorMsg, e);
throw new AttachmentServiceException(errorMsg, e);
}"setting the DIME type of attachment as the sender sends it as DIME.");

ByteArrayDataSource dataSource = new ByteArrayDataSource(result, "UTF-8");
dh = new DataHandler(dataSource);
return dh;

deploy.wsdd file

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2010-09-07

Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc. The current version of Axis is written in Java, but a C++ implementation of the client side of Axis is being developed.


Want to get-on Google's first page and loads of traffic to our website? Hire a SEO Specialist from Ocean Groups[url=] seo specialist [/url]