axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Jacobson" <>
Subject help with Axis fault
Date Sat, 29 May 2004 17:07:47 GMT

OK, I've been working on this for...well, I'm embarrassed to say exactly how long, but, needless
to say, I've been working on this for a while...

I'm a major newbie to the whole environment so my error is probably a basic one but one that
I can nevertheless figure out.  I would be quite grateful to anyone who could assist...

Here's the deal:

I am just trying to create a test web service.  I have successfully run the userguide examples
but I can't get my own web service to run.  I have a .jsp script on the client side that calls
a web service.  The web service operation returns a string but I am getting an axis fault
error message.  I think the problem has to do with the namespace.  I am only running this
on localhost.  I wasn't sure what to put for the namespace.

I attached:

- tcpmon input and output
- client code
- wsdl file

If there are other things that would be helpful to include I would be glad to post additional

I ran tcpmon on the port that I deployed the web service.  I was running everything on port
8081 but to setup TCPMonitor I deployed the web service on port 8081 and then configured Tomcat
to run on port 4200.  Then I target the browser to port 4200 and TCPMonitor redirects the
web page to port 8081.  At least that is what I hope it is doing.

Here is the input as recorded by TCPMonitor:

POST /axis/services/MyService HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1
Host: localhost
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 558

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd=""
  <ns1:testOperationName soapenv:encodingStyle=""
   <sMonth xsi:type="xsd:string">3</sMonth>
   <sYear xsi:type="xsd:string">2004</sYear>
   <sTimeZone xsi:type="xsd:string">EST</sTimeZone>

and here is the output as recorded by TCPMonitor:

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml;charset=utf-8
Date: Sat, 29 May 2004 16:31:58 GMT
Server: Apache-Coyote/1.1
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:xsd=""

The client .jsp code looks like this:

<%@ page language="java" org.apache.axis.client.Call, org.apache.axis.client.Service, javax.xml.namespace.QName,
org.apache.axis.AxisFault" %>
<%@ page import="java.util.*" %>

String sRetrieve =  request.getParameter("retrieve");
String sReturn = "";
String sMonth = "3";
String sYear = "2004";

//This is the URL of the webservice on my PC
String sEndpoint = "http://localhost:8081/axis/services/MyService";

 Service  service = new Service();
 Call     call    = (Call) service.createCall();

 call.removeAllParameters() ;
 call.setReturnType( org.apache.axis.Constants.XSD_STRING );
 call.setTargetEndpointAddress( new sEndpoint ) );
 call.setOperationName(new QName("MyService", "testOperationName") );
 call.addParameter("sMonth", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
 call.addParameter("sYear", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
 call.addParameter("sTimeZone", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
 sReturn = (String) call.invoke( new Object[] { sMonth, sYear, "EST" } );

Here is what the wsdl looks like at http://localhost:8081/axis/services/MyService?wsdl

  <?xml version="1.0" encoding="UTF-8" ?> 
- <wsdl:definitions targetNamespace="http://localhost/axis/services/MyService" xmlns=""
xmlns:apachesoap="" xmlns:impl="http://localhost/axis/services/MyService"
xmlns:intf="http://localhost/axis/services/MyService" xmlns:soapenc=""
xmlns:tns1="" xmlns:tns2="" xmlns:tns3=""
xmlns:wsdl="" xmlns:wsdlsoap=""
- <wsdl:types>
- <schema targetNamespace="" xmlns="">
  <import namespace="" /> 
- <complexType name="ClassName">
- <sequence>
  <element name="BVariable" type="xsd:boolean" /> 
- <wsdl:message name="testOperationNameRequest">
  <wsdl:part name="p_selectedMonth" type="xsd:string" /> 
  <wsdl:part name="p_selectedYear" type="xsd:string" /> 
  <wsdl:part name="p_timeZone" type="xsd:string" /> 
- <wsdl:message name="testOperationNameResponse">
  <wsdl:part name="testOperationNameReturn" type="xsd:string" /> 
- <wsdl:operation name="testOperationName" parameterOrder="p_selectedMonth p_selectedYear
  <wsdl:input message="impl:testOperationNameRequest" name="testOperationNameRequest" />

  <wsdl:output message="impl:testOperationNameResponse" name="testOperationNameResponse"
- <wsdl:operation name="testOperationName">
  <wsdlsoap:operation soapAction="" /> 
- <wsdl:input name="testOperationNameRequest">
  <wsdlsoap:body encodingStyle="" namespace=""
use="encoded" /> 
- <wsdl:output name="testOperationNameResponse">
  <wsdlsoap:body encodingStyle="" namespace="http://localhost/axis/services/MyService"
use="encoded" /> 

(Note that I removed a bunch of things from the wsdl file that were not related to this operation.
 I hope I didn't remove something necessary to decipher what the problem is.)

Thanks in advance,
View raw message