views:

19

answers:

2

This is what I have in my schema section of my WSDL to specify the field has to be comparison operators

                <xsd:simpleType>
                        <xsd:restriction base="xsd:string">
                            <xsd:pattern value="&lt;|&gt;|&lt;=|&gt;=|="/>
                        </xsd:restriction>
                </xsd:simpleType>

SoapUI complains about this part of the WSDL, I tried to set the value to something with non special characters and the WSDL is valid. So I tried to replace that whole long string to be value=">gt;" and it valid but value="<lt;" is not valid, and value=">" is also not valid. My question is, why does the WSDL validation need > to be double escaped?

The main question is, how to provide a valid less than side within the pattern value.

A: 

Hi wsxedc. This might actually be a bug in SoapUI. I tried using the following schema and XML with Apache Xalan (in Java):

Schema:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.foo.com/"
  xmlns:tns="http://www.foo.com/"
  elementFormDefault="qualified">

  <element name="foo">
    <simpleType>
      <restriction base="string">
        <pattern value="&lt;|&gt;|&lt;=|&gt;=|="/>
      </restriction>
    </simpleType>
  </element>

</schema>

Sample XML:

<foo xmlns='http://www.foo.com/'&gt;&amp;gt;&lt;/foo&gt;

and it validates fine. When I try this instead:

<foo xmlns='http://www.foo.com/'&gt;abc&lt;/foo&gt;

I get the following error, as expected: cvc-pattern-valid: Value 'abc' is not facet-valid with respect to pattern '<|>|<=|>=|=' for type '#AnonType_foo'.

My recommendation is to try using an enum instead. For example:

<simpleType>
  <restriction base="string">
    <enumeration value="&lt;" />
    <enumeration value="&gt;" />
    <enumeration value="&lt;=" />
    <enumeration value="&gt;=" />
    <enumeration value="=" />
  </restriction>
</simpleType>

And see if SoapUI likes this better. Hope this helps!

Matt Solnit
I left out a few other options like "[Ll][Ii][Kk][Ee]" I can spell it out by puting into 3 entries like "Like LIKE like", I'll try that.
wsxedc
A: 
wsxedc