?
Solved

SOAPCLIENT

Posted on 2011-04-23
2
Medium Priority
?
306 Views
Last Modified: 2012-06-27
Hi Guys,

Please someone help me provide the revised code for this issue :

http://forums.alfresco.com/en/viewtopic.php?f=45&t=26137

Thanks
0
Comment
Question by:softbless
2 Comments
 
LVL 5

Accepted Solution

by:
gazzzzzzer earned 2000 total points
ID: 35471639
Hi,

I have not had time to test this, but you want to do something like this:
<?php

    try
    {

	$securityHeaderParam = array('Username'=>'admin', 'Password'=>'admin');
	$headers = new SoapHeader('http://docs.oasis-open.org/ns/cmis/ws/200908/', 'UserCredentials', $securityHeaderParam);

       	$client = new SoapClient('http://cmis.alfresco.com/cmis/RepositoryService?wsdl');
	$client->__setSoapHeaders(array($headers)); 

       	$client->getRepositoryInfo('84ccfe80-b325-4d79-ab4d-080a4bdd045b');

       	echo 'Request :<pre>'.htmlspecialchars($client->__getLastRequest());
       	echo '</pre>Response:<pre>'.htmlspecialchars($client->__getLastResponse()) . '</pre>';
    }
    catch (SoapFault $e)
    {
       echo '<p>Fault String: ' . $e->faultstring . '<p>';
       echo '<p>Fault Code: ' . $e->faultcode . '<p>';
    }

?>

Open in new window


The main points to remember, are to add the user credentials to the soap header .

line 6 defines the user credentials.
line 7 adds the credentials to a new soap header object.
line 10 adds the header to the soap client, which will then be included in the future function calls
0
 

Author Closing Comment

by:softbless
ID: 35752372
thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question