Reputation: 101
I’m unable to consume a WSO2 data service from C#. I created the data service using the documented way and then am able to interact with it from the “TryIt” function. Then I register a service reference in Visual studio 2010. The error I receive is:
The method 'update_RealtyIntroduction_operation' in type 'Realty1.ServiceReference1.RealtyIntroduction_DataServicePortType' is marked IsOneWay=true
and declares one or more FaultContractAttributes. One-way methods cannot declare FaultContractAttributes.
To fix it, change IsOneWay to false or remove the FaultContractAttributes.
If I edit the generated code by removing either the IsOneWay or the FaultContractAttributes then it works correctly until I update the service reference. It seems the problem is in the WSDL 1.1 that is generated by WSO2, in that it contravenes the W3C standard. The standard defines the following operation:
<wsdl:definitions .... > <wsdl:portType .... > *
<wsdl:operation name="nmtoken">
<wsdl:input name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType >
</wsdl:definitions>
http://www.w3.org/TR/wsdl#_one-way
But WSO2 is generating the following:
<wsdl:operation name="update_RealtyIntroduction_operation">
<wsdl:documentation />
<wsdl:input wsaw:Action="urn:update_RealtyIntroduction_operation" message="ns0:update_RealtyIntroduction_operationRequest" />
<wsdl:fault wsaw:Action="urn:update_RealtyIntroduction_operationDataServiceFault" name="DataServiceFault" message="ns0:DataServiceFault" />
</wsdl:operation>
Does anyone have some advice on how to make this interoperate?
Upvotes: 0
Views: 1091
Reputation: 614
Yeah, this seems to be a bug for in-only operations. For now, for a potential in-only operation you make, you can set the flag "returnRequestStatus" for a data service operation to actually make it an in-out operation, then it will simply send a static success message for successful invocations, or else will send a SOAP fault. And the WSDL generated from those type of operations will be conformant to the spec.
Cheers, Anjana.
Upvotes: 1