no save
Assistance
Achat
News

Forum | programmation
Soap Server PHP / cLIENT jAVA
Matt, le mer. 29 oct. 2008 à 12:16:03
Bonjour,
Je suis novice ds les webservice et mn tuteur de stage souhaite que je gere un SW entre 2 langage le php et le java.
Voici mon probleme: Je n'arrive pas a envoyer un parametre de mn code php vers mn service java.
Voici le code client php :


<?php
// Pull in the NuSOAP code

require_once('nusoap.php');

// Create the client instance

$wsdl='http://localhost:8080/axis2/services/WSTest?wsdl';
$namespace='http://server.ws.test.com/xsd';
$client=new soapclient($wsdl,true,$namespace);
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}

$send_string="Dingo";
echo"ccccccccc";
$soap_msg=new soapmsg( 'getUserID','urn:WSTest',array(new soapval($send_string, "string")));

echo"aaaaaaaaaaaaaaaaa";
$result=$client->call('getUserID',$soap_msg);
?>


code java :
package com.test.ws.server;

import java.util.Hashtable;

public class WSTest
{


public String getUserID(String login)
{
System.out.println("je suis la !!");
return "ID for user " + login+" : not implemented";
}
}

Serveur que j'ai crée car je ne dois pas utliser tomcat..:

package axis2;

import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.description.AxisService;
import org.apache.axis2.transport.http.SimpleHTTPServer;



public class EmbeddedAxis2Server {
public static void main(String[] args) throws Exception {
ConfigurationContext context = ConfigurationContextFactory.
createConfigurationContextFromFileSystem(null, null);
AxisService service =AxisService.createService(hello.HelloService.class.getName(),
context.getAxisConfiguration());
context.getAxisConfiguration().addService(service);
SimpleHTTPServer server = new SimpleHTTPServer(context, 8080);
server.start();
}
}



Merci de votre aide, je suis 1pe perdu!Configuration: Windows XP
Firefox 3.0.3
Eclipse
PHP5
Axis2
Version Web
Réalisé par RedShift
no save