I'm new at ext.net. I create a new project and I change the web.config code but i always take configuration error. What am I supposed to do to fix this? here is my web.config code.
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false"/>
</configSections>
<extnet scriptMode="Release"/>
<!-- See Property Options in README.txt -->
<!--
The following system.web section is only requited for running ASP.NET AJAX under Internet
Information Services 6.0 (or earlier). This section is not necessary for IIS 7.0 or later.
-->
<system.web>
<httpHandlers>
<add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false"/>
</httpHandlers>
<httpModules>
<add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net"/>
</httpModules>
<compilation debug="true">
<assemblies>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation></system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0.
It is not necessary for previous version of IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net"/>
</modules>
<handlers>
<add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler"/>
</handlers>
</system.webServer>
A sample Web.config for Ext.NET is located in the Examples Explorer.
Add </ configuration> at end of file
You can add a Schema to Visual Studio. I made a schema that you can add manually.
http://forums.ext.net/showthread.php?27683-XML-Extnet-Schema-to-avoid-Information-Error-in-web-config
Add this code before tag into DotNetConfig.xsd schema.
I create the element based on 2.4.0 README File. http://examples.ext.net/#/Getting_St...uments/README/
<?xml version="1.0" encoding="us-ascii"?>
<xs:element name="extnet" vs:help="configuration/extnet">
<xs:complexType>
<xs:attribute name="ajaxViewStateMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Exclude" />
<xs:enumeration value="Include" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="cleanResourceUrl" type="small_boolean_Type" use="optional" />
<xs:attribute name="dateTimeZoneHandling" type="xs:string" use="optional" />
<xs:attribute name="disableViewState" type="small_boolean_Type" use="optional" />
<xs:attribute name="directEventUrl" type="xs:string" use="optional" />
<xs:attribute name="directMethodProxy" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Include" />
<xs:enumeration value="Ignore" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="directMethodNamespace" type="xs:string" use="optional" />
<xs:attribute name="glyphFontFamily" type="xs:string" use="optional" />
<xs:attribute name="gzip" type="small_boolean_Type" use="optional" />
<xs:attribute name="idMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Client" />
<xs:enumeration value="Explicit" />
<xs:enumeration value="Ignore" />
<xs:enumeration value="Inherit" />
<xs:enumeration value="Legacy" />
<xs:enumeration value="Parent" />
<xs:enumeration value="Predictable" />
<xs:enumeration value="Static" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="initScriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Inline" />
<xs:enumeration value="Linked" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="licenseKey" type="xs:string" use="optional" />
<xs:attribute name="locale" type="xs:string" use="optional" />
<xs:attribute name="namespace" type="xs:string" use="optional" />
<xs:attribute name="renderScripts" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="renderStyles" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Embedded" />
<xs:enumeration value="File" />
<xs:enumeration value="CDN" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="resourcePath" type="xs:string" use="optional" />
<xs:attribute name="resourcesStrategyType" type="xs:string" use="optional" />
<xs:attribute name="resetStyles" type="small_boolean_Type" use="optional" />
<xs:attribute name="rethrowAjaxExceptions" type="small_boolean_Type" use="optional" />
<xs:attribute name="rtl" type="small_boolean_Type" use="optional" />
<xs:attribute name="scriptMode" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Release" />
<xs:enumeration value="Debug" />
<xs:enumeration value="Development" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="showWarningOnAjaxFailure" type="small_boolean_Type" use="optional" />
<xs:attribute name="sourceFormatting" type="small_boolean_Type" use="optional" />
<xs:attribute name="stateProvider" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="PostBack" />
<xs:enumeration value="Cookie" />
<xs:enumeration value="None" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="submitDisabled" type="small_boolean_Type" use="optional" />
<xs:attribute name="theme" use="optional">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Default" />
<xs:enumeration value="Access" />
<xs:enumeration value="Gray" />
<xs:enumeration value="Neptune" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="themePath" type="xs:string" use="optional" />
<xs:attribute name="quickTips" type="small_boolean_Type" use="optional" />
<xs:anyAttribute namespace="http://schemas.microsoft.com/XML-Document-Transform" processContents="strict"/>
</xs:complexType>
</xs:element>
Then you can debug what is wrong on your ext.net configuration. And additionally you can use and have Ext.net Intellisense on web.config :D
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have a file, I shared it here http://codepad.org/V6FR2Wbs
It seems this file contains SOAP data. But I do not confirm that this contains SOAP data.
So I want to know, is there any specific format for SOAP data.
I got a similar question here What is the correct format of a SOAP response, but I don't see any format related information there.
There is very simple way to validate if request or response SOAPMessage is valid or not.
As a part of SOAP Message, it includes the namespace that points to SOAP XSD aka. XML schema definition, and the message be valid as per that XSD.
In your example, the SOAP message is--
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cwmp="urn:dslforum-org:cwmp-1-0"> <SOAP-ENV:Header> <cwmp:ID SOAP-ENV:mustUnderstand="1">279384</cwmp:ID> </SOAP-ENV:Header> <SOAP-ENV:Body> <cwmp:Inform> <DeviceId> <Manufacturer>Huawei Technologies Co., Ltd</Manufacturer> <OUI>00259E</OUI> <ProductClass>EG8040H5</ProductClass> <SerialNumber>48575443FF5E5D9D</SerialNumber> </DeviceId> <Event SOAP-ENC:arrayType="cwmp:EventStruct[1]"> <EventStruct> <EventCode>2 PERIODIC</EventCode> <CommandKey/> </EventStruct> </Event> <MaxEnvelopes>1</MaxEnvelopes> <CurrentTime>2019-06-19T15:30:33+00:00</CurrentTime> <RetryCount>0</RetryCount> <ParameterList SOAP-ENC:arrayType="cwmp:ParameterValueStruct[8]"> <ParameterValueStruct> <Name>InternetGatewayDevice.ManagementServer.ParameterKey</Name> <Value xsi:type="xsd:string"/> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.ManagementServer.ConnectionRequestURL</Name> <Value xsi:type="xsd:string">http://10.240.12.35:7547/1d9564b694ef18090a9377cd6f3217eb</Value> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.DeviceSummary</Name> <Value xsi:type="xsd:string">InternetGatewayDevice:1.4[](Baseline:1, EthernetLAN:1, WiFiLAN:2, Time:1, IPPing:1, DeviceAssociation:1)</Value> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.DeviceInfo.SpecVersion</Name> <Value xsi:type="xsd:string">1.0</Value> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.DeviceInfo.HardwareVersion</Name> <Value xsi:type="xsd:string">172D.A</Value> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.DeviceInfo.SoftwareVersion</Name> <Value xsi:type="xsd:string">V5R019C00S115</Value> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.DeviceInfo.ProvisioningCode</Name> <Value xsi:type="xsd:string"/> </ParameterValueStruct> <ParameterValueStruct> <Name>InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress</Name> <Value xsi:type="xsd:string">10.240.12.35</Value> </ParameterValueStruct> </ParameterList> </cwmp:Inform> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
In your example SOAP schema is located as http://schemas.xmlsoap.org/soap/envelope/
And the XSD for that schema is--
<?xml version='1.0' encoding='UTF-8' ?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/"
targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" >
<!-- Envelope, header and body -->
<xs:element name="Envelope" type="tns:Envelope" />
<xs:complexType name="Envelope" >
<xs:sequence>
<xs:element ref="tns:Header" minOccurs="0" />
<xs:element ref="tns:Body" minOccurs="1" />
<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>
<xs:element name="Header" type="tns:Header" />
<xs:complexType name="Header" >
<xs:sequence>
<xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:complexType>
<xs:element name="Body" type="tns:Body" />
<xs:complexType name="Body" >
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="##any" processContents="lax" >
<xs:annotation>
<xs:documentation>
Prose in the spec does not specify that attributes are allowed on the Body element
</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:complexType>
<!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. -->
<xs:attribute name="mustUnderstand" >
<xs:simpleType>
<xs:restriction base='xs:boolean'>
<xs:pattern value='0|1' />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="actor" type="xs:anyURI" />
<xs:simpleType name="encodingStyle" >
<xs:annotation>
<xs:documentation>
'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element. For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification
</xs:documentation>
</xs:annotation>
<xs:list itemType="xs:anyURI" />
</xs:simpleType>
<xs:attribute name="encodingStyle" type="tns:encodingStyle" />
<xs:attributeGroup name="encodingStyle" >
<xs:attribute ref="tns:encodingStyle" />
</xs:attributeGroup>
<xs:element name="Fault" type="tns:Fault" />
<xs:complexType name="Fault" final="extension" >
<xs:annotation>
<xs:documentation>
Fault reporting structure
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="faultcode" type="xs:QName" />
<xs:element name="faultstring" type="xs:string" />
<xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
<xs:element name="detail" type="tns:detail" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="detail">
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
<xs:anyAttribute namespace="##any" processContents="lax" />
</xs:complexType>
</xs:schema>
Using any programming language or API or online service, you could validate the SOAP message against the given XSD manually or automated way.
E.g.
As I did using this online service(https://www.liquid-technologies.com/online-xsd-validator) and your SOAP message found valid against the schema.
I have created a soap service using jax-ws in java.I want to consume my WSDL in SAP directly using ABAP proxy. How can i make my WSDL compatible for SAP?
I tried including Max and Min occurrence in my WSDL file. It is working when i test with soap ui. But still getting error in SAP like
SOAP Fault Code:3 One or More Soap header block not understood.
I have searched for this error but couldn't find anything useful.
This is WSDL file which is generated from XSD
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch="http://example.com/soap" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://example.com/soap" targetNamespace="http://example.com/soap">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://example.com/soap">
<xs:element name="getOrderRequest">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="purchaseOrderNumber" type="xs:long"/>
<xs:element maxOccurs="1" minOccurs="1" name="Type" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="vCode" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="vName" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="1" name="Location" type="xs:string"/>
<xs:element name="lineItem" type="tns:lineItem"
maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="lineItem">
<xs:sequence>
<xs:element name="Order_No" type="xs:long"/>
<xs:element name="Material" type="xs:string"/>
<xs:element name="Description" type="xs:string"/>
<xs:element name="UOM" type="xs:string"/>
<xs:element name="Value" type="xs:decimal"/>
<xs:element name="Tax" type="xs:string"/>
<xs:element name="Item" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getOrderResponse">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="1" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getOrderRequest">
<wsdl:part element="tns:getOrderRequest" name="getOrderRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getOrderResponse">
<wsdl:part element="tns:getOrderResponse" name="getOrderResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="OrderService">
<wsdl:operation name="getOrder">
<wsdl:input message="tns:getOrderRequest" name="getOrderRequest">
</wsdl:input>
<wsdl:output message="tns:getOrderResponse" name="getOrderResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OrderServiceSoap11" type="tns:OrderService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getOrder">
<soap:operation soapAction=""/>
<wsdl:input name="getOrderRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getOrderResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OrderServiceService">
<wsdl:port binding="tns:OrderServiceSoap11" name="OrderServiceSoap11">
<soap:address location="http://localhost:8089/Soap/app/OrderService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I want to know whether my WSDL file is correct?
Your wsdl policy and service elements are missing. You said that you are getting SOAP header understood error. SOAP header generally used for authentication and generally old SAP version not support authentication in header segment. Change your java code and try with basic authentication.
I have found that there is a handler io.undertow.server.handlers.accesslog.AccessLogHandler that can log http access.
However I am not able to configure it so it will produce any log messages.
Here is a code snippet from my standalone.xml:
<filter class-name="io.undertow.server.handlers.accesslog.AccessLogHandler" name="access-log-handler" module="io.undertow.core">
<param name="formatString" value="common"/>
<param name="accessLogReceiver" value="io.undertow.server.handlers.accesslog.JBossLoggingAccessLogReceiver"/>
</filter>
My question is how to configure that handler so it will start producing log messages.
no need to add custom filter for access log. All you need is to configure access log in subsystem itself.
This would be an example:
<host name="default-host" >
<location name="/" handler="welcome-content">
....
<access-log />
</host>
which will by default log in to log folder with prefix access_.log
you can also customize various things, from xsd:
<xs:attribute name="pattern" use="optional" type="xs:string" default="common"/>
<xs:attribute name="worker" use="optional" type="xs:string" default="default"/>
<xs:attribute name="directory" use="optional" type="xs:string" default="${jboss.server.log.dir}"/>
<xs:attribute name="relative-to" use="optional" type="xs:string" />
<xs:attribute name="prefix" use="optional" type="xs:string" default="access_log"/>
<xs:attribute name="suffix" use="optional" type="xs:string" default=".log"/>
I missed to add this xml snippet (StackOverflow):
<host name="default-host" >
.....
<filter-ref name="access-log-handler"/>
</host>
And then I got this:
Caused by: java.lang.NoSuchMethodException: io.undertow.server.handlers.accesslog.AccessLogHandler.<init>(io.undertow.server.HttpHandler)"}}
Which is a known bug: see this, or this
It is possible to use jboss-cli to add a handler and see how the standalone.xml changed:
/subsystem=undertow/configuration=filter/custom-filter=access-log-handler:add(class-name=io.undertow.server.handlers.accesslog.AccessLogHandler, module=io.undertow.core)
/subsystem=undertow/server=default-server/host=default-host/filter-ref=access-log-handler:add
I need to re use a status tag that I created in an XSD. For example in our order company we have several statuses. Status of an order- car order, truck order etc.
The tags that need to be used are unfortunately not the same. For the car it is a carStatus and for the truck it is a truckStatus but the underlying object are the same. It is a xs:string tag that has an enumeration of COMPLETED, BUSY or AWAITING INFORMATION.
Now I don not want to have 16 tags for 16 objects (car, track, chopper... -Status). Tomorrow if we add another status I have to go to all of these elements and update it.
My XSD where I reference the GenericCodeStatus looks as follows
<xs:schema targetNamespace="http://www.myDomain.co.za/myCoreXsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mine="http://www.myDomain.co.za/myCoreXsd" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Defining my Enum -->
<xs:element name="GenericCodeStatus">
<xs:annotation>
<xs:documentation>Generic code status</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="BUSY"/>
<xs:enumeration value="AWAITING INFORMATION"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<!-- Here I have mytag where I am referencing the genericCodeStatus -->
<xs:complexType name="MyTag1">
<xs:sequence>
<xs:element ref="mine:GenericCodeStatus"/>
</xs:sequence>
</xs:complexType>
Now the thing is that I want to have the genericCodeStatus under MyTag1 to have a name.
I tried creating it with a name and type tag (and i am using XML Spy as an editor)
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.myDomain.co.za/myCoreXsd" xmlns:mine="http://www.myDomain.co.za/myCoreXsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Defining my Enum -->
<xs:element name="GenericCodeStatus">
<xs:annotation>
<xs:documentation>Generic code status</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="BUSY"/>
<xs:enumeration value="AWAITING INFORMATION"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:complexType name="MyTag1">
<xs:sequence>
<!-- Taken this out -->
<xs:element ref="mine:GenericCodeStatus"/>
<!-- and replace it with name and type -->
<xs:element name="carStatus" type="mine:GenericCodeStatus"/>
</xs:sequence>
</xs:complexType>
But then get an error of an undefined value for 'type' encountered error.
I have also tried removing the 'mine' namespace.
If I try to replace the type with a ref as in
<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.myDomain.co.za/myCoreXsd" xmlns:mine="http://www.myDomain.co.za/myCoreXsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Defining my Enum -->
<xs:element name="GenericCodeStatus">
<xs:annotation>
<xs:documentation>Generic code status</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="BUSY"/>
<xs:enumeration value="AWAITING INFORMATION"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:complexType name="MyTag1">
<xs:sequence>
<!-- Taken this out -->
<xs:element ref="mine:GenericCodeStatus"/>
<!-- and replace it with name and ref -->
<xs:element name="carStatus" ref="GenericCodeStatus"/>
</xs:sequence>
</xs:complexType>
The validation works fine but if I save it XML Spy is removing the name element and I am back to where I started.
If anyone knows please?
I found the answer to this but thought of still posting this as it was difficult to find. Thanks to a buddy of mine :)
I should not define the Element like I did and then try to reference it over and over each time with a new name.
What I should do is to define the simpleType on its own and give it a name.
<!-- Define the simpleType as an enum and give it a name -->
<xs:simpleType name="myCoolDataType">
<xs:restriction base="xs:string">
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="BUSY"/>
<xs:enumeration value="AWAITING INFORMATION"/>
</xs:restriction>
</xs:simpleType>
Then where I want to use it I need to define the element and just give it a type with the value you gave to the enum in the first stip
<xs:complexType name="MyTag1">
<xs:sequence>
<xs:element name="truckStatus" type="mine:myCoolDataType"/>
<xs:element name="carStatus" type="mine:myCoolDataType"/>
</xs:sequence>
</xs:complexType>
According to SAML 2.0, a RequestAbstractType is defined in the following way:
<complexType name="RequestAbstractType" abstract="true">
<sequence>
<element ref="saml:Issuer" minOccurs="0"/>
<element ref="ds:Signature" minOccurs="0"/>
<element ref="samlp:Extensions" minOccurs="0"/>
</sequence>
<attribute name="ID" type="ID" use="required"/>
<attribute name="Version" type="string" use="required"/>
<attribute name="IssueInstant" type="dateTime" use="required"/>
<attribute name="Destination" type="anyURI" use="optional"/>
<attribute name="Consent" type="anyURI" use="optional"/>
</complexType>
What I'm interested in is the Extensions element, which is defined as:
<element name="Extensions" type="samlp:ExtensionsType"/>
<complexType name="ExtensionsType">
<sequence>
<any namespace="##other" processContents="lax" maxOccurs="unbounded"/>
</sequence>
</complexType>
How would I add/implement such an extension? I have no clue how to extend the RequestAbstractType.
The element allows you to include anything you want within it. Adding and processing of any data within that element would depend on your SAML product.
To give you an example of how it's used, here's a spec that leveraged it: http://docs.oasis-open.org/security/saml/SpecDrafts-Post2.0/sstc-saml-protocol-ext-rac.pdf