Files and Libraries
Java XML Client Library
Created 13. Juni 2017
The Java client-side library is used to access the Web service API for this application using Java.
The Java client-side library is used to provide the set of Java objects that can be serialized to/from XML using JAXB. This is useful for accessing the resources that are published by this application.
Resources Example (Raw JAXB)
java.net.URL url = new java.net.URL(baseURL + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration"); JAXBContext context = JAXBContext.newInstance( byte[].class, byte[].class ); java.net.URLConnection connection = url.openConnection(); connection.setDoOutput(true); connection.connect(); Unmarshaller unmarshaller = context.createUnmarshaller(); Marshaller marshaller = context.createMarshaller(); marshaller.marshal(archivaRuntimeConfiguration, connection.getOutputStream()); Object result = (Object) unmarshaller.unmarshal( connection.getInputStream() ); //handle the result as needed...
Resources Example (Jersey client)
javax.ws.rs.client.Client client = javax.ws.rs.client.ClientBuilder.newClient(); Object result = client.target(baseUrl + "/archivaRuntimeConfigurationService/archivaRuntimeConfiguration") .put(javax.ws.rs.client.Entity.entity(archivaRuntimeConfiguration, "application/xml"), Object.class); //handle the result as needed...
name | size | description |
---|---|---|
archiva-rest-api-xml-client.jar | 53,62K | The binaries for the Java XML client library. |
archiva-rest-api-xml-client-xml-sources.jar | 44,96K | The sources for the Java XML client library. |
PHP XML Client Library
Created 13. Juni 2017
The PHP client-side library defines the PHP classes that can be (de)serialized to/from XML. This is useful for accessing the resources that are published by this application, but only those that produce a XML representation of their resources.
This library leverages the XMLReader and XMLWriter tools that were included in PHP versions 5.1.0+.
PHP XML Example
//read the resource in XML form: $xml = ...; $reader = new \XMLReader(); if (!$reader->open($xml)) { throw new \Exception('Unable to open ' . $xml); } $result = new Object($reader); //open a writer for the xml $out = ...; $writer = new \XMLWriter(); $writer->openUri($out); $writer->startDocument(); $writer->setIndent(4); $result->toXml($writer); $writer->flush();
name | size | description |
---|---|---|
archiva-rest-api-php.zip | 23,00K |