How can I receive managed properties by using the Query operation?

Sep 20, 2013 at 9:51 AM
Hey developers,

I try to get search results via javascript by using the "Query" method of the /_vti_bin/search.asmx webservice (I am using spservices). The default fields are in the result, but I have a problem with managed properties. If I modify the Request XML by adding a properties tag with property tags in it the service answers "BAD REQUEST".

When I am using a coreresultswebpart, I get the managed properties I want (So the fields are correctly crawled).

Here is my code example (if I comment the properties tags it works!):
function MySearch(request) {
    var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>";
    queryText += "<RowLimit>20</RowLimit>";
    queryText += "<Query>";
    queryText += "<Context>";
    queryText += "<QueryText language='de-DE' type='STRING'>";
    queryText += "ContentType:'SomeContentType' " + request.term;
    queryText += "</QueryText>";
    queryText += "</Context>";
    queryText += "<Range><Count>3</Count></Range>";
    queryText += "<Properties>";
    queryText += "<Property name='mymanagedprop'></Property>";
    queryText += "</Properties>";
    queryText += "</Query>";
    queryText += "</QueryPacket>"; 
        operation: "Query",  
        queryXml: queryText,
        completefunc: function(xData, Status) { 
            // work with result...
How can I receive managed properties by using the serach.asmx?

I also tried to use the GetSearchMetadata operation, but I do not know how to use it correctly.

Can anyone help me? That would be really great.

Best regards,

Oct 4, 2013 at 6:27 PM

Did you figure this out or do you still need help?

Oct 7, 2013 at 4:28 PM
Hi Sympmarc,
Sorry, I forgot to send an update.

My Request XML was not correct. I used to generate a RequestXML which worked :-)

Best regards,
Marked as answer by bbodensieck on 10/7/2013 at 9:28 AM