Skip to content
Snippets Groups Projects
Commit 86d98891 authored by Elemer Lelik's avatar Elemer Lelik
Browse files

First code commit

parent e3374a92
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- The only two possible root elements are methodResponse and
methodCall so these are the only two I use a top-level
declaration for. -->
<xsd:element name="methodCall">
<xsd:complexType>
<xsd:all>
<xsd:element name="methodName">
<xsd:simpleType>
<xsd:restriction base="ASCIIString">
<xsd:pattern value="([A-Za-z0-9]|/|\.|:|_)*" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="params" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="param" type="ParamType"
minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="methodResponse">
<xsd:complexType>
<xsd:choice>
<xsd:element name="params">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="param" type="ParamType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="fault">
<!-- What can appear inside a fault is very restricted -->
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="struct">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="member"
type="MemberType">
</xsd:element>
<xsd:element name="member"
type="MemberType">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ParamType">
<xsd:sequence>
<xsd:element name="value" type="ValueType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ValueType" mixed="true">
<!-- I need to figure out how to say that this
is either a simple xsd:string type or that
it contains one of these elements; but that otherwise
it does not have mixed content -->
<xsd:choice>
<xsd:element name="i4" type="xsd:int"/>
<xsd:element name="int" type="xsd:int"/>
<xsd:element name="string" type="ASCIIString"/>
<xsd:element name="double" type="xsd:decimal"/>
<xsd:element name="Base64" type="xsd:base64Binary"/>
<xsd:element name="boolean" type="NumericBoolean"/>
<xsd:element name="dateTime.iso8601" type="xsd:dateTime"/>
<xsd:element name="array" type="ArrayType"/>
<xsd:element name="struct" type="StructType"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="StructType">
<xsd:sequence>
<xsd:element name="member" type="MemberType"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="MemberType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string" />
<xsd:element name="value" type="ValueType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayType">
<xsd:sequence>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="ValueType"
minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="ASCIIString">
<xsd:restriction base="xsd:string">
<xsd:pattern value="([ -~]|\n|\r|\t)*" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="NumericBoolean">
<xsd:restriction base="xsd:boolean">
<xsd:pattern value="0|1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
/*******************************************************************************
* Copyright (c) 2000-2018 Ericsson Telecom AB
*
* XSD to TTCN-3 Translator version: CRL 113 200/6 R4B
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*******************************************************************************/
//
// File: XML_RPC.ttcn
// Description:
// References:
// Rev:
// Prodnr:
// Updated: Thu Aug 2 13:51:04 2018
// Contact: http://ttcn.ericsson.se
//
////////////////////////////////////////////////////////////////////////////////
// Generated from file(s):
// - XML-RPC.xsd
// /* xml version = "1.0" */
// /* targetnamespace = "NoTargetNamespace" */
////////////////////////////////////////////////////////////////////////////////
// Modification header(s):
//-----------------------------------------------------------------------------
// Modified by:
// Modification date:
// Description:
// Modification contact:
//------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
module XML_RPC {
import from XSD all;
external function enc_MethodCall(in MethodCall pdu) return octetstring
with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
external function dec_MethodCall(in octetstring stream) return MethodCall
with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
external function enc_MethodResponse(in MethodResponse pdu) return octetstring
with { extension "prototype (convert) encode(XER:XER_EXTENDED)" }
external function dec_MethodResponse(in octetstring stream) return MethodResponse
with { extension "prototype (convert) decode(XER:XER_EXTENDED)" }
type record MethodCall
{
record of enumerated {
methodName,
params
} order,
XSD.String methodName (pattern "([A-Za-z0-9]|/|.|:|_)*"),
record {
record of ParamType param_list
} params optional
}
with {
variant "name as uncapitalized";
variant "useOrder";
variant "element";
variant (params.param_list) "untagged";
variant (params.param_list[-]) "name as 'param'";
};
type record MethodResponse
{
union {
record {
ParamType param_
} params,
/* What can appear inside a fault is very restricted */
record {
record {
record {
MemberType member,
MemberType member_1
} struct
} value_
} fault
} choice
}
with {
variant "name as uncapitalized";
variant "element";
variant (choice) "untagged";
variant (choice.params.param_) "name as 'param'";
variant (choice.fault.value_) "name as 'value'";
variant (choice.fault.value_.struct.member_1) "name as 'member'";
};
type record ParamType
{
ValueType value_
}
with {
variant (value_) "name as 'value'";
};
type record ValueType
{
record of XSD.String embed_values,
union {
XSD.Int i4,
// XSD.Int int,
ASCIIString string,
XSD.Decimal double,
XSD.Base64Binary base64,
NumericBoolean boolean_,
XSD.DateTime dateTime_iso8601,
ArrayType array,
StructType struct
} choice
}
with {
variant "embedValues";
variant (choice) "untagged";
variant (choice.base64) "name as capitalized";
variant (choice.boolean_) "name as 'boolean'";
variant (choice.dateTime_iso8601) "name as 'dateTime.iso8601'";
};
type record StructType
{
record length(1 .. infinity) of MemberType member_list
}
with {
variant (member_list) "untagged";
variant (member_list[-]) "name as 'member'";
};
type record MemberType
{
XSD.String name,
ValueType value_
}
with {
variant (value_) "name as 'value'";
};
type record ArrayType
{
record {
record of ValueType value_list
} data
}
with {
variant (data.value_list) "untagged";
variant (data.value_list[-]) "name as 'value'";
};
type XSD.String ASCIIString (pattern "([ -~]|\n|\r|\t)*");
type XSD.Boolean NumericBoolean;
//with {
//variant "text 'true' as '1'";
//variant "text 'false' as '0'";
//};
}
with {
encode "XML";
variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'";
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment