Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 401 Not Authorized #3

Open
markaduffy opened this issue Jun 1, 2016 · 0 comments
Open

Getting 401 Not Authorized #3

markaduffy opened this issue Jun 1, 2016 · 0 comments

Comments

@markaduffy
Copy link

Having difficulties authorizing php SoapClient with MS Dynamic Great Plains. I can connect through SoapUI.

The token length is shorter than what is sent using SoapUI.


    $wsdlUrl = 'http://example.org:48620/Metadata/Legacy/Full/DynamicsGP.wsdl';
            $options = [
                'ntlm_username' => 'Domain\username',
                'ntlm_password' => 'password'
            ];

            $soapClient = new \NTLMSoap\Client($wsdlUrl, $options);

            $params = array(
                criteria => array(
                    'ModifiedDate' => array(
                        'GreaterThan' => '2016-04-18',
                        'LessThan' => '2016-04-19'
                    )
                ),>
                'context' => array(
                    'OrganizationKey' => array(
                        'type' => 'CompanyKey',
                        'Id' =
                    )
                )
            );

            $soapClient->__setLocation('http://example.org:48620/DynamicsGPWebServices/DynamicsGPService.asmx');
            $response = $soapClient->GetPurchaseOrderList(array($params));

I had to set use ___setLocation() because client was being forwarded to http://localmachine:48620/DynamicsGPWebServices/DynamicsGPService.asmx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant