web services - SOAP in PHP. How do I get a return? -
so, i'll come right out , new soap.
i've done php quite time, , xml, never made wsdl , soap. here's goes (hopefully isnt stupid).
i have wsdl file want request from. ex: http://whateverservice.org/?wsdl
and want simple api call job called "jobapi_checkconnection". using soapui, soap code when looking @ job:
<soapenv:envelope xmlns:soapenv="http://schemas/xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:header/> <soapenv:body> <tem:jobapi_checkconnection/> </soapenv:body> </soapenv:envelope>
so, how translate php? looking @ tutorial: http://devzone.zend.com/2202/php-and-soap-first-steps/
i of it, not all... can gather far, php code should similar this:
<?php $wsdl = "http://whateverservice.org/?wsdl"; $client = new soapclient($wsdl); $result = $client->jobapi_checkconnection(); echo $result->jobapi_checkconnectionresult; ?>
but returns nothing, , site fails load. in other words, wrong. in tutorials have seen far, send request paramter response, one, have call on job, , expect result that, have no clue how...
anyone either willing point me in right direction tutorial or similar. or if come right out , give me answer, that's cool, hope can learn it.
sidenote: not sure if need log in on service connecting too, if so, have next no clue how... assume array or parameter added "newsoapclient" call, how , where, dont know...
thanks taking care of noobie!
first, should native php soapclient class.
then if using php objects , structured programming, advise use wsdl php generator eases way create request , receive response. so, take wsdltophp project can use online @ https://www.wsdltophp.com
Comments
Post a Comment