Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web Service 'System.ServiceModel.XmlSerializerFormatAttribute' does not contain a definition for 'Style'

For an Windows Phone 8 Application, I need to connect to a Web Service. But when I use the Visual tool to add the service reference, it adds a file "Reference.cs" with an error :

'System.ServiceModel.XmlSerializerFormatAttribute' does not contain a definition for 'Style'

like image 619
user2707829 Avatar asked Nov 26 '25 00:11

user2707829


1 Answers

listen i had the same problem, so i added another attribute [System.ServiceModel.DataContractFormat(Style=System.ServiceModel.OperationFormatStyle.Rpc)]

any ways the service gave an error that i can't have both attributes

[System.ServiceModel.XmlSerializerFormatAttribute(SupportFaults=true)] [System.ServiceModel.DataContractFormat(Style=System.ServiceModel.OperationFormatStyle.Rpc)] so when i removed the XmlSerializerFormatAttribute and just left datacontractformate it returned the desired object (response )but with all values = null when i removed the DataContractFormat it returned null not even an empty object so i had to call this service form my code using httpclient.postasync and passing the soap xml to it, if u need more details let me know good luck :)

like image 138
Bassem Wissa Avatar answered Nov 28 '25 16:11

Bassem Wissa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!