use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.
the class AndroidMarshallerTest method testConversionOfDIDAuthenticateResponseCA.
@Test
public void testConversionOfDIDAuthenticateResponseCA() throws Exception {
WSMarshaller m = new AndroidMarshaller();
DIDAuthenticateResponse didAuthResponse = new DIDAuthenticateResponse();
Result r = new Result();
r.setResultMajor("major");
r.setResultMinor("minor");
InternationalStringType internationalStringType = new InternationalStringType();
internationalStringType.setLang("en");
internationalStringType.setValue("message");
r.setResultMessage(internationalStringType);
didAuthResponse.setResult(r);
EAC2OutputType didAuthenticationDataType = new EAC2OutputType();
didAuthenticationDataType.setProtocol("urn:....");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document d = builder.newDocument();
Element e = d.createElementNS("urn:iso:std:iso-iec:24727:tech:schema", "Signature");
e.setTextContent("7117D7BF95D8D6BD437A0D43DE48F42528273A98F2605758D6A3A2BFC38141E7577CABB4F8FBC8DF152E3A097D1B3A703597331842425FE4A9D0F1C9067AC4A9");
didAuthenticationDataType.getAny().add(e);
didAuthResponse.setAuthenticationProtocolData(didAuthenticationDataType);
marshalLog(didAuthResponse);
Document doc = m.marshal(didAuthResponse);
String s = m.doc2str(doc);
LOG.debug(s);
StringReader sr = new StringReader(s);
DIDAuthenticateResponse didaresp = JAXB.unmarshal(sr, DIDAuthenticateResponse.class);
marshalLog(didaresp);
}
use of oasis.names.tc.dss._1_0.core.schema.InternationalStringType in project open-ecard by ecsec.
the class AndroidMarshaller method parseDataSetInfo.
private DataSetInfoType parseDataSetInfo(XmlPullParser parser) throws XmlPullParserException, IOException {
DataSetInfoType dataSetInfo = new DataSetInfoType();
int eventType;
do {
parser.next();
eventType = parser.getEventType();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("RequirementLevel")) {
dataSetInfo.setRequirementLevel(BasicRequirementsType.fromValue(parser.nextText()));
} else if (parser.getName().equals("DataSetACL")) {
dataSetInfo.setDataSetACL(this.parseACL(parser, "DataSetACL"));
} else if (parser.getName().equals("DataSetName")) {
dataSetInfo.setDataSetName(parser.nextText());
} else if (parser.getName().equals("DataSetPath")) {
dataSetInfo.setDataSetPath(this.parseDataSetPath(parser));
} else if (parser.getName().equals("LocalDataSetName")) {
InternationalStringType internationalString = new InternationalStringType();
internationalString.setLang(parser.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang"));
internationalString.setValue(parser.nextText());
dataSetInfo.getLocalDataSetName().add(internationalString);
} else {
throw new IOException(parser.getName() + " not yet implemented");
}
}
} while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("DataSetInfo")));
return dataSetInfo;
}
Aggregations