Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a situation where I need to retrieve the site title for a site in another web application using client side scripting.

Client site JQuery SOAP calls to the "Webs" web service returns the title as expected for URL's belonging to the web app from which I am making this call. However the same call using a URL from another web app returns 401 errors (unauthorized).

I really don't want to deploy a feature to do this and my goal is to make this all client side.

I have not attempted yet to use the client side api in fear I may run into the same problem so I wanted to post here to see if anyone has thoughts or ideas on how to make this happen.

Thanks for reading!

share|improve this question

2 Answers 2

Thanks for confirming that for me Vardhaman. It seems possible however to use the Search Service Web service call with a query like this.

 var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>"
                    queryText += "<Query>"
                    queryText += "<Context>"
                    queryText += "<QueryText language='en-US' type='MSSQLFT'>"
                    queryText += "SELECT Path, Title, Description FROM SCOPE() WHERE Path='" + urlArray[i] +"'"
                    queryText += "</QueryText>"
                    queryText += "</Context>"
                    queryText += "</Query>"
                    queryText += "</QueryPacket>";

This returns the following XML which contains all the info I want. I have to assume I will always get one result.

<ResponsePacket xmlns="urn:Microsoft.Search.Response">
  <Response>
    <Range>
      <StartAt>1</StartAt>
      <Count>1</Count>
      <TotalAvailable>1</TotalAvailable>
      <Results>
        <Document xmlns="urn:Microsoft.Search.Response.Document">
          <Action>
            <LinkUrl>http://MyURL</LinkUrl>
          </Action>
          <Properties xmlns="urn:Microsoft.Search.Response.Document.Document">
            <Property>
              <Name>PATH</Name>
              <Type>String</Type>
              <Value>http://MyURL</Value>
            </Property>
            <Property>
              <Name>TITLE</Name>
              <Type>String</Type>
              <Value>Hospitalist</Value>
            </Property>
            <Property>
              <Name>DESCRIPTION</Name>
              <Type>String</Type>
              <Value>Hospitalist</Value>
            </Property>
          </Properties>
        </Document>
      </Results>
    </Range>
    <Status>SUCCESS</Status>
  </Response>
</ResponsePacket>
share|improve this answer

I am afraid this wont be possible with the JavaScript Client Object Model as it only works withing the current Site Collection. This is implemented to avoid Cross Domain calls.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.