How to connect to non-wsdl API via SoapClient in PHP? -
i trying connect php application connectwise api. never used soapclient lost after looking on soapclient manual
here request should when sent connectwise
post /v4_6_release/apis/2.0/serviceticketapi.asmx http/1.1 host: cw.connectwise.net content-type: text/xml; charset=utf-8 content-length: length soapaction: "http://connectwise.com/getserviceticket" <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <getserviceticket xmlns="http://connectwise.com"> <credentials> <companyid>string</companyid> <integratorloginid>string</integratorloginid> <integratorpassword>string</integratorpassword> </credentials> <ticketid>int</ticketid> </getserviceticket> </soap:body> </soap:envelope>
how can use soapclient establish connection , send required information?
here have done far
error_reporting(e_all); ini_set('display_errors',1); $client = new soapclient( null, array( 'location' => 'http://connectwise.com/getserviceticket', 'uri' => 'http://connectwise.com', 'trace' => 1, 'use' => soap_literal, 'style' => soap_document, ) ); $params = new soapvar(' <credentials> <companyid>mycompany</companyid> <integratorloginid>myusername</integratorloginid> <integratorpassword>mypassword</integratorpassword> </credentials> <ticketid>123</ticketid>', xsd_anyxml); echo "request:<br>" . htmlentities(str_ireplace('><', ">\n<", $client->__getlastrequest())) . '<br><br>'; echo "response:<br>" . htmlentities(str_ireplace('><', ">\n<", $client->__getlastresponse())) . '<br>';
but not printed beside
request: response: