Created
March 5, 2014 08:21
-
-
Save yuktse/9363235 to your computer and use it in GitHub Desktop.
vjia_soap_request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _request($service, $method, $param = array()){ | |
// sys config, values comes from win.vjia.com | |
$auth['Uname'] = 'username'; | |
$auth['Password'] = 'password'; | |
// method config | |
// $wsdl_uri = "http://sws2.vjia.com/swsmsTest/{$service}.asmx?wsdl"; // sandbox | |
$wsdl_uri = "http://sws2.vjia.com/swsms/{$service}.asmx?wsdl"; // production | |
$client = new SoapClient($wsdl_uri, array('trace'=>true, 'exceptions'=>true, 'style'=>SOAP_DOCUMENT, 'encoding'=>'UTF-8', 'soap_version'=>SOAP_1_1)); | |
$header = new SoapHeader('http://swsms.vjia.org/', 'MySoapHeader', $auth, true, SOAP_ACTOR_NEXT); | |
$client->__setSoapHeaders($header); | |
return $client->__soapCall($method, array($param)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment