How to sort the result in BasicSearch using SOAP API Search Service

Hi there,
Is there any way to sort the result by a metadata field in BasicSearch using SOAP API Search Service?

Thanks for the help!



example:

<SOAP-ENV:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://SYSTEM_ROOT_URL/_web_services/soap-server">

<SOAP-ENV:Body>

<ns1:BasicSearchResponse>

<BasicSearchResult>Home - metadata2</BasicSearchResult>

<BasicSearchResult>About Us - metadata1</BasicSearchResult>

<BasicSearchResult>Contact - metadata4</BasicSearchResult>

<BasicSearchResult>News - metadata3</BasicSearchResult>

</ns1:BasicSearchResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>



needs to be:

<SOAP-ENV:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://SYSTEM_ROOT_URL/_web_services/soap-server">

<SOAP-ENV:Body>

<ns1:BasicSearchResponse>

<BasicSearchResult>About Us - metadata1</BasicSearchResult>

<BasicSearchResult>Home - metadata2</BasicSearchResult>

<BasicSearchResult>News - metadata3</BasicSearchResult>

<BasicSearchResult>Contact - metadata4</BasicSearchResult>

</ns1:BasicSearchResponse>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Hi,
Unfortunately sorting is not currently supported in SOAP search services. You might have to programmatically do this after you receive the SOAP response.



Ash

[quote]
Hi,

Unfortunately sorting is not currently supported in SOAP search services. You might have to programmatically do this after you receive the SOAP response.



Ash

[/quote]



Trying to use the SetAssetStatus web services, got the fault result "16 is not a valid status of the asset", what was the problem? thanks!



request is like:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="https://dev.aut.ac.nz/_web_services/soap-server">

<soapenv:Header/>

<soapenv:Body>

<soap:SetAssetStatus>

<AssetID>275629</AssetID>

<StatusValue>16</StatusValue>

<!–Optional:–>

<DependantsOnly></DependantsOnly>

</soap:SetAssetStatus>

</soapenv:Body>

</soapenv:Envelope>

Sounds like you are trying to set the asset to Live, but it can't go to Live from its current status. What is the current status? Does it need to go through workflow first?

[quote]
Sounds like you are trying to set the asset to Live, but it can't go to Live from its current status. What is the current status? Does it need to go through workflow first?

[/quote]



Current status is safe Edit Pending Approval, we are trying to use setAssetstatus to make it live.

anything to do with the permission?

[quote]
Current status is safe Edit Pending Approval, we are trying to use setAssetstatus to make it live.

anything to do with the permission?

[/quote]



Hi,

Its nothing to do with Permission. Like what Greg said above it is an invalid status that you can set to that asset. You can query 'GetAssetAvailableStatuses' function on this asset to get back the valid statii the asset can be set to.



Looks like there is a workflow running. To understand it better you can go to backend and check out this asset to see what are the status available to you.





Ash

[quote]
Hi,

Its nothing to do with Permission. Like what Greg said above it is an invalid status that you can set to that asset. You can query 'GetAssetAvailableStatuses' function on this asset to get back the valid statii the asset can be set to.



Looks like there is a workflow running. To understand it better you can go to backend and check out this asset to see what are the status available to you.





Ash

[/quote]

query 'GetAssetAvailableStatuses' non response, removed the workflow and check the asset which current is "Safe Edit Approved To Go Live", and have "reject changes" and "make live" available.



what was wrong?



Thanks.

request:



Seems that my GetAssetAvailableStatuses doesn't reponse propperly,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="https://dev.aut.ac.nz/_web_services/soap-server">

<soapenv:Header/>

<soapenv:Body>

<soap:GetAssetAvailableStatuses>

<AssetID>150927</AssetID>

</soap:GetAssetAvailableStatuses>

</soapenv:Body>

</soapenv:Envelope>



response:



<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://dev.aut.ac.nz/_web_services/soap-server">

<SOAP-ENV:Body>

<ns1:GetAssetAvailableStatusesResponse/>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

I am not sure why the GetAssetAvailableStatuses functionality isn’t working. Might have to make sure the function in the function list is checked and also the WSDL is regenerated. If this still doesn’t work you might have to contact Squiz support to figure it out.


As for the other part, in you previous post you said the asset was in ‘Safe Edit Pending Approval’ status and the last post talks about asset status being ‘Safe Edit Approved To Go Live’. The target status the asset can be set to depends on what is the current status of the asset + the workflow on the asset. You can get a better idea from asset status concept on our manuals.



Ash

[quote]
I am not sure why the GetAssetAvailableStatuses functionality isn’t working. Might have to make sure the function in the function list is checked and also the WSDL is regenerated. If this still doesn’t work you might have to contact Squiz support to figure it out.



As for the other part, in you previous post you said the asset was in ‘Safe Edit Pending Approval’ status and the last post talks about asset status being ‘Safe Edit Approved To Go Live’. The target status the asset can be set to depends on what is the current status of the asset + the workflow on the asset. You can get a better idea from asset status concept on our manuals.



Ash

[/quote]

Thanks.

I thought only the user who has the admin permission is able to change the status. but how do I add the user’s login to the setAssetStatus function, or do I need to use the other loginUser function?

Thanks.

[quote]
Thanks.

I thought only the user who has the admin permission is able to change the status. but how do I add the user's login to the setAssetStatus function, or do I need to use the other loginUser function?

Thanks.

[/quote]



You are welcome.

Permissions does affect what the status of an asset can be changed to. The link I posted in previous post does talk about the status and what permission are required to set those status.

As for adding a login functionality to you setAssetStatus function, it will need to be done higher up. Although I am certain if the call to setAssetStatus is made by a user, say who only has read access to an asset (invalid permissions), the function won't return success.



Ash

[quote]
You are welcome.

Permissions does affect what the status of an asset can be changed to. The link I posted in previous post does talk about the status and what permission are required to set those status.

As for adding a login functionality to you setAssetStatus function, it will need to be done higher up. Although I am certain if the call to setAssetStatus is made by a user, say who only has read access to an asset (invalid permissions), the function won't return success.



Ash

[/quote]

The user has the admin permission to the asset, just wondering before the user call setAssetStatus, does it need or how to pass the authentication?