Jump to content

faisalsahar

New Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

faisalsahar's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. when i send the following soap request <?php $authentication = array("username" => "*******", "password" => "**********", "version" => "1.1.0.0", "uoCode" => 10 ); $client = new SoapClient("http://service.babalumra.com/UO_Webservice/UO_WebService.asmx?WSDL", array("trace" => 1)); $response = $client->Authenticate($authentication); $xml = new SimpleXMLElement($client->__getLastResponse()); $elements = $xml->xpath('//soap:Envelope/soap:Header'); $UO = $elements[0]->OfflineHeader->UO; $Ticket = $elements[0]->OfflineHeader->Ticket; $UserIP = $elements[0]->OfflineHeader->UserIP; $UserVer = $elements[0]->OfflineHeader->UserVer; $UserId = $elements[0]->OfflineHeader->UserId; $header = new SoapHeader('http://www.babalumra.com/BAU' 'OfflineHeader', array('UO' => $UO, 'Ticket' => $Ticket, 'UserIP' => $UserIP, 'UserVer' => $UserVer, 'UserId' => $UserId)); $client->__setSoapHeaders(array($header)); try { $result = $client->GetArrivalDepartueData(array("MofaNo" => 49028670, "lang" => 1)); } catch ( Exception $e) { print_r(htmlentities($client->__getLastRequest())); } when looking at the xml it is generated something like this which is not accepted by the server. <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.babalumra.com/BAU"> <SOAP-ENV:Header> <ns1:OfflineHeader> <ns1:UO>10</ns1:UO> <ns1:Ticket>E84A9D898F22276371F49BFC926D3F1E6D8F9F0B3F5AB44C4CB53AE88705FFFA069B9D</ns1:Ticket> <ns1:UserIP>176.45.84.6</ns1:UserIP> <ns1:UserVer>1.1.0.0</ns1:UserVer> <ns1:UserId>100</ns1:UserId> </ns1:OfflineHeader> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns1:GetArrivalDepartueData> <ns1:MofaNo>49028670</ns1:MofaNo> <ns1:lang>1</ns1:lang> </ns1:GetArrivalDepartueData> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I want to replace ns1 with bau any suggestions .
  2. I have to following soap resquest .... ( i have changed the credentials because of the security reasons ) <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bau="http://www.babalumra.com/BAU"> <soapenv:Header/> <soapenv:Body> <bau:Authenticate> <!--Optional:--> <bau:username>zawora</bau:username> <!--Optional:--> <bau:password>a12345#</bau:password> <!--Optional:--> <bau:version>1.1.0.0</bau:version> <bau:uoCode>10</bau:uoCode> </bau:Authenticate> </soapenv:Body> </soapenv:Envelope> I am uising the Authenticate Method of the service. the response is as follows . <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <OfflineHeader xmlns="http://www.babalumra.com/BAU"> <UO>10</UO> <Ticket>C7F02767212D85CE76385F0D4BB7A840371DD08C491F9D56FED7E4FB1ADFA8016E1750B341DB7B96CCB41D496117790C832CD2BC4D40A</Ticket> <UserIP>188.55.105.132</UserIP> <UserVer>1.1.0.0</UserVer> <UserId>100</UserId> </OfflineHeader> </soap:Header> <soap:Body> <AuthenticateResponse xmlns="http://www.babalumra.com/BAU"> <AuthenticateResult><Result Value="True"/></AuthenticateResult> </AuthenticateResponse> </soap:Body> </soap:Envelope> now the problem is that that in order to use other methods of the services i have to provide returned information from <soapenv:Header> in every other method's <soapenv:Header> here is another request which requires the returened information ( authentication details ) in <soapenv:Header> . <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bau="http://www.babalumra.com/BAU" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <soapenv:Header> <bau:OfflineHeader> <bau:UO>?</bau:UO> <!--Optional:--> <bau:Ticket>?</bau:Ticket> <!--Optional:--> <bau:UserIP>?</bau:UserIP> <!--Optional:--> <bau:UserVer>?</bau:UserVer> <bau:UserId>?</bau:UserId> </bau:OfflineHeader> </soapenv:Header> <soapenv:Body> <bau:GetArrivalDepartueData> <bau:MofaNo>?</bau:MofaNo> <bau:lang>?</bau:lang> <!--Optional:--> <bau:ds> <xs:schema> <!--Ignoring type [{http://www.w3.org/2001/XMLSchema}schema]--> </xs:schema> <!--You may enter ANY elements at this point--> </bau:ds> </bau:GetArrivalDepartueData> </soapenv:Body> </soapenv:Envelope> ----------------------------------------------------- my question is that is there any way that i can embed returend authuntecation information in my request headers (<soapenv:Header>)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.