Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
XML
<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
Updated 24-Jul-19 11:19am

You need to do it with __doRequest

PHP
<?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);
}

?>
 
Share this answer
 
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 = "<full path="" to="" the="" 'ext'="" directory="">"
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
Gracias
he creado una solución para sabre a quien lo necesite.
//error_reporting(E_ALL);
//ini_set('display_errors', true);
//ini_set('display_startup_errors', true);

$test = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Header>
        <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
            <eb:From>
                <eb:PartyId>Client</eb:PartyId>
            </eb:From>
            <eb:To>
                <eb:PartyId>SWS</eb:PartyId>
            </eb:To>
            <eb:CPAId>3D</eb:CPAId>
            <eb:ConversationId>MyConversationID</eb:ConversationId>
            <eb:Service>Service</eb:Service>
            <eb:Action>getReservationRQ</eb:Action>
            <eb:MessageData>
                <eb:MessageId>{{msgID}}</eb:MessageId>
                <eb:Timestamp>{{timestamp}}</eb:Timestamp>
            </eb:MessageData>
        </eb:MessageHeader>
        <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
            <wsse:BinarySecurityToken>2992664818457740415!1227677!0!1!E2E-1</wsse:BinarySecurityToken>
        </wsse:Security>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns7:GetReservationRQ xmlns:ns7="http://webservices.sabre.com/pnrbuilder/v1_15" Version="1.15.0">
            <ns7:Locator>JXJ</ns7:Locator>
            <ns7:RequestType>Stateful</ns7:RequestType>
            <ns7:ReturnOptions UnmaskCreditCard="true">
                <ns7:SubjectAreas>
                    <ns7:SubjectArea>PRICING_INFORMATION</ns7:SubjectArea>
                </ns7:SubjectAreas>
            </ns7:ReturnOptions>
        </ns7:GetReservationRQ>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>';

//Change this variables.
$location_URL = 'https://webservices.havail.sabre.com';
$action_URL = "http://webservices.sabre.com/pnrbuilder/v1_15";

$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

echo "respuesta: <br>";

$search = array("soap-env:","eb:","stl15:");
$replace   = array("","","");
$xml = str_replace($search, $replace, $order_return);
//echo htmlentities($newphrase); //con espacios
//echo htmlentities($order_return); //sin espacion

$xml   = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
$array = json_decode(json_encode($xml), TRUE);
echo "<pre>";echo print_r($array);echo "
";

}catch (SoapFault $exception){
var_dump(get_class($exception));
var_dump($exception);
}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900