Skip to content

Getting 401 Not Authorized #3

Description

@markaduffy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions