Can anybody convert this code to php for me.. this is code is used to access a webservice but i only C# code they are not providing any documentation.

Thanks in advance

private CrmService CreateService()
    {
        cs = new CrmService();

        string username = ConfigurationManager.AppSettings["Username"].ToString();
        string password = ConfigurationManager.AppSettings["Password"].ToString();
        string domain = ConfigurationManager.AppSettings["Domain"].ToString();
        string orgname = ConfigurationManager.AppSettings["Org"].ToString();
        string url = ConfigurationManager.AppSettings["CrmSdk.CrmServiceWsdl"].ToString();
        cs.Credentials = new NetworkCredential(username, password, domain);
       // cs.Credentials = CredentialCache.DefaultCredentials;
        cs.Url = url;
     //   OrganizationServiceProxy orgServiceImpersonate = new OrganizationServiceProxy(new Uri(p.orgUri), p.homeuri, p.credentials, p.deviceCredentials);
        CrmAuthenticationToken token = new CrmAuthenticationToken();
        token.OrganizationName = orgname;
        cs.CrmAuthenticationTokenValue = token;
        cs.PreAuthenticate = true;
        return cs;
    }

Recommended Answers

All 2 Replies

Member Avatar for diafol

I think this will be more difficult than it appears as there are a few calls to classes - which I assume would also have to be converted.

Take a look here. I hope this will help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.