Justin
Justin

Reputation: 35

Cannot implicitly convert type string to string[] in c# soap call

I am very much perplexed by the error, "Cannot implicitly convert type string to string[]" in a soap call I am attempting to create. I am using VS2015 in C#. Looking at the code:

ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
ServiceReference1.Request req = new ServiceReference1.Request();
req.requestID = "validRequestIDString"; // I get the error here 

If I am using Bear SoapUI I have no issues sending the same requestID and getting a valid response.

I am guessing that the error is telling me that the response is an array and not a single string but I know that is incorrect.

Any direction would be helpful. Thank you

Upvotes: 0

Views: 909

Answers (1)

Tripp Kinetics
Tripp Kinetics

Reputation: 5449

How about something like:

request.requestID = new String[] { "validRequestIDString" };

Upvotes: 2

Related Questions