SOAP : PHP client /Java server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Benoît

    #1

    SOAP : PHP client /Java server

    Hi,
    I have a problem with the string array type. I want to send a string
    array from the php client to the java server (Webservice with SOAP).

    Here is the code :
    ----- Java server method : -----

    public String[] crypte(String[] message, String name) throws
    RemoteException {
    String[] messageFinal = new String[message.length];

    [...]

    return messageend;

    }catch(Exceptio n e){
    throw new RemoteException (e.getMessage() , e);
    }
    }

    ----- PHP client : -----
    $message= array ("aze","sdsq"," jhgjhgh");
    $wsdl = new SOAP_WSDL($url) ;
    $client= $wsdl->getProxy();
    [...]
    $messageCrypte = $client->crypte($messag e, "test");

    ------------------------
    It works very well with a simple String, for example :
    $message="jkjhk j"; with
    public String[] crypte(String message, String name){...}

    but not with a string array. Java doesn't recognise this type.The error
    :

    "JAXRPCTIE0 1: caught exception while handling request: unexpected
    element type:
    expected={http://mywebservice/...}StringArray ,actual={http://mywebservice/...}Array"

    It works well in the other sens : PHP recognise a string array returned
    by the java server : print_r($messag eCrypte).

    Thanks for your help.

Working...