Error " There is no tag in response. "

Hi ,
I am trying to edit an ItemType "EDM StructureDocument" which is derived from a polyItem using a server event  "onAfterAdd" .

with an implemented C# method :

/**
* History
* Version Date Name Comment
* 1.1 09-September-2019 Hamdi Kendil Generate the ID for the current EDM Structure Document using the Server Event onAfterAdd
* Story: EDM-5: Create a new Document
* Purpose: Generate the EDM Structure Document ID
* Usage: EDM Structure Document
* Event: onAfterAdd
*
*/

System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();


//Obtain the Innovator instance from the Context Item
Innovator inn = this.getInnovator();

//long MaxItemNumber = 9999999999 ;

//Get the ItemList of EDM StructureDocument ItemType
Item results = inn.newItem("EDM StructureDocument", "get");
results = results.apply();

//Calculate the number of the EDM Part instances
long count = results.getItemCount();

if(count <= MaxItemNumber){
//Get the hexa id of the current EDM Part item
string id = "'" + this.getID() + "'";

//Compute a new id of the current EDM Part item
string edmId = "";
string itemNumber = count.ToString();
int len = itemNumber.Length;
int maxIndex = 10 - len;
for (var index = 0; index < maxIndex; index++) {
edmId += "0";
}
edmId += itemNumber;

//Set the current item id with the determined value
Item myItem = inn.newItem("EDM StructureDocument", "edit");
string request = "id=" + id;
myItem.setAttribute("where", request);
myItem.setProperty("edm_doku_id", edmId);

return myItem.apply();
} else {
return inn.newError("Error Creating a new EDM Document , the Number of Documents is Maximal");
}

When I try to save the new created Item, it gives me following error :

There is no tag <Item> in response. 

-<SOAP-ENV:Envelope>
-<SOAP-ENV:Body>
-<SOAP-ENV:Fault>
 <faultcode>SOAP-ENV:Server.TagItemIsNotFoundInResponseException</faultcode>
 <faultstring>There is no tag <Item> in response.</faultstring>
-<detail>
 <af:legacy_detail>There is no tag <Item> in response.</af:legacy_detail>
 <af:exception message =" There is no tag <Item> in response. " type =" Aras.Server.Core.TagItemIsNotFoundInResponseException " />
 </detail>
 </SOAP-ENV:Fault>
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>

Can anyone explain me the cause of this error , or provide me a document that can help me solving the issue such as the Aras exceptions details .

Please .

Thanks in advance 

  • Hi Hamdi,

    one thing I noticed after glancing over your code is your where-clause. I might be wrong, but I believe it should be "[EDM_StructureDocument].id='yourIdHere'" instead of simply "id='yourIdHere'". This could lead myItem.apply(); to return a container for a SqlException instead of an Item, which could explain the error?

    Cheers,

    C

  • Hi Cogres , 

    I tryed to comment this part but it was the same error ,

    besides I already used this syntax in previous methods and it was running normally

    thank you for your answer anyway,

  • Hi Hamdi,

    before applying myItem, could you check what its AML representation looks like and post it here? In addition, it would help to know what myItem.apply() looks like as well (I'm assuming it is some error/exception container).

    Also, for the action "edit" you will need either an ID on the item or a valid where-clause. When you comment out the where-clause, myItem.apply() should return a container for a MissingCriteriaException.

    Cheers,

    C

  • Hi Cogres ,

    I rechecked the issue with my colleagues  , (it was solved successfully )

    the error was not in the method but in the configuration of the ItemType  

    there was a missing permission for the admin , now it works fine 

    sorry for the late response and thank you for your support.

    Regards ,

     Hamdi

  • No worries, glad you got it sorted :)

    Cheers,

    C

  • I'm getting the error:

    -<SOAP-ENV:Envelope>
    -<SOAP-ENV:Body>
    -<SOAP-ENV:Fault>
      < faultcode > SOAP-ENV:Server.TagItemIsNotFoundInResponseException </ faultcode >
      < faultstring > There is no tag <Item> in response. </ faultstring >
    -<detail>
      < af:legacy_detail > There is no tag <Item> in response. </ af:legacy_detail >
      < af:exception type =" Aras.Server.Core.TagItemIsNotFoundInResponseException " message =" There is no tag <Item> in response. " />
     </detail>
     </SOAP-ENV:Fault>
     </SOAP-ENV:Body>
     </SOAP-ENV:Envelope>
    why [question mark]
  • Hi kalleanka,

    Could you provide (part of) the code that you are using, in particular the object you return and how you create it? I'd also say that you're probably returning an exception/error container which does not include an Item tag without your knowing. Try debugging or logging the Item you are returning, that should explain what is happening.

    Cheers,

    C

  • I'm just trying to save a standard Document in Aras. The error appears in a popup by Aras. I don't know what causes it.

  • Where should I add logging or debugging [question mark]

  • Hi kalleanka,

    Oh I see, I figured because this is the development forum, that you encountered this error in some custom code you wrote. If this happens with Aras core ItemTypes and methods, you should probably contact Aras support instead.
    You can also check the "Document" ItemType to see if it has any custom onAfter/BeforeUpdate ServerEvents set on it that get fired (and cause the error) when you are trying to save.
    Here you can find a blog post explaining how to set up debugging in Aras.

    Hope this helps.

    Cheers,

    C