aloashbei.com.bd – SOAP Service and API Issue

Many devPeople trying to access Grameen Phone aloashbei DOT NET SOAP Service through their API. Hence their documentation is not well organized, many newbies are getting trouble to access their SMS server thorugh PHP, JAVA along with other languages. I will try to explain here the reason for the accessing difficulties.
For the test case, we will take LBS (Location Bases Service) out of other 3 services for the easiness to figure out the problem.

In LBS, there is a function provided to retrieve current location of the registered mobile number of AA platform developer. It is requestLocation(). In PHP, We can create a SOAP client easily by passing the WDSL to the Soap object.

$soap_url='http://sandbox.kernelbd.com/gp/GP.ADP.BizTalk.LBS.Orchestration/WebService_GP_ADP_BizTalk_LBS_Orchestration.asmx?wsdl';

//SOAP Object
$soap = new SoapClient($soap_url);

//parameters
    $array['registrationID'] = "YOUR AA USERID";
    $array['password'] = "YOUR AA PASSWORD";
    $array['msisdn'] = "880171*******";

Now we will try to call this SOAP function with our parameter to retrieve the latitude and longitude of our registered mobile phone.

$soap->requestLocation($array);

$soap->requestLocation($array) would not work. We might be frustrated with the result. And we will try to to pass the parameter with __soapCall() function. Same error might be raised with this function and you might be more frustrated.

$soap->__soapCall("requestLocation", $array);

What is the problem here? Yes, problem exists in your parameter passing process . DOT NET SOAP service function intend to receive object instead of array/scalar variable. We need to pass the parameter as object to requestLocation() function.

So, we need to create object.

$object->registrationID = "YOUR AA USERID";
$object->password = "YOUR AA PASSWORD";
$object->msisdn = "880171*******";
$stat = $soap->requestLocation($object);

Still it is buggy! Why? The answer is simple. You need to build the object as per as function required. And the above code snippet to declare object is not good or not followed by the namespace of PHP. We need to follow the Name Space of PHP to declare the object.

class LBSRequest
{
    public $registrationID = "YOUR AA USERID";
    public $password = "YOUR AA PASSWORD";
    public $msisdn = "880171*******";
}

We have successfully created class and will create object later of the code. Now we will create a super class to access this public class.

class GPInit
{
    public $LBSRequest;
}

This class will be passed as parameter here.

LBSRequest = new LBSRequest;

$soap_url='http://sandbox.kernelbd.com/gp/GP.ADP.BizTalk.LBS.Orchestration/WebService_GP_ADP_BizTalk_LBS_Orchestration.asmx?wsdl';

//SOAP Object
$soap = new SoapClient($soap_url);

//AA SOAP Request
$stat = $soap->requestLocation($GPInit);

print_r($stat);

You can check the live demo for this SOAP request from our sandbox server –
http://sandbox.kernelbd.com/gp/


All comments of post - "aloashbei.com.bd – SOAP Service and API Issue":

:Haha! I'am the first! Yeh~

Comments are currently closed.

Add a Comment / Trackback url

  1. #3  Vicky

    Wow, that’s a really clever way of thinikng about it!

    11/05/14 14:41
  2. #2  Zetta Mccash

    Very nice post. I just stumbled upon your blog and wished to say that I’ve really enjoyed surfing around your blog posts. After all I will be subscribing to your feed and I hope you write again soon!

    11/05/03 12:51
  3. #1  Carlotta Bora

    This is very interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your great post. Also, I’ve shared your site in my social networks!

    11/04/03 06:48

Show all Show 5 so far Close all

Comment begin from here or jump up!