koltyakov / sp-rest-proxy

🌐 SharePoint API Proxy for local development
MIT License
172 stars 43 forks source link

sp-rest-proxy with sharepointplus #146

Closed mamoussa405 closed 2 years ago

mamoussa405 commented 2 years ago

Hello, how i can use sp-rest-proxy with sharepointplus library in react js??

koltyakov commented 2 years ago

Hey @mamoussa405,

If a valid SharePoint API request ends up on the proxy endpoint. It should work.

I'm not a user of sharepointplus library, but with some other client libraries such as PnPjs it works just fine.

mamoussa405 commented 2 years ago

okay thank you Sir, i have an other question if its possible. I'm requesting this end-point https://company.sharepoint.com/sites/itdevhr/tmsdev/_vti_bin/Lists.asmx from the page the the sp-rest-proxy renders on the browser but all i get is an html content with all the list methods that i can use: `

Lists Web Service
koltyakov commented 2 years ago

No, that doesn't mean there are no lists.

The legacy _vti_bin/Lists.asmx SOAP web service returns the same if requesting the resource in SharePoint context.

Technically it's an auto-docs page.

A SOAP request is something like:

POST /_vti_bin/Lists.asmx HTTP/1.1
Host: qwertyu
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"

<?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>
   <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
     <listName>string</listName>
     <updates>string</updates>
   </UpdateListItems>
 </soap:Body>
</soap:Envelope>

It's a real legacy, no one uses SOAP nowadays.

koltyakov commented 2 years ago

However, it is supported by sp-rest-proxy for a rare 0.001% cases one actually needs calling SOAP. But request should be valid and routed correspondingly.

mamoussa405 commented 2 years ago

okay thank you Sir

mamoussa405 commented 2 years ago

Hello Sir, i didn't want to open i new issue, but i have a problem with sp-rest-proxy and i don't know what is the reason, the problem is the sp-rest-proxy works fine but after a while a killed the server with sigInt signal and i started it again, but when i make a request it gives the prompt to inter the credentials (On-Demand credentials) but instead of requesting the credentials it renders the home page of the sharepoint site, any idea about that??. Thanks in advance.

koltyakov commented 2 years ago

Hi @mamoussa405,

This might be connected with Electron version.

https://github.com/s-KaiNet/node-sp-auth/issues/79

Please check if it works for you with Electron 8 or 9?

mamoussa405 commented 2 years ago

i have v18.2.3 is that the problem??

mamoussa405 commented 2 years ago

@koltyakov i downgraded to v8 but still same problem

koltyakov commented 2 years ago

Going to close this as the reopened part related to a separate auth topic. Which also was started in node-sp-auth repo.