I am having trouble testing a WCF service method with soap UI which accepts a Stream object. This is the Object the service method has as input parameter:
[DataContract(Namespace = Constants.NAMESPACE)]
public class RemoteFileInfo : IDisposable
{
[DataMember(IsRequired = true, Order = 1)]
public string FileName { get; set; }
[DataMember(IsRequired = true, Order = 2)]
public long Length { get; set; }
[DataMember(IsRequired = true, Order = 3)]
public System.IO.Stream FileByteStream { get; set; }
public void Dispose()
{
if (FileByteStream != null)
{
FileByteStream.Close();
FileByteStream = null;
}
}
}
The generated request in soap UI:
...
<ws:File>
<ws:FileName>?</ws:FileName>
<ws:Length>?</ws:Length>
<ws:FileByteStream>
<sys:__identity>?</sys:__identity>
</ws:FileByteStream>
</ws:File>
What do I need to do in soap UI to test this method?
You just have to call your request with specific TestRequest Properties.
Turn the TestRequest Properties :
Inline Response Attachments
= True
Enable Inline Files
= True
Also if your request send the file you need to attach the files in your request.
In your request click on the tab attachments
and add the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With