08-31-2015 03:15 AM
Hi,
We are trying to change "Route Partition" name of a line associated with device using AXL API. Following is the code-
XFkType xfkPartition = new XFkType();
xfkPartition.setValue("Parsec2");
JAXBElement<XFkType> jaxbPartitionLine = new JAXBElement<XFkType>(new QName("routePartitionName"), XFkType.class, xfkPartition);
jaxbPartitionLine.setValue(xfkPartition);
objUpdateLineReq.setRoutePartitionName(jaxbPartitionLine);
StandardResponse objStandardResponse= objAXLPort.updateLine(objUpdateLineReq);
After execution of code, I don't see any change in partition name. Neither any error.
Can you please suggest what is the wrong in above line?
Regards,
Umesh
08-31-2015 08:14 AM
I don't see where you're specifying which line to update. Did you specify the pattern somewhere?
08-31-2015 09:13 AM
yes, here is -
UpdateLineReq objUpdateLineReq=new UpdateLineReq();
objUpdateLineReq.setUuid(strDirnUUId);
objUpdateLineReq.setDescription(strDesc);
XFkType xfkPartition = new XFkType();
xfkPartition.setValue("Parsec2");
JAXBElement<XFkType> jaxbPartitionLine = new JAXBElement<XFkType>(new QName("routePartitionName"), XFkType.class, xfkPartition);
jaxbPartitionLine.setValue(xfkPartition);
objUpdateLineReq.setRoutePartitionName(jaxbPartitionLine);
StandardResponse objStandardResponse= objAXLPort.updateLine(objUpdateLineReq);
Regards,
Umesh
08-31-2015 12:46 PM
Thanks. I don't see any obvious problem. I recommend doing this for debugging purposes. Add this code (or something like it) before you execute the setRoutePartitionName, and you should see the XML it is about to send. That might shed light on where things are going wrong.
//Create a String writer object which will be
//used to write jaxbElement XML to string
StringWriter writer = new StringWriter();
// create JAXBContext which will be used to update writer
JAXBContext context = JAXBContext.newInstance(XFkType.class);
// marshall or convert jaxbElement containing student to xml format
context.createMarshaller().marshal(jaxbPartitionLine, writer);
//print XML string representation of object
System.out.println( writer.toString() );
09-07-2015 01:54 AM
Thanks Nicholas.
Here is the output -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><routePartitionName>Parsec2</routePartitionName>
I think XML is correct but there is no effect in partition when executing updateLine -
StandardResponse objStandardResponse= objAXLPort.updateLine(objUpdateLineReq);
I am able to change CSS of same line using updateLine.
Regards,
Umesh
09-08-2015 07:23 AM
Yes, that looks correct. Can you check the entire XML request? You can do that a variety of ways, including added Java code, Fiddler or Wireshark, or use RTMT to monitor the AXL requests.
Also, try executing the same request with SoapUI. If it works in SoapUI, then something is wrong with your code. If it doesn't work in SoapUI, then something is wrong with the request or with AXL.
09-17-2015 08:44 PM
Hey, you need to set newRoutePartitionName to the new value
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: