You also have to specify the type in the SOAP message. For example
<Request i:type="d:RequestV1">
...
where i is defined as XML-Instance namespace
문제
I have a WCF Service; this service has an operation that receives an argument of type Request
. This is only the base type, and when calling the operation we actually send a value of type Request_V1
(which inherts from Request
), that has the complete implementation of the request I want to send.
When trying to test the service using soapUI, I'm able to create the complex type of type Request_V1
(adding the proper namespace) but for some reason, the service is receiving the value as if it were of Request
type.
Reading about ServiceKnowType
, I found out here that I need to specify somehow explicitly in the client this inheritance relationship, but I haven't found any info regarding how to do it on soapUI
Has anybody experienced and solved the same issue?
Thanks
올바른 솔루션이 없습니다
다른 팁
You also have to specify the type in the SOAP message. For example
<Request i:type="d:RequestV1">
...
where i is defined as XML-Instance namespace
On service side, you need to typecast to specific derived type.
operation (Request request){
if(!(request is Request_V1)){
throw Excetion("Unknown type!");
}
var request_v1 = Request as Request_V1;
// use request_v1
}
On SOAP UI side, specify type as below:
<soapenv:Body xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ns1:OperationName>
<ns1:request i:type="ns2:Request_V1">
Make sure you have defined ns1 and ns2 before referring to them.
You don't specify the inheritance in the client, rather in the service. SOAPUI shouldn't have a problem with that. Check you have the correct declarations on your data contracts. This might help - Deserialize Abstract Class.