soap array conversion to php array

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
pbs
New php-forum User
New php-forum User
Posts: 53
Joined: Sat May 11, 2013 1:40 am
Location: Nashik, India
Contact:

Re: soap array conversion to php array

Post by pbs » Thu Jul 18, 2013 10:37 pm

you will need SOAP client to call SOAP web service, check nusoap php library to do the same

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: soap array conversion to php array

Post by johnj » Fri Jul 19, 2013 4:59 am

Why don't you parse this xml? There are plenty of xml parsing functions in php

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: soap array conversion to php array

Post by johnj » Mon Jul 22, 2013 10:19 pm

If it is a string called $soap_str then you can type cast it like, $new_array = (array)$soap_str;

johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: soap array conversion to php array

Post by johnj » Mon Jul 22, 2013 10:25 pm

$element = new SimpleXMLElement( $xmlsoapstr );
$singleElement = $element->Body->searchResponse->return->item;

$new_array = array(
$singleElement->airlineCode,
$single->Flight Number);

something like this - I did not test the above code but it is possible...

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests