4

In Tridion 2011 SP1, I am trying to read a new Component using a Schema associated with workflow using this Core Service code:

ComponentData wfItem = client.Read(componentUri, new ReadOptions()) as ComponentData;

I get the following error:

The item tcm:2-268-16 does not exist.

I also tried with tcm:2-268-16-v0 and got the same error.

Can I specify some magic ReadOptions to open it?

1 Answer 1

5

Works for me :) This is what I tried:

var netTcpBinding = new NetTcpBinding {
    MaxReceivedMessageSize = 2147483647,
    ReaderQuotas = new XmlDictionaryReaderQuotas {
        MaxStringContentLength = 2147483647,
        MaxArrayLength = 2147483647
    }
};

var remoteAddress = new EndpointAddress("net.tcp://localhost:2660/CoreService/2011/netTcp");

using (var client = new SessionAwareCoreServiceClient(netTcpBinding, remoteAddress)) {
    ReadOptions readOptions = new ReadOptions();
    ComponentData component = client.Read("tcm:21-990", readOptions) as ComponentData;
    Console.WriteLine("ComponentData: " + component.Title);
}

Using the code above, I executed it on several Components:

  • new Component in workflow (with and without -v0 at the end of the TCMURI);
  • existing Component in Workflow (with and without -v0);
  • new Component not in workflow;
  • existing Component not in workflow;

I did execute the code as administrator and the Components in question were used by me. Maybe your case is different? and Maybe that could be the problem?

5
  • Very good point about the user executing the code. I suspect that is the case and will update soon with the result after testing.
    – robrtc
    Nov 14, 2013 at 20:23
  • We should add "who am I" to the gotchas list right after "where (in the BluePrint) am I?" ;-) Nov 15, 2013 at 4:38
  • @Mihai, which version of Tridion did you test on?
    – robrtc
    Nov 19, 2013 at 7:16
  • 2011 SP1 HR1 (filler space) Nov 19, 2013 at 15:31
  • So did you get it to work? Nov 22, 2013 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.