Hello All,

 

Please forgive me for invoking the powers of the [URGENT] tag.  I promise I have only done this twice in my life, and the other time was either to save a life, or get sex.

 

I have a PHP based SOAP Webservice available at http://www.totallyawesome.org/php/test.php.  This service is a test of getting Java to be able to request information, and receive a response.  The method “queryLogin” receives three parameters: accesspassword, username, and password.  The method does no processing.  It only returns the string value “test.”

 

With my Java example, I can post information to the service, and have it parsed.  The three values can be written out to a file from PHP wonderfully.  Therefore, we know the Java -> PHP communication is fine.

 

What is not fine is the response.  No matter what we try, NULL is always returned.  I’ve attempted several different things, but know I’m missing something simple.  Please help in any way possible.  I need to have this running by 9am tomorrow morning, or as soon thereafter as possible.  Please send any knowledge my way as to what might be wrong.  Axis has helped a lot, but we are still not quite there.

 

 

The Java source is as follows.

 

import org.apache.axis.client.Call;

import org.apache.axis.client.Service;

 

import javax.xml.namespace.QName;

 

public class TestMe2 extends Object

{

  public static void main(String[] args)

  {

    Call call = null;

    try

    {

      String endpoint = "http://www.totallyawesome.org/php/test.php";

 

      Service service = new Service();

      call = (Call) service.createCall();

 

      call.setTargetEndpointAddress(new java.net.URL(endpoint));

      call.setOperationName(new QName("tempuerri", "queryLogin"));

 

      call.addParameter("accesspassword", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

      call.addParameter("username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

      call.addParameter("password", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);

      call.setReturnType(org.apache.axis.Constants.XSD_STRING);

 

      call.setReturnClass(String.class);

 

      System.out.println("Invoking.");

 

      String ret = (String) call.invoke(new Object[] { "ERIC", "VASS", "bradley" });

 

      System.out.println("Sent message, got '" + ret + "'");

    }

    catch (Exception e)

    {

      System.err.println(e.toString());

      e.printStackTrace(System.err);

    }

  }

}

 

The PHP file is using nusoap version 0.6.3 and 0.6.5.

 

<?php

require_once('nusoap.php');

$NAMESPACE = 'tempuri';

$s = new soap_server;

$s->debug_flag=false;

$s->configureWSDL('SOAPService', $NAMESPACE);

$s->wsdl->schemaTargetNamespace = $NAMESPACE;

$s->register(

            'queryLogin',

            array('parameters'=>'tns:queryLogin'),

            array('parameters'=>'tns:queryLoginResult'),

            $NAMESPACE);

function queryLogin($accesspassword,$username,$password){

            // check database for login

            // if login is available, return "true" otherwise return an error message.

            return "true";

}

$HTTP_RAW_POST_DATA = isset($GLOBALS['HTTP_RAW_POST_DATA'])

                        ? $GLOBALS['HTTP_RAW_POST_DATA'] : '';

$s->service($HTTP_RAW_POST_DATA);

?>

 

 

Lukas

 

Reply via email to