ActiveVOSDeploymentDescriptor { public void addPartnerLink(String name, String partnerEndpoint, String partnerPortName, QName partnerService, String myEndPoint) { if (pdd.getPartnerLinks() == null) { pdd.addNewPartnerLinks(); } PartnerLinkType newPl = pdd.getPartnerLinks().addNewPartnerLink(); newPl.setName(name); if (partnerEndpoint != null && partnerService != null && partnerPortName != null) { PartnerRoleType partnerRole = newPl.addNewPartnerRole(); partnerRole.setInvokeHandler("default:Address"); partnerRole.setEndpointReference2("static"); EndpointReferenceType endPointReference = partnerRole .addNewEndpointReference(); endPointReference.setAddress(partnerEndpoint); MetadataType metadata = endPointReference.addNewMetadata(); ServiceNameType serviceName = metadata.addNewServiceName(); serviceName.setPortName(partnerPortName); serviceName.setQNameValue(partnerService); } if (myEndPoint != null) { MyRoleType myRole = newPl.addNewMyRole(); myRole.setBinding("MSG"); myRole.setService(myEndPoint); } } ActiveVOSDeploymentDescriptor(File file); void addPartnerLink(String name, String partnerEndpoint,
			String partnerPortName, QName partnerService, String myEndPoint); void addWsdlImport(String locationInDeployment, String wsdlNamespace); void addXsdImport(String locationInDeployment, String xsdNamespace); void save();  }
@Test public void testAddPartnerlink() throws Exception { String testName = "testAddPartnerlink"; File f = copyPddToTestCaseFile(testName); ActiveVOSDeploymentDescriptor pdd = new ActiveVOSDeploymentDescriptor(f); pdd.addPartnerLink("NewPL", "http: "partnerPort", new QName("ns", "partnerService"), null); pdd.save(); String actual = normalize(FileUtil.readFile(f)); String expected = normalize(getExpected(testName)); assertEquals(expected, actual); }