You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Hugo Solis <hu...@gmail.com> on 2011/09/20 06:17:06 UTC
Converting a Php example to Java
Hi guys,
I am working on a small project and i got stuck. THe only example I have uses Php for the client side. Now we want to port this client part to a Black Berry device so we need to
1) Translate this Php example to Java-Axis
2) Use Axis on a BlackBerry
If you have some time we would be very appreciated (enorumsly apprecaited)
Thanks
<?php
$userid = "XXX";
$secretkey = "AAA";
$timestamp = floor(microtime(true)*1000);
$signature = base64_encode(hash_hmac("sha256",$userid.$timestamp,$secretkey,true));
$wsdl = "https://STORE/2010-02-01/trackstoreservices.wsdl";
$endpoint = "https://STORE/2010-02-01/TrackStoreServices.service";
//echo "Soap PHP<br />\n";
// Soap connection - Trace is enable for debug purposes trace, remove for production
$objClient = new SoapClient($wsdl, array('trace' => true,'encoding'=>'ISO-8859-1'));
// Soap Header
$strHeaderComponent_Session = "<ns1:iMusicaHeader><ns1:UserID>$userid</ns1:UserID><ns1:Signature>$signature</ns1:Signature><ns1:TimeStamp>$timestamp</ns1:TimeStamp></ns1:iMusicaHeader>";
$objVar_Session_Inside = new SoapVar($strHeaderComponent_Session, XSD_ANYXML, null, null, null);
$objHeader_Session_Outside = new SoapHeader('www.imusica.com.br', 'iMusicaHeader', $objVar_Session_Inside);
// Saving request header
$objClient->__setSoapHeaders(array($objHeader_Session_Outside));
var_dump($objClient);
// Calling method
$objResponse = $objClient-> FindMobileTracksByStrSearch (array("Ini" => 0, "End" => 10, "order" => "alfdesc","strSearch" => "shakira"), array("location", $endpoint));
// echo $objClient->__getLastRequest() . "\n";
echo "<pre>";
var_dump($objResponse);
echo "</pre>";
?>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org