cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
710
Views
0
Helpful
6
Replies

Changing Partition Name of Line associated with Device

upchaurasia
Spotlight
Spotlight

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

6 Replies 6

npetrele
Cisco Employee
Cisco Employee

I don't see where you're specifying which line to update.  Did you specify the pattern somewhere?

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

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() );

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

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. 

Hey, you need to set newRoutePartitionName to the new value

Getting Started

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: