Remote access

Jul 24, 2012 at 3:22 PM

Hi,

I'm building a simple site which is located on our SharePoint (it retrieves a list of folders).  This is working ok internally but if I access sharepoint remotely (remote.ourserver.com) then SPServices does not work.  This is still running from within Sharepoint and I'm logged in with my usual credentials.

Should this be working or is it simply not possible for any remote access?

Many thanks.

Coordinator
Jul 25, 2012 at 3:12 PM

Peter:

There are always a lot of variables that go into all of this, and it's hard for me to say whether it should work or not. In your case, it may be a matter of how the AAMs are set up and how you are getting to the site remotely. You might want to talk that through with your networking people and/or SharePoint admins.

M.

Jul 31, 2012 at 10:50 AM

Thank you.  I have asked about how we are connecting remotely.

I don't know if this adds any further illumination on things but if I access sharepoint remotely (remote.ourserver.com) then our SBServer gives an IP address and re-routes to this securely.  Then (after logging in) I can access our documents libraries without problem but the SPServices cannot.

Does that make any more sense?  I'm afraid I'm fairly new to this and have no real idea what I'm talking about!

Thanks

Coordinator
Jul 31, 2012 at 11:50 AM

Peter:

It definitely sounds like you will have access issues. There may be ways aroud it, but it's hard to say. What you'll want to do is look at the Net traffic with either fiddler or Firebug to see that sort of errors you might be getting.

M.

Jul 31, 2012 at 2:03 PM

Thanks.

I did just that and I get this error whenever I try to make any SPS call.

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">The Web application at https://remote.medaxial.com:987/SharepointVCT/VCTTest/content.htm could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.</errorstring></detail></soap:Fault></soap:Body></soap:Envelope>

I'm a little confused though because being logged in this way I can still see all our sharepoint libraries and documents etc so is it just that the min.js can't?  Could I grant particular permissions on that file to make a difference?

Apologies if what I'm asking is now beyond the remit of what the tool does, I'm all still fairly unclear.

 

Coordinator
Jul 31, 2012 at 3:07 PM

I think it's more along the lines of what the error is telling you. You may need to have the admins set up an AAM for you. Are you using https://remote.medaxial.com:987/SharepointVCT/VCTTest/ as the webURL?

M.

Jul 31, 2012 at 3:08 PM

Not as a direct URL, no.  Just logging in at remote.medaxial.com.

The 987 seems to then be appending to the URL.  Then I'm just browsing to the VCTTest folder and clicking the content.html page that's in that folder.

P.

Coordinator
Jul 31, 2012 at 3:10 PM

Can you show the script you are using?

M.

Jul 31, 2012 at 3:12 PM
Edited Jul 31, 2012 at 3:22 PM

Sure.  Currently I'm just using:

$().SPServices({operation: "Login", username: 'Peter.Knee', password: 'XXXX'});
alert($().SPServices.SPGetCurrentSite());

But that was just to see if it was working.

Previously, I was using:

 

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "ExampleDocuments",
    //CAMLViewFields: "<ViewFields><FieldRef Name='Type' /><FieldRef Name='LinkFilename' /></ViewFields>",
    CAMLQueryOptions: "<QueryOptions><Folder>ExampleDocuments/External Audiences</Folder></QueryOptions>",
 completefunc: function (xData, Status) {
    
    $(xData.responseXML).SPFilterNode("z:row").each(function() {
            
  if ($(this).attr("ows_DocIcon")){  
     var liHtml = "<div id='file'>FILE: " + $(this).attr("ows_Title") + "</div>";
  }
  else{
   var liHtml = "<div id='file'>FOLDER: " + $(this).attr("ows_Title") + "</div>";
  }
  //$("#files").append(liHtml);
  var img = "<img src='images/" + $(this).attr("ows_DocIcon") + " icon.png' />";
  $('#documents tr:last').after('<tr><td>' + img + '</td><td>' + $(this).attr("ows_Title") + '</td><td></td></tr>');


      });
    }
  });
});

Jul 31, 2012 at 3:13 PM
Edited Jul 31, 2012 at 3:28 PM

x

Coordinator
Jul 31, 2012 at 3:21 PM

I can't edit what you posted, but you should be able to.

When you call GetListItems above, it's going to look for the list ExampleDocuments in the current site, i.e., where the page is which contains the script. I do think it's probably an AAM thing.

M.

Jul 31, 2012 at 3:25 PM

I see that now, thank you.

I'll ask again about the AAMs, though I'm currently not running the second docReady script and I get a void return on

alert($().SPServices.SPGetCurrentSite());

Safari's console offers a 500 (Internal Server Error) on webs.asmx...

Coordinator
Jul 31, 2012 at 3:34 PM

If you're on 2010, $().SPServices.SPGetCurrentSite() uses SP.ClientContext.get_current().get_url() to get the current site. If not, it will call Webs.WebUrlFromPageUrl from the root site. That may be your issue?

M.

Jul 31, 2012 at 3:37 PM

Thanks.

It seems though that I can't make any function calls - I've tried a few other of the simple functions.  We are on 2010.

The pages I have created are on sharepoint incidentally, and they work fine if I just access them internally...