aspose file tools*
The moose likes Web Services and the fly likes Axis Fault Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis Fault" Watch "Axis Fault" New topic
Author

Axis Fault

shelly sharma
Ranch Hand

Joined: Sep 17, 2003
Posts: 32
I had compiled a portfolio web service. It is also deployed.But when i tried to test that service then the following error is coming:
Fault - ; nested exception is:
org.apache.axis.InternalException: java.lang.Exception: Method 'portfolio' does not match any of the valid signatures for message-style service methods
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.apache.axis.InternalException: java.lang.Exception: Method 'portfolio' does not match any of the valid signatures for message-style service methods
faultActor:
faultNode:
faultDetail:
can anybody could tell me that how can i correct this problem.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What's your method signature like? Have you tried all four signatures (Axis claims to support four different type of document-style method signatures)?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
shelly sharma
Ranch Hand

Joined: Sep 17, 2003
Posts: 32
I had used the message signature as follows in the portfolio.java file:
public static Element[] portfolio(Vector xmlDocument) throws Exception
{
Document requestMessage =
((Element)xmlDocument.get(0)).getOwnerDocument();
Document responseMessage = (Document)requestMessage.cloneNode(true);
Element[] result = new Element[1];
result[0] = portfolio(requestMessage.getDocumentElement(),
responseMessage.getDocumentElement());
return result;
}
Is there any mistake in the syntax of the message signature.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
From the Axis User Guide:
There are four valid signatures for your message-style service methods:
public Element[] method(Element[] bodies);
public SOAPBodyElement[] method (SOAPBodyElement[] bodies);
public Document method(Document body);
public void method(SOAPEnvelope req, SOAPEnvelope resp);
The first two will pass your method arrays of either DOM Elements or SOAPBodyElements - the arrays will contain one element for each XML element inside the <soap:body> in the envelope.
The third signature will pass you a DOM Document representing the <soap:body>, and expects the same in return.
The fourth signature passes you two SOAPEnvelope objects representing the request and response messages. This is the signature to use if you need to look at or modify headers in your service method. Whatever you put into the response envelope will automatically be sent back to the caller when you return. Note that the response envelope may already contain headers which have been inserted by other Handlers.
Femi Byte
Ranch Hand

Joined: Jul 09, 2004
Posts: 40
This is late, but the fix for this problem is as follows:

public static Element[] portfolio(Element[] xmlDocument) throws Exception
{
//Document requestMessage =
((Element)xmlDocument.get(0)).getOwnerDocument();
Document requestMessage = xmlDocument[0].getOwnerDocument();
Document responseMessage = (Document)requestMessage.cloneNode(true);
...

}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis Fault