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

sp-rest-proxy with sharepointplus #146

Closed
mamoussa405 opened this issue May 18, 2022 · 10 comments
Closed

sp-rest-proxy with sharepointplus #146

mamoussa405 opened this issue May 18, 2022 · 10 comments

Comments

@mamoussa405
Copy link

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

@koltyakov
Copy link
Owner

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
Copy link
Author

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:
`

<style type="text/css">
BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; }
#content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; }
A:link { color: #336699; font-weight: bold; text-decoration: underline; }
A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; }
A:active { color: #336699; font-weight: bold; text-decoration: underline; }
A:hover { color: cc3300; font-weight: bold; text-decoration: underline; }
P { color: #000000; margin-top: 0px; margin-bottom: 12px; font-family: Verdana; }
pre { background-color: #e5e5cc; padding: 5px; font-family: Courier New; font-size: x-small; margin-top: -5px; border: 1px #f0f0e0 solid; }
td { color: #000000; font-family: Verdana; font-size: .7em; }
h2 { font-size: 1.5em; font-weight: bold; margin-top: 25px; margin-bottom: 10px; border-top: 1px solid #003366; margin-left: -15px; color: #003366; }
h3 { font-size: 1.1em; color: #000000; margin-left: -15px; margin-top: 10px; margin-bottom: 10px; }
ul { margin-top: 10px; margin-left: 20px; }
ol { margin-top: 10px; margin-left: 20px; }
li { margin-top: 10px; color: #000000; }
font.value { color: darkblue; font: bold; }
font.key { color: darkgreen; font: bold; }
font.error { color: darkred; font: bold; }
.heading1 { color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal; background-color: #003366; margin-top: 0px; margin-bottom: 0px; margin-left: -30px; padding-top: 10px; padding-bottom: 3px; padding-left: 15px; width: 105%; }
.button { background-color: #dcdcdc; font-family: Verdana; font-size: 1em; border-top: #cccccc 1px solid; border-bottom: #666666 1px solid; border-left: #cccccc 1px solid; border-right: #666666 1px solid; }
.frmheader { color: #000000; background: #dcdcdc; font-family: Verdana; font-size: .7em; font-weight: normal; border-bottom: 1px solid #dcdcdc; padding-top: 2px; padding-bottom: 2px; }
.frmtext { font-family: Verdana; font-size: .7em; margin-top: 8px; margin-bottom: 0px; margin-left: 32px; }
.frmInput { font-family: Verdana; font-size: 1em; }
.intro { margin-left: -15px; }
</style>
<title>
Lists Web Service

</title>

Lists


      <p class="intro">The following operations are supported.  For a formal definition, please review the <a href="Lists.asmx?WSDL">Service Description</a>. </p>
          <ul>
          <li>
            <a href="Lists.asmx?op=AddAttachment">AddAttachment</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=AddDiscussionBoardItem">AddDiscussionBoardItem</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=AddList">AddList</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=AddListFromFeature">AddListFromFeature</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=AddWikiPage">AddWikiPage</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=ApplyContentTypeToList">ApplyContentTypeToList</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=CheckInFile">CheckInFile</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=CheckOutFile">CheckOutFile</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=CreateContentType">CreateContentType</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=DeleteAttachment">DeleteAttachment</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=DeleteContentType">DeleteContentType</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=DeleteContentTypeXmlDocument">DeleteContentTypeXmlDocument</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=DeleteList">DeleteList</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetAttachmentCollection">GetAttachmentCollection</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetList">GetList</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListAndView">GetListAndView</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListCollection">GetListCollection</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListContentType">GetListContentType</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListContentTypes">GetListContentTypes</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListContentTypesAndProperties">GetListContentTypesAndProperties</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListItemChanges">GetListItemChanges</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListItemChangesSinceToken">GetListItemChangesSinceToken</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListItemChangesWithKnowledge">GetListItemChangesWithKnowledge</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetListItems">GetListItems</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=GetVersionCollection">GetVersionCollection</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UndoCheckOut">UndoCheckOut</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateContentType">UpdateContentType</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateContentTypeXmlDocument">UpdateContentTypeXmlDocument</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateContentTypesXmlDocument">UpdateContentTypesXmlDocument</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateList">UpdateList</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateListItems">UpdateListItems</a>
          </li>
          <p>
          <li>
            <a href="Lists.asmx?op=UpdateListItemsWithKnowledge">UpdateListItemsWithKnowledge</a>
          </li>
          <p>
          </ul>
  </span>
<span>
</span>
`

is that means that i have no lists??
Thanks in advance.

@koltyakov
Copy link
Owner

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
Copy link
Owner

koltyakov commented May 18, 2022

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
Copy link
Author

okay thank you Sir

@mamoussa405
Copy link
Author

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
Copy link
Owner

Hi @mamoussa405,

This might be connected with Electron version.

s-KaiNet/node-sp-auth#79

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

@mamoussa405
Copy link
Author

i have v18.2.3 is that the problem??

@mamoussa405
Copy link
Author

@koltyakov i downgraded to v8 but still same problem

@koltyakov
Copy link
Owner

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

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