java - Problem with result handler -
i trying run java client through php sends xml server. typically takes 10 - 30 seconds receive response. when run php can tell there no load time thinking rest of code executes before response received. attempting have return response displayed in browser , written xml in same directory. none of happens. new xml created, empty.
$output = shell_exec("java soapclient4xg http://turbolink.turbo-marketing.net:8180 getlist.xml"); sleep(30); echo $output; $filename = "getlistresult"; $filename .= ".xml"; $fp = fopen($filename, 'w'); fwrite($fp, $output); fclose($fp);
i added sleep(30)
give java chance finish before passing value $output
doesn't help. command java soapclient4xg http://turbolink.turbo-marketing.net:8180 getlist.xml"
works. have used in soap ui , through putty running in directory. output receive this, in xml / soap format:
<?xml version="1.0" encoding="utf-8" ?> <env:envelope xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <env:body> <n1:getlistsresponse xmlns:n1="urn:turbolink" env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"> <getlistsresult xsi:type="n1:getlistsresult"> <responsemessages n2:arraytype="n1:responsemessage[1]" xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="n2:array"> <responsemessage> <code xsi:type="xsd:string">0</code> <message xsi:type="xsd:string">no error</message> </responsemessage> </responsemessages> <datalists xmlns:n3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="n3:array" n3:arraytype="n1:datalist[5]"> <datalist> <listid xsi:type="xsd:string">cvplus </listid> <listdescription xsi:type="xsd:string">consumervision plus</listdescription> <listversion xsi:type="xsd:integer">94</listversion> </datalist> <datalist> <listid xsi:type="xsd:string">morthot </listid> <listdescription xsi:type="xsd:string">mortgage hotlines</listdescription> <listversion xsi:type="xsd:integer">206</listversion> </datalist> <datalist> <listid xsi:type="xsd:string">mrtgbase</listid> <listdescription xsi:type="xsd:string">mortgage base</listdescription> <listversion xsi:type="xsd:integer">94</listversion> </datalist> <datalist> <listid xsi:type="xsd:string">supernew</listid> <listdescription xsi:type="xsd:string">american new movers plus</listdescription> <listversion xsi:type="xsd:integer">171</listversion> </datalist> <datalist> <listid xsi:type="xsd:string">tsebus </listid> <listdescription xsi:type="xsd:string">tse business file</listdescription> <listversion xsi:type="xsd:integer">38</listversion> </datalist> </datalists> </getlistsresult> </n1:getlistsresponse>
is there way can wait until $output has value before moving on? when put isset($output)
conditional can see variable never set. tried calling shell_exec()
again inside conditional still nothing.
*edit: server has ip restrictions trying run code on machine not work same. / should error response though.
i had put java file in server env path. also, making absolute path /jdk1.6.0_14/bin/java soapclient4xg http://......
worked well.
Comments
Post a Comment