You are here:  » soap request


soap request

Submitted by gubi on Thu, 2009-05-14 09:01 in

do you have other sample SOAP Client?

hi,

how will i specify the xml server name? still i am getting blank page.
give me code for xml server ip to specify. plz.

Hello,
i am trying to connect this server, but i am getting blank page

<?php
  
require("MagicParser.php");
  function 
myRecordHandler($record)
  {
    
print_r($record);
  }
$xml ='<soapenv:Body>
<HotelValuedAvailRQ echoToken="DummyEchoToken" sessionId="DummySessionId" xmlns="http://www.hotelbeds.com/schemas/2005/06/messages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.hotelbeds.com/schemas/2005/06/messages HotelValuedAvailRQ.xsd">
    <Language>ENG</Language>
    <Credentials>
        <User>TEST</User>
        <Password>TEST</Password>
    </Credentials>
<HotelOccupancy>
<RoomCount>2</RoomCount>
<Occupancy>
<AdultCount>2</AdultCount>
<ChildCount>0</ChildCount>
</Occupancy>
</HotelOccupancy>
</HotelValuedAvailRQ>
</soapenv:Body>'
;
 
$formatString "xml|SOAP:Envelope/SOAP:BODY/m:getSubIDStatsRequest/";
 
MagicParser_parse("string://".$xml,"myRecordHandler",$formatString);
?>

can you guide me please?

Submitted by support on Thu, 2009-05-14 09:08

Hi gubi,

The value you are using for the Format String isn't valid for the XML
in the code. If you instead use:

$formatString = "xml|SOAPENV:BODY/";

...then you will get all fields in the response and you should then see the output...

Hope this helps!
Cheers,
David.

Submitted by support on Thu, 2009-05-14 11:30

Hello gubi,

I see your question now about actually accessing the remote server.

This is not actually a feature of Magic Parser - the script will help you to parse the response, but it is not a SOAP client as such.

SOAP is now built in to PHP and is present in most installations - perhaps the following tutorial on the Zend website would be a good place to start...

http://devzone.zend.com/article/689

In addition to this you would need the access details (e.g. end point URL) of the soap server you are trying to connect to...

Let me know if you need any further help..

Regards,
David.