Search code examples
wcfwcf-bindingwcf-security

Cross-Platform WCF Service with Composite Type to be consumed by any client


I've to create a WCF web service that should be able to send/receive data from almost any client i.e. be client agnostic, can be called by Java clients, IOS clients etc. REST is out of question in this case since the decision for SOAP has already been taken and parts of the architecture have already been implemented. I've been given a sample request mapping e.g.:

Envelope/Body/createOrder/order/customerID
Envelope/Body/createOrder/order/shipmentDate
Envelope/Body/createOrder/order/items/item/lineNumber

Similarly a response mapping has also been given to me that is similar to above.

I'm looking for your advice on:

  1. What the service contract signature (parameter types and return type) for such a service should be like so that it can accept and return SOAP data and not tied to .Net platform only? Shall I just accept and return XMLElement? Shall it just be string?

Solution

  • I'm closing this question by answering myself and for future searches on same topic. I ended up declaring both the parameter and return type of the service to be XElement:

    XElement ConfirmRegistration(XElement registrationData);
    

    I used XElement to utilize XML to LINQ.