Hello,

I am a newbie in webservices, i have got a php sample for a soap-client but
don't know how to do it in java, here is the sample:

<?
$arr_soapClientOpt = array('exceptions' =>    0,
                           'login'      =>    $USERNAME,
                           'password'   =>    $PASSWORD,
                           'encoding'    =>    "ISO-8859-1",
                           'use'        =>    SOAP_ENCODED);
try {
    $client = new SoapClient($PATH_TO_WSDL, $arr_soapClientOpt);
} catch (SoapFault $fault) {
    // error Handling    
}

if (is_object($client)) {
    $client->__setCookie ("ID",$ID);
    $result = $client->test();
...

My attempt:

Call call;
try {
                        
String endpoint = "pathToEndpoint";
Service service = new Service();
call = (Call) service.createCall();
call.setTargetEndpointAddress (new java.net.URL (endpoint));
call.setUsername("username");
call.setPassword("password");
call.setProperty(HTTPConstants.HEADER_COOKIE, "ID=1");
QName operation = new QName("test");
Object[] params = new Object[] {};
String result = (String)call.invoke(operation, params);
                        } catch (Exception e) {
                                log.error("", e);
                        }

Could anyone please tell me if this right? 

Thanks!
-- 
View this message in context: 
http://old.nabble.com/given-php-sample---need-java-code-with-axis-tp26675338p26675338.html
Sent from the Axis - User mailing list archive at Nabble.com.

Reply via email to