Click here to Skip to main content
12,295,976 members (53,834 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: PHP SOAP WebService
Hi All,
i am new to SOAP and i had a requirement of integrating in my application, so i need help in integrating it.

This is the sample request which i has to send
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.interswitchng.com/" xmlns:web="http://schemas.datacontract.org/2004/07/WebPAY.Core.ServiceFramework.Contract"> <soapenv:Header/> <soapenv:Body> <ser:GetTransactionData> <ser:transactionQueryRequest> <web:Hash>557b2622a688ea804be037314b724ef2af7b101834ea997d588687a891c4369059744a381ba068c0c571ea7b903716802c4b95f771bfddd0d92597fc98e0dfd2</web:Hash> <web:ProductId>3904</web:ProductId> <web:TransactionReference>0000009</web:TransactionReference> </ser:transactionQueryRequest> </ser:GetTransactionData> </soapenv:Body> </soapenv:Envelope>

And i don't know how to send a request can any one help.

and they provided some reference links also:

http://testwebpay.interswitchng.com/test_paydirect/services/webpayservice.svc[^]

https://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryWs.asmx[^]

Thanks in advance.
Posted 19-Sep-12 19:59pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You need to do it with __doRequest

<?php
error_reporting(E_ALL);
ini_set(‘display_errors’, true);
ini_set(‘display_startup_errors’, true);
 
$test = ‘xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/”>
<soap:Body>
<!–
Keep your XML here to send request using SOAP. And yo will get response by reading predefine XML tags.
–>
</soap:Body>
</soap:Envelope>’;
 
//Change this variables.
$location_URL = ‘http://write_your_location_url.asmx’;
$action_URL = “http://write_your_action_to_perform_url.asmx”;

$client = new SoapClient(null, array(
‘location’ => $location_URL,
‘uri’      => “”,
‘trace’    => 1,
));
 
try{
$order_return = $client->__doRequest($test,$location_URL,$action_URL,1);
//Get response from here
print_r($order_return);
}catch (SoapFault $exception){
var_dump(get_class($exception));
var_dump($exception);
}
 
?>
  Permalink  
v2
Comments
Loke.mysore 20-Sep-12 4:14am
   
Thanks for your response-:

I had tried this but i am not getting any response or exceptions.
is there any properties to be enabled to use this service in php server.
Kuthuparakkal 20-Sep-12 4:21am
   
You should enable SOAP support from php.ini file.
Things to check:
1. in php.ini, you have the line:
extension=php_soap.dll
2. in php.ini, you have:
extension_dir = ""
3. in the ext directory, you have the file:
php_soap.dll
Loke.mysore 21-Sep-12 3:27am
   
Thanks this is working fine and if you know to do the same with wsdl can you please suggest me .
Kuthuparakkal 21-Sep-12 3:53am
   
http://wso2.org/project/wsf/php/1.2.0/docs/wsdl_generation_api.html

http://php.net/manual/en/soapclient.soapclient.php

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160525.2 | Last Updated 20 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100