axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe <berip...@yahoo.com>
Subject Service returns null always
Date Tue, 17 Sep 2002 01:38:46 GMT
Hi,

I have a service set up; ServerService.

Below is my client code, server code (temporary) and
TCPMon results. The ServerServer class is supposed to
return "Sweet as" every time processRequest(String s)
is called. Instead of this, the client code returns
null every single time instead of "sweet as".

Shouldn't I be getting an exception if something is
wrong? And since nothing is wrong why am I getting
null returned every time?

//Client code:

  public static void main(String[] args) {
    ServerServiceService serviceLocator = new
ServerServiceServiceLocator();
    try {
      //ServerService server =
serviceLocator.getServerService();
      URL url = new
URL("http://localhost:100/axis/services/ServerService");
      ServerService server =
serviceLocator.getServerService(url);
      Workflow wf = new Workflow();
      wf.setName("THIS IS MY NAME");
      System.out.println("Workflow: " +
server.addWorkflow(wf));
      System.out.println("Success: " +
server.processRequest("Boogie"));
    }
    catch(Exception e) {
      System.out.println("Exception: " +
e.getMessage());
    }
    /*
    catch(ServiceException se) {
      System.err.println(se.getMessage());
    }
*/
  }

Server code:

public class ServerService {
  private Server server;

  public ServerService() {
    server = new Server();
  }

  public String processRequest(String request) {
    //server.processRequest()
    return "Sweet as";
  }
}

POST /axis/services/ServerService HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime,
multipart/related, text/*

User-Agent: Axis/beta3

Host: localhost

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 461

Monitoring in TCPMon:

Request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:processRequest
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:ServerService">
   <request xsi:type="xsd:string">Boogie</request>
  </ns1:processRequest>
 </soapenv:Body>
</soapenv:Envelope>

Response:
HTTP/1.1 200 OK

Content-Type: text/xml; charset=utf-8

Connection: close

Date: Tue, 17 Sep 2002 01:23:45 GMT

Server: Apache Tomcat/4.0.4 (HTTP/1.1 Connector)

Set-Cookie:
JSESSIONID=B49F1A3F0A08D12CA62A8FCC176EDCA5;Path=/axis



<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns1:processRequestResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:ServerService">
   <processRequestReturn xsi:type="xsd:string"
xsi:nil="true"/>
  </ns1:processRequestResponse>
 </soapenv:Body>
</soapenv:Envelope>


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

Mime
View raw message