我想知道是否有人能指出我在这里正确的方向。
我正在开发一个项目,需要创建Web服务功能以遵守SPML v2规范(https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=provision)。 这是一个基于XML的配置服务规范。
我已经创建了映射到SOAP请求的名称空间和localpart的端点。 我的问题在于尝试使用规范本身提供的XSD来验证spring Web服务中的有效负载请求。 根据我的研究,它是一个“开放内容模型”,任何验证或尝试编译XSD都会导致唯一粒子归因错误。
发生这种情况是因为CORE XSD具有“ExtensibleType”complexType,当其他complexTypes从中扩展时会导致错误。 根据我的研究,我可以看到错误发生的原因,但我不想修改规范本身提供的xsds。
例:
<complexType name="ExtensibleType"> <sequence> <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </sequence> <anyAttribute namespace="##other" processContents="lax"/> </complexType> <complexType name="SearchQueryType"> <complexContent> <extension base="spml:ExtensibleType"> <sequence> <annotation> <documentation>Open content is one or more instances of QueryClauseType (including SelectionType) or LogicalOperator.</documentation> </annotation> <element name="basePsoID" type="spml:PSOIdentifierType" minOccurs="0" /> </sequence> <attribute name="targetID" type="string" use="optional"/> <attribute name="scope" type="spmlsearch:ScopeType" use="optional"/> </extension> </complexContent> </complexType>尝试验证xsds时,这会导致以下错误:
cos-nonambig:WC [## other:“urn:oasis:names:tc:SPML:2:0”]和“urn:oasis:names:tc:SPML:2:0:search”:basePsoID(或来自的元素)他们的替代组)违反了“独特粒子归因”。 在针对此模式进行验证期间,将为这两个粒子创建歧义。
由于XSD本身无效,我正在寻找一个时间来确定如何实际验证规范本身提供的XSDS的有效负载请求。
在Spring上下文文件中添加PayloadValidatingInterceptor会在服务器尝试启动时导致相同的错误:
<bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="schemas"> <list> <value>/WEB-INF/xsd/spml/pstc_spmlv2_core.xsd</value> <value>/WEB-INF/xsd/spml/pstc_spmlv2_search.xsd</value> </list> </property> <property name="validateRequest" value="true"/> <property name="validateResponse" value="false"/> </bean>感谢任何人提前输入,不确定是否有人遇到过这种类型的问题。
达米安
I was wondering if anyone could point me in the right direction here.
I'm working on a project that needs to create web service functionality to adhere to the SPML v2 Spec (https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=provision). It's an XML based spec for provisioning services.
I've created the end points that map to the namespace and localpart of the soap requests fine. My issue lies in attempting to validate the payload requests in spring web services using the provided XSDs from the spec itself. From my research, it is an "Open Content Model", and any validation or attempt to compile the XSDs results in Unique Particle Attribution errors.
This happens because the CORE XSD has an "ExtensibleType" complexType that when other complexTypes extend from it causes the error. From my research, i can see why the error is occurring, but i don't want to modify the xsds provided by the spec itself.
Example:
<complexType name="ExtensibleType"> <sequence> <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </sequence> <anyAttribute namespace="##other" processContents="lax"/> </complexType> <complexType name="SearchQueryType"> <complexContent> <extension base="spml:ExtensibleType"> <sequence> <annotation> <documentation>Open content is one or more instances of QueryClauseType (including SelectionType) or LogicalOperator.</documentation> </annotation> <element name="basePsoID" type="spml:PSOIdentifierType" minOccurs="0" /> </sequence> <attribute name="targetID" type="string" use="optional"/> <attribute name="scope" type="spmlsearch:ScopeType" use="optional"/> </extension> </complexContent> </complexType>This would result in the following error when attempting to validate the xsds:
cos-nonambig: WC[##other:"urn:oasis:names:tc:SPML:2:0"] and "urn:oasis:names:tc:SPML: 2:0:search":basePsoID (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
Since the XSDs are invalid themselves, i'm having a duzy of a time figuring out how i can actually validate payload requests against the XSDS provided by the spec itself.
Adding the PayloadValidatingInterceptor in the spring context file results in the same error when the server attempts to start:
<bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="schemas"> <list> <value>/WEB-INF/xsd/spml/pstc_spmlv2_core.xsd</value> <value>/WEB-INF/xsd/spml/pstc_spmlv2_search.xsd</value> </list> </property> <property name="validateRequest" value="true"/> <property name="validateResponse" value="false"/> </bean>Thanks for anyone's input ahead of time, not sure if anyone ever ran into this type of issue or not.
Damian
最满意答案
您需要做的是禁用Unique Particle Attribution检查。 一般来说,这适用于Java(请参阅此SO帖子 ),您只需要找到一种方法来配置它...最坏的情况可能是基于上面的链接构建自己的验证器 - 它应该工作,因为Spring的XSD架构是使用Apache的实现。
What you need to do is disable the Unique Particle Attribution check. In general, this works in Java (see this SO post), you just need to find a way to configure it... Worst case might be to build your own validator based on the above link - it should work since Spring's XSD schemas are using Apache's implementation.
如果他们的XSD具有唯一的粒子属性错误,我如何验证Spring Web Services中的SPML SOAP请求?(How can i validate SPML SOAP Requests in Spring Web Services if their XSDs have Unique Particle Attribution Errors?)我想知道是否有人能指出我在这里正确的方向。
我正在开发一个项目,需要创建Web服务功能以遵守SPML v2规范(https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=provision)。 这是一个基于XML的配置服务规范。
我已经创建了映射到SOAP请求的名称空间和localpart的端点。 我的问题在于尝试使用规范本身提供的XSD来验证spring Web服务中的有效负载请求。 根据我的研究,它是一个“开放内容模型”,任何验证或尝试编译XSD都会导致唯一粒子归因错误。
发生这种情况是因为CORE XSD具有“ExtensibleType”complexType,当其他complexTypes从中扩展时会导致错误。 根据我的研究,我可以看到错误发生的原因,但我不想修改规范本身提供的xsds。
例:
<complexType name="ExtensibleType"> <sequence> <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </sequence> <anyAttribute namespace="##other" processContents="lax"/> </complexType> <complexType name="SearchQueryType"> <complexContent> <extension base="spml:ExtensibleType"> <sequence> <annotation> <documentation>Open content is one or more instances of QueryClauseType (including SelectionType) or LogicalOperator.</documentation> </annotation> <element name="basePsoID" type="spml:PSOIdentifierType" minOccurs="0" /> </sequence> <attribute name="targetID" type="string" use="optional"/> <attribute name="scope" type="spmlsearch:ScopeType" use="optional"/> </extension> </complexContent> </complexType>尝试验证xsds时,这会导致以下错误:
cos-nonambig:WC [## other:“urn:oasis:names:tc:SPML:2:0”]和“urn:oasis:names:tc:SPML:2:0:search”:basePsoID(或来自的元素)他们的替代组)违反了“独特粒子归因”。 在针对此模式进行验证期间,将为这两个粒子创建歧义。
由于XSD本身无效,我正在寻找一个时间来确定如何实际验证规范本身提供的XSDS的有效负载请求。
在Spring上下文文件中添加PayloadValidatingInterceptor会在服务器尝试启动时导致相同的错误:
<bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="schemas"> <list> <value>/WEB-INF/xsd/spml/pstc_spmlv2_core.xsd</value> <value>/WEB-INF/xsd/spml/pstc_spmlv2_search.xsd</value> </list> </property> <property name="validateRequest" value="true"/> <property name="validateResponse" value="false"/> </bean>感谢任何人提前输入,不确定是否有人遇到过这种类型的问题。
达米安
I was wondering if anyone could point me in the right direction here.
I'm working on a project that needs to create web service functionality to adhere to the SPML v2 Spec (https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=provision). It's an XML based spec for provisioning services.
I've created the end points that map to the namespace and localpart of the soap requests fine. My issue lies in attempting to validate the payload requests in spring web services using the provided XSDs from the spec itself. From my research, it is an "Open Content Model", and any validation or attempt to compile the XSDs results in Unique Particle Attribution errors.
This happens because the CORE XSD has an "ExtensibleType" complexType that when other complexTypes extend from it causes the error. From my research, i can see why the error is occurring, but i don't want to modify the xsds provided by the spec itself.
Example:
<complexType name="ExtensibleType"> <sequence> <any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/> </sequence> <anyAttribute namespace="##other" processContents="lax"/> </complexType> <complexType name="SearchQueryType"> <complexContent> <extension base="spml:ExtensibleType"> <sequence> <annotation> <documentation>Open content is one or more instances of QueryClauseType (including SelectionType) or LogicalOperator.</documentation> </annotation> <element name="basePsoID" type="spml:PSOIdentifierType" minOccurs="0" /> </sequence> <attribute name="targetID" type="string" use="optional"/> <attribute name="scope" type="spmlsearch:ScopeType" use="optional"/> </extension> </complexContent> </complexType>This would result in the following error when attempting to validate the xsds:
cos-nonambig: WC[##other:"urn:oasis:names:tc:SPML:2:0"] and "urn:oasis:names:tc:SPML: 2:0:search":basePsoID (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles.
Since the XSDs are invalid themselves, i'm having a duzy of a time figuring out how i can actually validate payload requests against the XSDS provided by the spec itself.
Adding the PayloadValidatingInterceptor in the spring context file results in the same error when the server attempts to start:
<bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor"> <property name="schemas"> <list> <value>/WEB-INF/xsd/spml/pstc_spmlv2_core.xsd</value> <value>/WEB-INF/xsd/spml/pstc_spmlv2_search.xsd</value> </list> </property> <property name="validateRequest" value="true"/> <property name="validateResponse" value="false"/> </bean>Thanks for anyone's input ahead of time, not sure if anyone ever ran into this type of issue or not.
Damian
最满意答案
您需要做的是禁用Unique Particle Attribution检查。 一般来说,这适用于Java(请参阅此SO帖子 ),您只需要找到一种方法来配置它...最坏的情况可能是基于上面的链接构建自己的验证器 - 它应该工作,因为Spring的XSD架构是使用Apache的实现。
What you need to do is disable the Unique Particle Attribution check. In general, this works in Java (see this SO post), you just need to find a way to configure it... Worst case might be to build your own validator based on the above link - it should work since Spring's XSD schemas are using Apache's implementation.
发布评论