B2B Integration

 View Only
  • 1.  Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Wed May 22, 2019 02:16 PM
    Hi,

    I'm currently working on a project where I've create a business process to call Sharepoint APIs to create folders, files and get folder information. It's working mostly when I use the HTTP Client Post service. But when I call an API that uses HTTP Client Get service I'm getting 403-Forbidden errors. I've confirm that the HTTP headers look good and are identical to the Postman call. It works in Postman but not from SI.

    I was just wondering if anybody else has encountered errors like this and if you have found a resolution?

    Derrick

    ------------------------------
    Derrick Dantzler
    ------------------------------

    #B2BIntegration
    #SupplyChain


  • 2.  RE: Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Fri May 31, 2019 12:04 PM
    Hi Derrick,
    I've seen similar when doing an HTTP GET. Every time it's because I've forgotten that a "feature" of B2Bi is that if you have a PrimaryDocument it will append it like POST data to the HTTP GET request, which of course is not supported. What you should do is Assign PrimaryDocument to another area of ProcessData (assuming you'll need it again after the GET) and then use the Release service to get rid of PrimaryDocument before using the HTTP Client GET service e.g: 

    <assign name="Assign" to="myDoc" from="/ProcessData/PrimaryDocument/@SCIObjectID"></assign>
    <operation name="Release Service">
                    <participant name="ReleaseService"/>
                    <output message="outmsg">
                      <assign to="TARGET">/ProcessData/PrimaryDocument</assign>
                      <assign to="." from="*"></assign>
                    </output>
                    <input message="inmsg">
                      <assign to="." from="*"></assign>
                    </input>
    </operation>

    Best regards,
    Richard.

    ------------------------------
    RICHARD CROSS
    ------------------------------



  • 3.  RE: Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Fri May 31, 2019 01:00 PM
    Hi Richard, 

    Thanks for your reply. We actually found the issue and it was having to do with RawRequest=true not being set. I develop BP's using the GUI interface and after hours of troubleshooting with a co-worker we discovered that the RawRequest parameter is not even visible on the HTTP Get Service. But if you edit the code outside of the GUI via a text editor and add RawRequest=true value it solved my problem. It's strange because the response from Sharepoint was indicating an authority issue. But adding that parameter allowed me to connect to the API successfully. Hope this helps anyone else that's having a similar issue.

    <operation name="HTTP Client GET Service">
       <participant name="HTTPClientGet"/>
       <output message="HTTPClientGetServiceTypeInputMessage">
       <assign to="RawResponse">true</assign>
       <assign to="ResponseTimeout">30</assign>
       <assign to="SessionToken" from="/ProcessData/HTTPClientBeginSessionServiceResults /SessionToken/text()"></assign>
       <assign to="ShowResponseCode">true</assign>
       <assign to="URI">/sites/XXXXXXX/_api/Web/GetFolderByServerRelativePath(decodedurl=&apos;/sites/XXXXXXX/Integration&apos;)/Files</assign>
       <assign to="RawRequest">true</assign>
       <assign to="." from="*"></assign>
       </output>
       <input message="inmsg">
      <assign to="HTTPClientGetServiceResults" from="*" append="true"></assign>
      </input>
    </operation>


    ------------------------------
    Derrick Dantzler
    ------------------------------



  • 4.  RE: Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Thu June 06, 2019 10:24 AM
    Hi Derrick,

    Glad to hear you got it working. Would you be able to share any more of the BP around how you setup the session with SharePoint and what headers you're setting?

    Thanks,
    Richard.

    ------------------------------
    RICHARD CROSS
    ------------------------------



  • 5.  RE: Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Thu June 06, 2019 12:19 PM
    Sure Richard. I'll just need to hide up some company specific info and I'll post it. Give me a day or two.

    ------------------------------
    Derrick Dantzler
    ------------------------------



  • 6.  RE: Using IBM Sterling B2B to call Microsoft Sharepoint API's

    Posted Fri February 02, 2024 12:47 PM

    Hi Derrick, When you get a chance, please share the BP code where set the session with SharePoint.



    ------------------------------
    Satish Mutukuri
    ------------------------------