
Join free
Skip to: site menu |main content
Welcome to my personal site. If You have any question or suggestion please feel free to contact me from contact page.
This is a small sample adapted from the xwebSecureClass that shows calling the Authenticate method and getting the soap headers.
NOTE: This code was adapted on the fly and is untested right now, if you find success or bugs please update the code accordingly.
<?php
$nfxweb = new SoapClient("https://mynf.mywork.org/xweb/Secure/netFORUMXML.asmx?WSDL",
Array('trace'=>true, //turning on trace=true will let us grab the headers and responses
'exceptions'=>true ));
//these are the params set in the constructor
$authReqParams = Array('userName'=>'bobbojones', 'password' => 'secretsecret');
$responseHeaders = '';
try{
//run the soap call to get it - with the headers.
$response = $nfxweb->__SoapCall("Authenticate", array('parameters'=>$authReqParams), null,null, $responseHeaders);
//Here is the auth token from our response
$authToken = $responseHeaders['AuthorizationToken']->Token;
$xwebNamespace = $response->AuthenticateResult;
} catch(SoapFault $exception) {
throw $exception;
}
//Create the header for our next request.
$authHeaders = new SoapHeader($xwebNamespace, 'AuthorizationToken', Array('Token'=>$authToken), true);
//make our next request, with the new header and capture the token again.
$arguments = Array('szObjectKey'=>"899D54C8-2D34-4E8B-B276-000B80C8958E", 'szObjectName'=>'Individual');
$response = $nfxweb->__soapCall("GetFacadeObject", $arguments, null, $authHeaders, $responseHeaders);
$authToken = $responseHeaders['AuthorizationToken']->Token;
?>InderSingh.com v1.2
(May 18, 2012)
Recent comments
16 weeks 4 days ago
16 weeks 4 days ago
16 weeks 4 days ago
1 year 16 weeks ago
1 year 16 weeks ago
1 year 16 weeks ago
1 year 31 weeks ago
1 year 33 weeks ago
1 year 34 weeks ago
1 year 39 weeks ago