AnsweredAssumed Answered

getContentStream() org.xml.sax.SAXException

Question asked by silvia1983 on Apr 26, 2010
Hi all!

I'm ussing axis2.1.4 libs with jdk 1.4.2.11

I've achieved to work getRepository service to get the main repository, query to get one folder, but when i try to use getContentStream service i get this error message:

org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
   at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
   at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
   at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
   at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
   at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
   at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
   at org.apache.axis.client.Call.invoke(Call.java:2467)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at alfrescoServices.ws.ObjectServiceSoapBindingStub.getContentStream(ObjectServiceSoapBindingStub.java:1766)
   at cliente.ServicioAlfresco.getContentStream(ServicioAlfresco.java:315)
   at cliente.ServicioAlfresco.main(ServicioAlfresco.java:195)
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.

My GetContentStream object is

    GetContentStream objeto = new GetContentStream();
    objeto.setRepositoryId(repository);
    objeto.setExtension(new CmisExtensionType());
    objeto.setStreamId("");
    objeto.setObjectId(objectId);   //My objectId exists in Alfresco because i've seen it in alfresco browser

My call to the service is:
ObjectServiceLocator servLocator = new ObjectServiceLocator();
Object endpoint = "http://localhost:8080/alfresco/cmis/ObjectService";
servLocator.setObjectServicePortEndpointAddress(endpoint.toString());
ObjectServiceSoapBindingStub stub = null;
GetContentStreamResponse response = null;
CmisContentStreamType objeto = null;
try{
   stub = (ObjectServiceSoapBindingStub)servLocator
      .getPort(ObjectServiceSoapBindingStub.class);
   stub.setHeader(obtenerCabeceraSeguridad());      

   response = stub.getContentStream(parameters);
   objeto = response.getContentStream();

Could anyone help me with this problem?
I don't know what is wrong in my request or response

Outcomes