Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
MetaData mValue's DataType??
siva2_2000
Friends,
Need help in setting MetaData mValue for Asset Search.
I want to search asset by asset name,
$MBMetadata=array("mName"=>�hName�h,"mID"=>�h {B297C571-F083-11D4-8200-0060080D8AC2}�h,mValue=>"0000000003.jpg","IsMultipleValue"=>false);
$MBSearchConstraints=array("mMetadata"=>$MBMetadata,"mSearchOperator"=>�hEquality�h);
$rootCon =$soapProxyclient->GetRootContainer();
$RootID=$rootCon->mID;
$MBSearchCriteria=
array(
"mContainerID"=>$RootID,
"mRecursive"=>true,
"mSearchConstraints"=>array("MBSearchConstraint"=>$MBSearchConstraints),
"mMaxHits"=>10
);
$Search_GetAssetIDsOnly=$soapProxyclient->Search_GetAssetIDsOnly($MBSearchCriteria);
The problems are,
a. if mSearchOperator=�hContains�h , getting some result, but not matching with my Search Criteria.
b. if mSearchOperator=�hEquality�h , not getting any result.
I think there are some problem with MetaData mValue setting, tried different mValue, but the result is same always. That is mValue setting is not working, by the way what is the type of MetaData mValue.
Could anyone help me with MetaData mValue,mValues and IsMultipleValue.I think there is problem with datatype of mValue.
Find more posts tagged with
Comments
msnider
You shouldn't need to set the IsMultipleValue when doing a search...just the mName, mID, and mValue.
siva2_2000
Thanks for the response,
Removed " IsMultipleValue ", but result is same
Just have a look at [[[OUTGOING:]]]] and [[[INCOMING]]]...there is a asset "output.jpg" also...
Note : Same Search criteria in MediaBin Web Client works fine.
[[[OUTGOING:]]]]
POST /MediaBinWebService/MediaBinServer.asmx HTTP/1.0
Proxy-Authorization: Basic QWRtaW5pc3RyYXRvcjo=
Authorization: Basic QWRtaW5pc3RyYXRvcjo=
User-Agent: PEAR-SOAP 0.8.0RC2-devel
Host: 133.176.65.49
Content-Type: text/xml; charset=UTF-8
Content-Length: 954
SOAPAction: "
http://www.mediabin.com/Search_GetAssetIDsOnly"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns
OAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns
OAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="
http://www.mediabin.com"
>
<SOAP-ENV:Body>
<ns4
earch_GetAssetIDsOnly>
<ns4:criteria>
<ns4:mContainerID>{75D3B7B9-8963-4F77-9B6E-B1CD99B41C88}</ns4:mContainerID>
<ns4:mAssetID/>
<ns4:mRecursive>true</ns4:mRecursive>
<ns4:mSearchConstraints>
<ns4:MBSearchConstraint>
<ns4:mMetadata>
<ns4:mName>Name</ns4:mName>
<ns4:mID>{B297C571-F083-11D4-8200-0060080D8AC2}</ns4:mID>
<ns4:mValue>output.jpg</ns4:mValue></ns4:mMetadata>
<ns4:mSearchOperator>Equality</ns4:mSearchOperator></ns4:MBSearchConstraint></ns4:mSearchConstraints>
<ns4:mMaxHits>1</ns4:mMaxHits></ns4:criteria></ns4
earch_GetAssetIDsOnly>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
[[[INCOMING]]]
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Sat, 06 Nov 2004 00:30:50 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 585
<?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:Header>
<wsu:Timestamp xmlns:wsu="
http://schemas.xmlsoap.org/ws/2002/07/utility">
<wsu:Created>2004-11-06T00:30:50Z</wsu:Created>
<wsu:Expires>2004-11-06T00:35:50Z</wsu:Expires>
</wsu:Timestamp>
</soap:Header>
<soap:Body>
<Search_GetAssetIDsOnlyResponse xmlns="
http://www.mediabin.com">
<Search_GetAssetIDsOnlyResult />
</Search_GetAssetIDsOnlyResponse>
</soap:Body>
</soap:Envelope>
siva2_2000
Friends,
Actually our mediaBin 4.5 is running in Japanese OS and we are using PEAR SOAP, PHP for accessing assets.
Is there any special setup in order to get proper asset search results.
mSearchOperator=Equality is not giving result, but Inequality , StartsWith, Contains etc gives me irrelevant search results.
Only search I could not, other then that I could able to get asset preview, download, upload etc.
Is there any other way of doing asset search?. Can I do search directly on the tables, if yes could u please tell me the table name or DB schema??.
Thanks in advance
shiv
msnider
Have you used the sample Java app included in the MediaBin WebService SDK? If so, I can give you an updated version that will help test if your search is working correctly.
Mark
siva2_2000
Thanks a lot,
Please give me updated MediaBin WebService SDK. I have tried in java also, but i could not able to set MBSearchConstraint's object in ArrayOfMBSearchConstraint. getting NullPointerException.
If i could able to get the search using JAVA , probably i can trace the problem in PHP also.
Please have a look at my JAVA Search Program and let me know,
*************************************************************************************
<%
@page
contentType="text/html"%>
<%
@page
pageEncoding="Shift-JIS"%>
<%
@page
import="MBYPV.*"%>
<%@ page import="java.util.*,java.lang.*,java.io.*"%>
<%@ page import="com.mediabin.www.*" %>
<%@ page import="javax.xml.rpc.holders.*"%>
<%@ page import="javax.servlet.http.*"%>
<jsp:useBean id="MBLogin" scope = 'application' class="MBYPV.MBLoginInfo" />
<jsp:setProperty name="MBLogin" property="*" />
<html>
<head><title>MBSEARCH</title></head>
<body>
<%
String userName=MBLogin.gettxtUserName();
out.println("**********USERNAME:"+userName+"*********************<br>");
String domain=MBLogin.gettxtDomain();
String uname=MBLogin.gettxtUserName();
String pwd=MBLogin.gettxtPwd();
String strURL=session.getAttribute("URL").toString();
MediaBinServerSoap mMediaBinServer=null;
try{
MBConnect mblObj=new MBConnect();
mMediaBinServer = mblObj.ConnectToMediaBin(strURL,domain,uname,pwd);
}catch(Exception e){
out.print("Not Connected to MediaBin Server");
}
MBSearchCriteria mbSchCri=new MBSearchCriteria();
mbSchCri.setMContainerID(mMediaBinServer.getRootContainer().getMID());
mbSchCri.setMMaxHits(10);
mbSchCri.setMRecursive(true);
MBMetadata mbmd=new MBMetadata();
mbmd.setMID("{DD528FE2-19CE-471E-8DC1-9042F89422B1}");
mbmd.setMName("Any Text");
mbmd.setMValue("output");
MBSearchConstraint mbSchCon =new MBSearchConstraint();
mbSchCon.setMMetadata(mbmd);
mbSchCon.setMSearchOperator("Contains");
ArrayOfMBSearchConstraint aMBSchCon=new ArrayOfMBSearchConstraint();
aMBSchCon.setMBSearchConstraint(0,mbSchCon);
mbSchCri.setMSearchConstraints(aMBSchCon);
mMediaBinServer.search_GetAssetIDsOnly(mbSchCri);
%>
</body>
</html>
******************************************************************************************
Getting following error
java.lang.NullPointerException
com.mediabin.
www.ArrayOfMBSearchConstraint.setMBSearchConstraint(ArrayOfMBSearchConstraint.java:29)
org.apache.jsp.MBSearch_jsp._jspService(MBSearch_jsp.java:100)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:305)
Thanks
shiv
msnider
The code should look something like this:
MBSearchCriteria criteria = new MBSearchCriteria();
criteria.setMContainerID(containerID);
criteria.setMAssetID( null );
criteria.setMRecursive( bRecursive );
criteria.setMMaxHits( maxHits );
MBMetadata metadata = new MBMetadata();
metadata.setMName( "Name" );
metadata.setMID( "{B297C571-F083-11D4-8200-0060080D8AC2}" );
metadata.setMValue( name );
MBSearchConstraint[] constraints = new MBSearchConstraint[1];
constraints[0] = new MBSearchConstraint();
constraints[0].setMMetadata( metadata );
if( bExactMatch )
constraints[0].setMSearchOperator( "Equality" );
else
constraints[0].setMSearchOperator( "Contains" );
constraints[0].setMBooleanOperator(MBBooleanOperator.NotSet);
ArrayOfMBSearchConstraint arrConstraints = new ArrayOfMBSearchConstraint();
arrConstraints.setMBSearchConstraint( constraints );
criteria.setMSearchConstraints( arrConstraints );
I've attached an updated version of the sample java app that adds two additional test cases....searching the root container by name using Contains and Equality.
siva2_2000
Thanks a lot,
Search in Java is working fine. I just captured JAVA SOAP Message of search and comparing with PHP SOAP Message.
{{{{{{{{{{{{{{JAVA SOAP Request for Search}}}}}}}}}}}}}}}}}}}
POST /MediaBinWebService/MediaBinServer.asmx HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1
Host: 133.176.65.49:80
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "
http://www.mediabin.com/Search_GetAssetIDsOnly"
Content-Length: 947
Authorization: Basic TVlVU0VSR1JPVVBcYWRtaW5pc3RyYXRvcjo=
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Search_GetAssetIDsOnly xmlns="
http://www.mediabin.com">
<criteria>
<mContainerID>{75D3B7B9-8963-4F77-9B6E-B1CD99B41C88}</mContainerID>
<mRecursive>true</mRecursive>
<mSearchConstraints>
<MBSearchConstraint>
<mMetadata>
<mName>Name</mName>
<mID>{B297C571-F083-11D4-8200-0060080D8AC2}</mID>
<mValue xsi:type="xsd:string">output.jpg</mValue>
<IsMultipleValue>false</IsMultipleValue>
</mMetadata>
<mSearchOperator>Equality</mSearchOperator>
<mBooleanOperator>NotSet</mBooleanOperator>
</MBSearchConstraint>
</mSearchConstraints>
<mMaxHits>10</mMaxHits>
</criteria>
</Search_GetAssetIDsOnly>
</soapenv:Body>
</soapenv:Envelope>
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[PHP SOAP Request for search ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
POST /MediaBinWebService/MediaBinServer.asmx HTTP/1.0
Proxy-Authorization: Basic QWRtaW5pc3RyYXRvcjo=
Authorization: Basic QWRtaW5pc3RyYXRvcjo=
User-Agent: PEAR-SOAP 0.8.0RC2-devel
Host: 133.176.65.49
Content-Type: text/xml; charset=ISO-8859-1
Content-Length: 898
SOAPAction: "
http://www.mediabin.com/Search_GetAssetIDsOnly"
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns
OAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns
OAP-ENC="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="
http://www.mediabin.com"
>
<SOAP-ENV:Body>
<ns4
earch_GetAssetIDsOnly>
<ns4:criteria>
<ns4:mContainerID>{75D3B7B9-8963-4F77-9B6E-B1CD99B41C88}</ns4:mContainerID>
<ns4:mAssetID></ns4:mAssetID>
<ns4:mSearchConstraints>
<ns4:MBSearchConstraint>
<ns4:mMetadata>
<ns4:mName>Name1</ns4:mName>
<ns4:mID>{F0B62CE3-320F-4329-86A3-B533034CCDA4}</ns4:mID>
<ns4:mValue>output.jpg</ns4:mValue></ns4:mMetadata>
<ns4:mSearchOperator>Equality</ns4:mSearchOperator></ns4:MBSearchConstraint></ns4:mSearchConstraints></ns4:criteria></ns4
earch_GetAssetIDsOnly>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
JAVA mValue going like this
<mValue xsi:type="xsd:string">output.jpg</mValue>, and
php mValue is like this
<ns4:mValue>output.jpg</ns4:mValue></ns4:mMetadata>
is there any Difference in these two...Help is welcome..
Thanks a lot
shiv
siva2_2000
Thanks a lot,
it seems there are few bugs in PEAR SOAP Complex types request..let me try my best...
Thanks a lot for your kind help..
shiv
siva2_2000
Friends,
Thanks a lot.
At last found the problem in PHP asset Search. Now search is working in PHP itself.
Regards
Shiv