Welcome Guest, Not a member yet? Register   Sign In
Soap and CodeIgniter
#1

[eluser]alexaaaaaaaaaa[/eluser]
Hi, i need some help with this soap tech, i've done some google and forum research and i've found some intresting things about this SOAP.
My problem is that i've got the wsdl url and i have created a small code and by magic i think it's not working as it should be.

Here's the Controller code
Code:
function test2()
{
              require_once(APPPATH.'libraries/nusoap/nusoap'.EXT);
            
            
            $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
            $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
            $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
            $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
            $useCURL = isset($_POST['usecurl']) ? $_POST['usecurl'] : '0';
            $client = new nusoap_client("https://www.transpact.com/securepartner/partner.asmx?WSDL", 'wsdl',
                                    $proxyhost, $proxyport, $proxyusername, $proxypassword);
            $err = $client->getError();
            if ($err) {
                echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
                exit();
            }
            $client->setUseCurl($useCURL);
            $proxy = $client->getProxy();
            
        
            
            echo '<h2>Request</h2><pre>' . htmlspecialchars($proxy->request, ENT_QUOTES) . '</pre>';
            echo '<h2>Response</h2><pre>' . htmlspecialchars($proxy->response, ENT_QUOTES) . '</pre>';
            echo '<h2>Client Debug</h2><pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
            echo '<h2>Proxy Debug</h2><pre>' . htmlspecialchars($proxy->debug_str, ENT_QUOTES) . '</pre>';
            
            }

Now if you execute this code u'll see some informations about Client Debug but what i have to do is that i've must send some data to that xml.
Can someone please help me?

Thanks in advance
#2

[eluser]alexaaaaaaaaaa[/eluser]
Hi, i have managed to succeed to create the soap and integrating it into CI here's the code,
maybe someone will also need this.
Codeginiter and Soap for Transpact.com
First of all download the soap and place it under the library folder.

Then into your controller use this code,
Code:
function alex()
{

//https://www.transpact.com/securepartner/partner.asmx?WSDL
require_once(APPPATH.'libraries/nusoap/nusoap'.EXT);
$client = new SOAPClient('https://www.transpact.com/securepartner/partner.asmx?WSDL',
                         array('trace' => true));

try {
    $paramRQ = array('Username' => '[email protected]',
                         'Password' => 'yourpassword',
                          'CreateType' => '3',
                           'MoneySenderEmail' => '[email protected]',
                            'MoneyRecipientEmail' => '[email protected]',
                             'Amount' => '200.00',
                              'Currency' => 'GBP', //can be GBP or EUR
                               'NatureOfTransaction' => '3',
                                'SenderFee' => '0.00',
                                 'RecipientFee' => '0.00',
                                  'OriginatorFee' => '5.98', //OriginatorsFee + Sendersfee + RecipientFee = 5.98 if GBP or 6.49 if EUR
                                   'TranspactNominatedReferee' => 'true',
                                    'MaxDaysDisputePayWait' => '10',
                                     'Conditions' => 'THis is some terms',
                                      'ConditionsConsumerClause' => 'false',
                                       'CanTransactorsChangeConditions' => 'false',
                                        'IsTest' => 'true',
                                         'PartnerReference' => 'partner reference');
                
    $weather = $client->CreateTranspact($paramRQ);
} catch (SOAPFault $exception) {
    // if we hit an error, print the exception and the XML we sent
    print $exception;
    print htmlspecialchars($client->__getLastRequest());
    exit;
}

// normally, we'd do something useful with the result
var_dump($weather);
}

If your response shows a negative number for egs -3 then please check the 3 field and so on.
If you have problems integrating it i'll try to help you as much as i can.
#3

[eluser]xjeddan143[/eluser]
Thank you both of you for sharing ideas.

I can apply this to my web development. I will try a shot.

Thank you
#4

[eluser]alexaaaaaaaaaa[/eluser]
Hi, it's only me Alex posting here Smile.
You must contact transpact.com for more informations.
Regards,
Alex




Theme © iAndrew 2016 - Forum software by © MyBB