PHP equivalent of C#'s new NetworkCredential() ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jabba
Forum Newbie
Posts: 4
Joined: Sat Sep 15, 2007 7:01 pm

PHP equivalent of C#'s new NetworkCredential() ?

Post by Jabba »

scottayy | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi,

I'm new to php. I've written a lot of C, SQL, etc...

I am using php version 5 and nuSOAP with an apache server on a Windows XP sp2 platform.

I've been provided with a C# snippet of code to invoke a Web services from a commecial Vendor.

This is the C# code...

[syntax="csharp"]        CredentialCache myCache = new CredentialCache();
        NetworkCredential myCred = new NetworkCredential("GETest", "Ac71v3K3y", "");
        myCache.Add(new Uri(mySvc.Url), "Basic", myCred);
        mySvc.Credentials = myCache;
        if (!mySvc.SendMessageToUnit(iProvider, strUnit, iEncoding, strData, iDataLen, out iTransID, out iError, out sErrorStr))
        {
		// If there's an error, iError and sErrorStr will be set
            lblMessage.Text = sErrorStr;
            return;
        }
I need to get this to work in PHP.

Does anyone know what the equivalent code would be in php? I've searched, but I \could not find anything specific.

Thanks very much....


scottayy | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: PHP equivalent of C#'s new NetworkCredential() ?

Post by volka »

Jabba wrote:I am using php version 5 and nuSOAP with an apache server on a Windows XP sp2 platform.
the documentation lists a method soapclient::setCredentials()
Jabba
Forum Newbie
Posts: 4
Joined: Sat Sep 15, 2007 7:01 pm

Post by Jabba »

Thanks scottayy, I'll make use of the coding tags in in the future...
Jabba
Forum Newbie
Posts: 4
Joined: Sat Sep 15, 2007 7:01 pm

Re: PHP equivalent of C#'s new NetworkCredential() ?

Post by Jabba »

volka wrote:
Jabba wrote:I am using php version 5 and nuSOAP with an apache server on a Windows XP sp2 platform.
the documentation lists a method soapclient::setCredentials()
Thank you volka. This is exactly what I was looking for. Much appreciated...
Post Reply