use of no.nav.vedtak.felles.xml.soeknad.v2.ObjectFactory in project cxf by apache.
the class AbstractTypeTestClient2 method testStructWithSubstitutionGroup.
@Test
public void testStructWithSubstitutionGroup() throws Exception {
if (!shouldRunTest("StructWithSubstitutionGroup")) {
return;
}
SgBaseTypeA baseA = new SgBaseTypeA();
baseA.setVarInt(BigInteger.ONE);
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("foo");
ObjectFactory objectFactory = new ObjectFactory();
StructWithSubstitutionGroup x = new StructWithSubstitutionGroup();
JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg01BaseElementA(baseA);
x.setSg01BaseElementA(elementA);
StructWithSubstitutionGroup yOrig = new StructWithSubstitutionGroup();
JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg01DerivedElementB(derivedB);
yOrig.setSg01BaseElementA(elementB);
Holder<StructWithSubstitutionGroup> y = new Holder<>(yOrig);
Holder<StructWithSubstitutionGroup> z = new Holder<>();
StructWithSubstitutionGroup ret;
if (testDocLiteral) {
ret = docClient.testStructWithSubstitutionGroup(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testStructWithSubstitutionGroup(x, y, z);
} else {
ret = rpcClient.testStructWithSubstitutionGroup(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testStructWithSubstitutionGroup(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testStructWithSubstitutionGroup(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testStructWithSubstitutionGroup(): Incorrect return value", equals(x, ret));
}
}
use of no.nav.vedtak.felles.xml.soeknad.v2.ObjectFactory in project efm-integrasjonspunkt by felleslosninger.
the class CorrespondenceAgencyMessageFactory method createReceiptRequest.
public CorrespondenceStatusHistoryRequest createReceiptRequest(Set<Conversation> conversations) {
no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory of = new no.altinn.services.serviceengine.correspondence._2009._10.ObjectFactory();
CorrespondenceStatusHistoryRequest historyRequest = of.createCorrespondenceStatusHistoryRequest();
com.microsoft.schemas._2003._10.serialization.arrays.ObjectFactory arrayOf = new com.microsoft.schemas._2003._10.serialization.arrays.ObjectFactory();
ArrayOfstring arrayOfstring = arrayOf.createArrayOfstring();
conversations.stream().map(Conversation::getMessageId).forEach(id -> arrayOfstring.getString().add(id));
JAXBElement<ArrayOfstring> strings = of.createCorrespondenceStatusHistoryRequestCorrespondenceSendersReferences(arrayOfstring);
historyRequest.setCorrespondenceSendersReferences(strings);
return historyRequest;
}
use of no.nav.vedtak.felles.xml.soeknad.v2.ObjectFactory in project geotoolkit by Geomatys.
the class WcsXMLBindingTest method marshallingTest200.
@Test
public void marshallingTest200() throws JAXBException, IOException, ParserConfigurationException, SAXException {
org.geotoolkit.wcs.xml.v200.GetCoverageType getCoverage = new org.geotoolkit.wcs.xml.v200.GetCoverageType("test", "image/geotiff", null);
ParametersType param = new ParametersType();
param.setCompression(CompressionType.NONE);
param.setInterleave(InterleaveType.PIXEL);
param.setJpegQuality(10);
param.setPredictor(PredictorType.NONE);
param.setTileheight(12);
param.setTilewidth(15);
param.setTiling(true);
ObjectFactory facto = new ObjectFactory();
getCoverage.setExtension(new ExtensionType(facto.createParameters(param)));
StringWriter sw = new StringWriter();
marshaller.marshal(getCoverage, sw);
String result = sw.toString();
String expResult = "<wcs:GetCoverage version=\"2.0.1\" service=\"WCS\" " + "xmlns:wcs=\"http://www.opengis.net/wcs/2.0\" xmlns:geotiff=\"http://www.opengis.net/gmlcov/geotiff/1.0\">" + '\n' + " <wcs:Extension>\n" + " <geotiff:parameters>\n" + " <geotiff:compression>None</geotiff:compression>\n" + " <geotiff:jpeg_quality>10</geotiff:jpeg_quality>\n" + " <geotiff:predictor>None</geotiff:predictor>\n" + " <geotiff:interleave>Pixel</geotiff:interleave>\n" + " <geotiff:tiling>true</geotiff:tiling>\n" + " <geotiff:tileheight>12</geotiff:tileheight>\n" + " <geotiff:tilewidth>15</geotiff:tilewidth>\n" + " </geotiff:parameters>\n" + " </wcs:Extension>\n" + " <wcs:CoverageId>test</wcs:CoverageId>" + '\n' + " <wcs:format>image/geotiff</wcs:format>" + '\n' + "</wcs:GetCoverage>" + '\n';
assertXmlEquals(expResult, result, "xmlns:*");
final org.geotoolkit.wcs.xml.v200.GetCoverageType unmarshalled = (org.geotoolkit.wcs.xml.v200.GetCoverageType) ((JAXBElement) unmarshaller.unmarshal(new StringReader(expResult))).getValue();
assertEquals(getCoverage, unmarshalled);
final org.geotoolkit.gml.xml.v321.RangeSetType rangeSet = new org.geotoolkit.gml.xml.v321.RangeSetType();
final FileType ft = new FileType();
ft.setMimeType("image/tiff");
final String ext = ".tif";
ft.setRangeParameters(new AssociationRoleType("cid:grey" + ext, "http://www.opengis.net/spec/GMLCOV_geotiff-coverages/1.0/conf/geotiff-coverage", "fileReference"));
ft.setFileReference("cid:grey" + ext);
rangeSet.setFile(ft);
final AbstractDiscreteCoverageType cov = new AbstractDiscreteCoverageType(new CoverageDescriptionType(), rangeSet);
final org.geotoolkit.gmlcov.xml.v100.ObjectFactory factory = new org.geotoolkit.gmlcov.xml.v100.ObjectFactory();
JAXBElement jb = factory.createGridCoverage(cov);
sw = new StringWriter();
marshaller.marshal(jb, sw);
result = sw.toString();
System.out.println(result);
// test the crs extension in capabilities
List<String> supportedFormat = new ArrayList<>();
supportedFormat.add("image/tiff");
supportedFormat.add("application/x-netcdf");
List<String> supportedCrs = new ArrayList<>();
supportedCrs.add("http://www.opengis.net/def/crs/EPSG/0/4326");
supportedCrs.add("http://www.opengis.net/def/crs/EPSG/0/666");
ServiceMetadataType serviceMetadata = new ServiceMetadataType(supportedFormat, supportedCrs);
CapabilitiesType capa = new CapabilitiesType(null, null, null, "2.0.1", null, null, serviceMetadata);
sw = new StringWriter();
marshaller.marshal(capa, sw);
result = sw.toString();
System.out.println(result);
// test the crs extension in get coverage
String subsettingCRS = "http://www.opengis.net/def/crs/EPSG/0/4326";
String outputCRS = "http://www.opengis.net/def/crs/EPSG/0/666";
org.geotoolkit.wcs.xml.v200.GetCoverageType getCov = new org.geotoolkit.wcs.xml.v200.GetCoverageType("CID", "geotiff", "image/tiff", subsettingCRS, outputCRS);
sw = new StringWriter();
marshaller.marshal(getCov, sw);
result = sw.toString();
System.out.println(result);
}
use of no.nav.vedtak.felles.xml.soeknad.v2.ObjectFactory in project geotoolkit by Geomatys.
the class OpenSearchXmlFactory method completeFeed.
public static FeedType completeFeed(FeedType feed, Long totalResults, Long startIndex, Long itemsPerPage) {
final ObjectFactory factory = new ObjectFactory();
feed.getPagingAttributes().add(factory.createTotalResults(totalResults));
feed.getPagingAttributes().add(factory.createStartIndex(startIndex));
feed.getPagingAttributes().add(factory.createItemsPerPage(itemsPerPage));
CompleteQueryType query = new CompleteQueryType();
query.setRole("request");
feed.getPagingAttributes().add(factory.createQuery(query));
return feed;
}
use of no.nav.vedtak.felles.xml.soeknad.v2.ObjectFactory in project geotoolkit by Geomatys.
the class OpenSearchXmlFactory method buildFeed.
public static FeedType buildFeed(String id, String title, PersonType author, String source, Long totalResults, Long startIndex, Long itemsPerPage) {
FeedType feed = new FeedType(id, title, author, source);
final ObjectFactory factory = new ObjectFactory();
feed.getPagingAttributes().add(factory.createTotalResults(totalResults));
feed.getPagingAttributes().add(factory.createStartIndex(startIndex));
feed.getPagingAttributes().add(factory.createItemsPerPage(itemsPerPage));
return feed;
}
Aggregations