wood burning stoves 2.0*
The moose likes Web Services and the fly likes Trouble with Axis Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Trouble with Axis" Watch "Trouble with Axis" New topic
Author

Trouble with Axis

Vladimir Bezugliy
Ranch Hand

Joined: Sep 29, 2004
Posts: 33
I've installed Axis under TomCat.
I've added xerces.jar into axis\WEB-INF\lib.

I tried to run the simplest example from tutorial - Calculator.jws


If I try to call this service from browser
http://localhost:8080/axis/Calculator.jws?method=add&i1=1&i2=2
all work OK.

But if I try to call this service from java code


then I've got next error

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:ivbezugliy

org.xml.sax.SAXParseException: Premature end of file.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
at org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLValidator.java:1550)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1149)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
at org.apache.axis.client.Call.invoke(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2413)
at org.apache.axis.client.Call.invoke(Call.java:2336)
at org.apache.axis.client.Call.invoke(Call.java:1793)
at samples.userguide.example2.CalcClient.main(CalcClient.java:46)
Exception in thread "main"


Where is mistake?
What do I do wrong?
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

My first guess would be that html, not soap is being returned. Are you sure you have the end point correct. It looks like you are trying to use the URL as the end point. I don't think that that is what you want.


Please ignore post, I have no idea what I am talking about.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

> call.setOperationName( method );

You need to put the name of the method you are trying to use here.
Vladimir Bezugliy
Ranch Hand

Joined: Sep 29, 2004
Posts: 33
Originally posted by William Barnes:
> call.setOperationName( method );

You need to put the name of the method you are trying to use here.


I pass its name as the parameter
java samples.userguide.example2.CalcClient add 2 5
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

If you call it like this

> java samples.userguide.example2.CalcClient add 2 5

what does this return?

> options.getPort()
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

Axis comes with a TCP monitor. Use that to see what is going over the line. I bet you are getting html back from your call. Soap engines don't like html.
Gautam Newalkar
Greenhorn

Joined: Mar 26, 2004
Posts: 4
I encountered the same problem. The solution is to make sure your using Java 1.4, not 1.5.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble with Axis