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

asmx call #76

Open
xsolon opened this issue Mar 31, 2020 · 3 comments
Open

asmx call #76

xsolon opened this issue Mar 31, 2020 · 3 comments

Comments

@xsolon
Copy link

xsolon commented Mar 31, 2020

Could you help with this?
Doesn't seem to work for asmx services.
I'm getting a 401 error

`
spauth.getAuth(siteUrl, settings)
.then(options => {

    let headers = options.headers;
    headers['Content-Type'] = 'text/xml';
    headers['SOAPAction'] = 'http://schemas.microsoft.com/sharepoint/soap/GetSite';

    var data = '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><GetSite xmlns="http://schemas.microsoft.com/sharepoint/soap/" /></soap:Body></soap:Envelope>';

    request.post(siteUrl + '/_vti_bin/SiteData.asmx', {
      body: data,
      headers: headers
    }).then(response => {
      debugger;
      //process data
    });
  });`
@s-KaiNet
Copy link
Owner

Which kind of auth do you use?

@xsolon
Copy link
Author

xsolon commented Mar 31, 2020

Cloud AppOnly credentials

@s-KaiNet
Copy link
Owner

App-only creds don't work with asmx services. You could try user\password auth instead.

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

2 participants