Skip to content

Instantly share code, notes, and snippets.

@yuktse
Created March 5, 2014 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuktse/9363235 to your computer and use it in GitHub Desktop.
Save yuktse/9363235 to your computer and use it in GitHub Desktop.
vjia_soap_request
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