Hi Guys,
I thought I would post back with a solution to this.
Martin, the issue we were having (in my case) was do to the manually formed SOAP packet. WHen making an insert statement like this all the values are case sensitive. I was trying to enter key values ("AA3BDSB...") when my database held the values ("aa3bdsb").
This is what the error is referring to - it cannot actually find the foreign key that you are specifying. It is looking for a PKID in the numplan database of "ec6d081e-31d9-968a-97c9-9d0f149393bf" but cannot find it for some reason. Try changing your cases to upper?
Alternatively, here is the proper way to implement updatePhone to add a line.
1public string createLine(string sepIn, string extIn, string label, string mask, string index)
2 {
3
4 StringBuilder s = new StringBuilder();
5 GetPhoneReq deviceReq = new GetPhoneReq();
6 deviceReq.ItemElementName = ItemChoiceType8.phoneName;
7 deviceReq.Item = sepIn;
8 GetPhoneRes deviceRes = new GetPhoneRes();
9 deviceRes = axlapiService.getPhone(deviceReq);
10
11 XLine newLine = new XLine();
12
13 XNPDirectoryNumber existingNumber = new XNPDirectoryNumber();
14 existingNumber.pattern = extIn;
15 newLine.Item = existingNumber;
16
17 newLine.asciiLabel = label;
18 newLine.display = label;
19 newLine.displayASCII = label;
20 newLine.e164Mask = mask;
21 newLine.index = index;
22
23 object[] newLines = new object[deviceRes.@return.device.lines.Items.Count() + 1];
24 int i = 0;
25 foreach (XLine line in deviceRes.@return.device.lines.Items)
26 {
27 newLines.SetValue(line, i);
28 i++;
29 }
30 newLines.SetValue(newLine, i);
31
32
33 UpdatePhoneReq updateReq = new UpdatePhoneReq();
34 UpdatePhoneReqLines reqLines = new UpdatePhoneReqLines();
35 reqLines.Items = newLines;
36 updateReq.lines = reqLines;
37 updateReq.ItemElementName = ItemChoiceType7.name;
38 updateReq.Item = sepIn;
39 StandardResponse response = axlapiService.updatePhone(updateReq);
40 return response.ToString();
41 }