xsd

BigDecimal has scientific notation in soap message

心不动则不痛 提交于 2020-01-02 03:20:10
问题 I have got strange problem with our webservice. I have got object OrderPosition which has got a price (which is xsd:decimal with fractionDigits = 9). Apache CXF generate proxy classes for me, and this field is BigDecimal. When I'd like to send value greater than 10000000.00000, this field in soap message has got scientific notation (for example 1.1423E+7). How can I enforce that the value has not been sent in scientific notation. 回答1: Here is one way this can be done. BigDecimal has a

Mapping Java Date Object to XML Schema datetime format

南笙酒味 提交于 2020-01-02 03:13:07
问题 I am having some problem mapping my Java Data Type to standard Schema Date data type. I have a simple class that I annotated like this. The period instance variable is of Java Date object type. @XmlAccessorType(value = XmlAccessType.NONE) public class Chart { @XmlElement private double amount; @XmlElement private double amountDue; @XmlElement private Date period; //constructor getters and setters } Here is my Web Service @WebService public class ChartFacade { @WebMethod public Chart getChart(

401 Authentication Error when SoapClient tries to fetch schema file

◇◆丶佛笑我妖孽 提交于 2020-01-02 03:00:50
问题 My application routinely connects to a third-party server to fetch data via SOAP/WSDL: $this->soap_client = new SoapClient("https://[the-domain]:443/[path]?wsdl", array( 'trace'=>1, 'login'=>$this->username, 'password'=>$this->password, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_NONE ) Everything has been great for the last year, but they recently updated their WSDL file and now when the application tries to connect I'm getting the following two errors : SoapClient::SoapClient(http://

Content restriction and attribute validation on the same element in XSD

橙三吉。 提交于 2020-01-02 02:52:06
问题 I would like to validate that an element 'Test' should Have its content restricted (for example, using a pattern restriction), and Contain certain attributes (for example, 'id', 'class' and 'name'). The XSD I'm writing looks like this: <xsd:element name="Test" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType mixed="true"> <xsd:simpleContent> <xsd:restriction> <xsd:pattern value="xyz"/> </xsd:restriction> </xsd:simpleContent> <xsd:attribute name="id" type="xsd:string"></xsd:attribute>

XML Schema Unique Together on Two Attributes

若如初见. 提交于 2020-01-02 01:19:10
问题 I have a simple XML structure: <foo> <bar row="42" column="2"></bar> <bar row="42" column="3"></bar> </foo> I would like row and column of bar to be unique together. So the above example validates, whereas the following does not: <foo> <bar row="42" column="2"></bar> <bar row="42" column="3"></bar> <bar row="42" column="3"></bar> </foo> I've been trying to add a key to the following schema, but I haven't found a solution yet. <xs:element name="foo"> <xs:complexType> <xs:sequence> <xs:element

Will an instance with a xsd:token-type element containing whitespace pass validation?

时光怂恿深爱的人放手 提交于 2020-01-01 19:42:10
问题 The ultimate goal is to prevent whitespace in a pool of validated XML content by simply not allowing bad xs:token content to pass schema validation for relevant elements. Schema-invalid instances are not allowed into the pool. If I declare an element's type to be xsd:token in an XML Schema (1.1) and I try to validate an instance of this schema where the xsd:token -typed element contains more than zero of the repudiated characters (tab, LF, CR) or a double, leading or trailing space, will said

Programmatically Create XML File From XSD

非 Y 不嫁゛ 提交于 2020-01-01 17:06:49
问题 I have an XSD file and I want to create an XML file at runtime based on the XSD. (My question is basically the same as this one, except in the .NET world, rather than for Java.) I have run xsd.exe /c /l:vb MyTest.xsd , but that generates a class that cannot be instantiated and used, as it has nested classes that are never instantiated. It appears that the generated class is only used for XML deserialization, but I don't have an XML file to deserialize from. Running xsd.exe /d /l:vb MyTest.xsd

How make univoque my enumeration by xs:unique

早过忘川 提交于 2020-01-01 16:10:57
问题 Can anyone point me as to why the unique element in my XSD is not forcing unique-ness? This should throw an error because the last ScreenResult element does not contain a unique value for the Type attribute. I should also note that I'm truly after forcing one of each Type within ScreenResults ( ScreenResult is required to exist 3 times, there are 3 types of screens and I am requiring unique-ness) so if there is a better way to accomplish that, I'm all for that as well. Thank you. Here is my

How make univoque my enumeration by xs:unique

 ̄綄美尐妖づ 提交于 2020-01-01 16:10:13
问题 Can anyone point me as to why the unique element in my XSD is not forcing unique-ness? This should throw an error because the last ScreenResult element does not contain a unique value for the Type attribute. I should also note that I'm truly after forcing one of each Type within ScreenResults ( ScreenResult is required to exist 3 times, there are 3 types of screens and I am requiring unique-ness) so if there is a better way to accomplish that, I'm all for that as well. Thank you. Here is my

SvcUtil generates “Order” Named Parameter for xsd:all complexcontent

巧了我就是萌 提交于 2020-01-01 15:39:30
问题 Here is my dilemma, the svcutil command still generates Order Named parameter for complex content who are marked as xsd:all. Here is my sample schema. <xsd:complexType name="SpecialReportEntityRow" > <xsd:complexContent> <xsd:extension base="list:BaseRowExt"> <xsd:all> <xsd:element name="customerName" type="xsd:string" form="unqualified" minOccurs="0" maxOccurs="1" /> <xsd:element name="Id" type="xsd:long" form="unqualified" minOccurs="0" maxOccurs="1" /> <xsd:element name="certificateType"