How to retrieve the related items for a loaditem or viewitem SOAP request

Hi,

we are making a loaditem SOAP request to contentSOAP endpoint to retrieve information on a contentitem as well as its related item by setting the includeRelated parameter to true.

Here are the steps we followed precisely :

  1. retrieved the design folder under c:\Rhythmyx and loaded them under soapui plugin in eclipse to have local proxies to query the webservices

  2. proceeded with a login request to retrieve a sessionid - works ok

  3. used sessionid to make requests for loaditems or viewitems calls provided by the contentSOAP api, itemid being xxx and includeRelated set to true. In both cases we get the same error :“The contract was violated for service ‘loadItems/viewitems’. The underlying error was: missing required related item relationship.”

Our current conclusion is that if the relationship parameter is indeed a required one, it should be listed in the xsd definition for the api calls for viewitems and loaditems. It is not and there is no way to pass that parameter when making calls to loaditems or viewitems

Does anyone know how to retrieve the related items information for a given content item using the SOAP API.

The loaditem soap call is :
<soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:com=“urn:www.percussion.com/6.0.0/common” xmlns:con=“urn:www.percussion.com/6.0.0/content”><br/> <soapenv:Header><br/> <com:PSAuthenticationHeader><br/> <com:Session>a8c9281235d0c38708ef850d22c137794d612243</com:Session><br/> </com:PSAuthenticationHeader><br/> </soapenv:Header><br/> <soapenv:Body><br/> <con:LoadItemsRequest><br/> <!–1 or more repetitions: xxx is an actual integer we are sending–><br/> <con:Id>xxx</con:Id> <br/> <con:IncludeFolderPath>true</con:IncludeFolderPath><br/> <con:IncludeRelated>true</con:IncludeRelated><br/> </con:LoadItemsRequest><br/> </soapenv:Body><br/></soapenv:Envelope><br/><br/>The response received is :<br/><br/><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”><br/> <soapenv:Body><br/> <soapenv:Fault><br/> <faultcode>soapenv:Server.generalException</faultcode><br/> <faultstring/><br/> <detail><br/> <ns1:PSContractViolationFault code=“1” errorMessage=“The contract was violated for service ‘loadItems’. The underlying error was: missing required related item relationship.” stack="java.lang.IllegalArgumentException: missing required related item relationship at com.percussion.webservices.transformation.converter.PSItemConverterUtils.toClientRelatedContent(Unknown Source) at com.percussion.webservices.transformation.converter.PSItemConverter.convert(Unknown Source) at com.percussion.webservices.PSBaseSOAPImpl.convert(Unknown Source) at com.percussion.webservices.content.ContentSOAPImpl.convertItems(Unknown Source) at com.percussion.webservices.content.ContentSOAPImpl.loadItems(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.percussion.webdav.PSWebDavRequestFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.percussion.servlets.PSSecurityFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Unknown Source) " xmlns:ns1=“urn:www.percussion.com/6.0.0/faults”/><br/> <ns2:exceptionName xmlns:ns2=“http://xml.apache.org/axis/”>com.percussion.webservices.faults.PSContractViolationFault</ns2:exceptionName><br/> <ns3:hostname xmlns:ns3=“http://xml.apache.org/axis/”>gvacmst01</ns3:hostname><br/> </detail><br/> </soapenv:Fault><br/> </soapenv:Body><br/></soapenv:Envelope><br/>

Thanks

Interibex SA

You’re missing several parameters, one of which is the “SlotName”. Look at content.xsd and LoadItemsRequest for a list of parameters that you should pass…

The SOAP endpoint returns same message even if slotname is passed.

The additional parameter is it complaining about is some sort of relationship ( missing required related item relationship.)

The content.xsd doesnt list any parameter type for relationship for the loaditemsrequest call.

If you managed to get that working and to retrieve the related information for a slot in the item, with loaditemsrequest, could you paste an example of such call to your soap endpoint with all the params you are passing ?

Thanks indeed

Interibex SA

I stand corrected, you don’t need to specify the slotname as it should by default load all the slots (and content therein) associated in the template for that content type (for that particular item). I was dealing with the Java API where I’m trying to convert auto indexers to regular item slots and for that we need to define a relationship filter for regular slots. The following works for us.


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:www.percussion.com/6.0.0/content" xmlns:ns2="urn:www.percussion.com/6.0.0/common">
<SOAP-ENV:Header>
<ns2:PSAuthenticationHeader>
<ns2:Session>XXXXXXX</ns2:Session>
</ns2:PSAuthenticationHeader>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:LoadItemsRequest>
<ns1:Id>1083</ns1:Id>
<ns1:IncludeRelated>true</ns1:IncludeRelated>
<ns1:IncludeFolderPath>true</ns1:IncludeFolderPath>
</ns1:LoadItemsRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I would check to see if you can preview a template for the content item that you are trying to load and see whether the problem is somewhere else…