12
Points
Questions
1
Answers
2
-
- 819 views
- 1 answers
- 0 votes
-
Here is a barebones working example I wrote in C# with the .NET framework. I stripped out a bunch of code to make it clear what object calls you will need. You’ll have to translate back to Java.. sorry I had to translate it the other way lol.
public void RedlineTest()
{
using (Table_Binding service = TableService())
{
UpdateRowsRequestType updateRowRequest = new UpdateRowsRequestType();
AgileUpdateRowsRequest[] rowRequest = new AgileUpdateRowsRequest[1];// Create options for a redline_change and set the target ECO
PropertyType[] options = new PropertyType[1];
options[0] = new PropertyType
{
propertyName = “redline_change”,
propertyValue = “C12345” // ECO Number
};RequestTableType updateTable = new RequestTableType()
{
classIdentifier = “Part”,
objectNumber = “JOE_TEST_5”,
options = options,
tableIdentifier = “-810” // TABLE_REDLINEPAGETWO Constant. You will have to adjust this if you want to
// target different attribute sections like Page Three.
// Refer to “Agile Attributes without API Names – Item Constants” in the WS API
};// Define the XML element for the Agile Fields(s) you wish to update and set the value(s). This part of my code is using .NET XML classes, for Java you’ll have to use JAXBElement or the MessageElement as shown in the WS API.
XmlElement[] elements = new XmlElement[1];
XmlDocument doc = new XmlDocument();
elements[0] = doc.CreateElement(“drawingNumber”);
elements[0].SetAttribute(“xmlsn:xsi”, “xs:string”);
elements[0].InnerText = “JOE_TEST_5.dwg”;// Load the element(s) into an AgileRowType
AgileRowType row = new AgileRowType
{
Any = elements
};// Define an AgileUpdateRow then insert your AgileRowType and set the RowId to update
AgileUpdateRow[] updaterow = new AgileUpdateRow[1];
updaterow[0] = new AgileUpdateRow()
{
row = row,
rowId = 8453123 // Hardcoded RowId for this example. (You can use the GetRowId helper or use LoadTableRequestType to get the Row you wish to update)
};// Fill the AgileUpdateRowRequest with the UpdateRow and RequestTableType
rowRequest[0] = new AgileUpdateRowsRequest
{
row = updaterow,
objectInfo = updateTable
};// Set the UpdateRowsRequestType with your rowRequest and call the Web Service updateRows method
updateRowRequest.data = rowRequest;
UpdateRowsResponseType updateResponse = service.updateRows(updateRowRequest);
}
}- 1841 views
- 2 answers
- 0 votes