XML : WCF Data Contract XML

i am fairly new at WCF and i am trying to write a service which receives an xml message, (sorry for the vagueness here) then I need to do a bunch of tasks based on the XML content.

Previously this was an ASMX service that accept a string and converted it to XML but now we are moving to WCF i need to create a data contract and this is were I am stumbling the XML format is below

  <SRREQUEST>  <GENERATED_DATE>2016-02-21T14:23:54</GENERATED_DATE>  <SYSTEMID>xxxx</SYSTEMID>  <SERVICEREQUEST>      <SR_NUMBER>xxxx</SR_NUMBER>      <CUSTOMER_ACCT>xxxx</CUSTOMER_ACCT>      <CONTACT_ID>xxxx</CONTACT_ID>      <CONTACT_NAME>xxxx</CONTACT_NAME>      <CONTACT_EMAIL>xxxx</CONTACT_EMAIL>      <END_USER_NAME>xxxx</END_USER_NAME>      <END_USER_EMAIL>xxxx</END_USER_EMAIL>      <END_USER_PHONE>xxxx</END_USER_PHONE>      <SITENAME>xxxx</SITENAME>      <ADDRESS_1>xxxx</ADDRESS_1>      <ADDRESS_2>xxxx</ADDRESS_2>      <CITY>xxxx</CITY>      <COUNTRY>xxxx</COUNTRY>      <POSTCODE>xxxx</POSTCODE>      <SR_TYPE>xxxx</SR_TYPE>      <RETURN_REASON>xxxx</RETURN_REASON>      <WARRANTY_TYPE>xxxx</WARRANTY_TYPE>      <RETURN_TYPE>xxxx</RETURN_TYPE>      <PRIORITY>xxxx</PRIORITY>      <ORIGIN>xxxx</ORIGIN>      <CUST_REF>xxxx</CUST_REF>      <CUST_COMMENTS>xxxx</CUST_COMMENTS>      <CUST_UPDATE>xxxx</CUST_UPDATE>      <BRAND>xxxx</BRAND>      <TYPE>xxxx</TYPE>      <MODEL>xxxx</MODEL>      <ASSET_TAG>xxxx</ASSET_TAG>      <SERIAL_NUMBER>xxxx</SERIAL_NUMBER>      <ORDER_REF_NUM>xxxx</ORDER_REF_NUM>      <ORDER_NUMBER>xxxx</ORDER_NUMBER>  </SERVICEREQUEST>    

This XML could have multiple SERVICEREQUEST tags

Currently I have this OperationContract

  [OperationContract]      [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml)]      string ServiceRequest(ServiceRequest data);    

but my datacontract is empty

Any help would be appreciated.

No comments:

Post a Comment