MichaelF
11 years agoOccasional Contributor
SoapUI and [Flags]
Hello,
I'm pretty new to Soap testing and currently evaluating, if SoapUI Pro is an viable option for our testing purposes.
Until now I'm quite positive that we are on the right tool, but I've stumbled over one problem that could be a blocker:
Our web service (written in c#) uses as parameters pretty complex data structures, due to specifications. These data structures often include Enums as flags. To show I've created a small test web service to keep complexity minimal.
These are the enum and the Method that uses the enum inside the test webservice:
This is the part of the WSDL of the web service, which defines the response types:
Basically this works with SoapUI. If I define in the request message the value of testEnum to be "A B C" the method gets the enum with flags A, B and C set. The return value then is "A B C D", which is correct. But my problem is the representation in SoapUI's editor. With a normal enum I get a dropbox to choose the value I'd like to send. But with a Flag enum I don't get anything but a text box, where I can enter the names of the values separated with empty spaces. That works but is not comfortable to work with at all. I would have expected some kind of listbox, where I can select the flags I want to set or a list of checkboxes.
Does anyone know something that could help me with that? I mean the functionality is given, it's only the representation. Anything I can do to solve that?
Thank You!
Michael
My expectations of SoapUI Pro would now be, that
I'm pretty new to Soap testing and currently evaluating, if SoapUI Pro is an viable option for our testing purposes.
Until now I'm quite positive that we are on the right tool, but I've stumbled over one problem that could be a blocker:
Our web service (written in c#) uses as parameters pretty complex data structures, due to specifications. These data structures often include Enums as flags. To show I've created a small test web service to keep complexity minimal.
These are the enum and the Method that uses the enum inside the test webservice:
[Flags]
public enum testEnum
{
A = 0x0001,
B = 0x0002,
C = 0x0004,
D = 0x0008
}
[WebMethod]
public testEnum TestMethod( testEnum e )
{
e |= testEnum.D;
return e;
}
This is the part of the WSDL of the web service, which defines the response types:
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="TestMethod">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="e" type="tns:testEnum"/>
</s:sequence>
</s:complexType>
</s:element>
<s:simpleType name="testEnum">
<s:list>
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="A"/>
<s:enumeration value="B"/>
<s:enumeration value="C"/>
<s:enumeration value="D"/>
</s:restriction>
</s:simpleType>
</s:list>
</s:simpleType>
<s:element name="TestMethodResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="TestMethodResult" type="tns:testEnum"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
Basically this works with SoapUI. If I define in the request message the value of testEnum to be "A B C" the method gets the enum with flags A, B and C set. The return value then is "A B C D", which is correct. But my problem is the representation in SoapUI's editor. With a normal enum I get a dropbox to choose the value I'd like to send. But with a Flag enum I don't get anything but a text box, where I can enter the names of the values separated with empty spaces. That works but is not comfortable to work with at all. I would have expected some kind of listbox, where I can select the flags I want to set or a list of checkboxes.
Does anyone know something that could help me with that? I mean the functionality is given, it's only the representation. Anything I can do to solve that?
Thank You!
Michael
My expectations of SoapUI Pro would now be, that