0

I am converting a legacy web service to a WCF service. This service currently is being used by front end application. But as of now the front end is not going to consume the new WCF service so instead we plan on rerouting the request to our new service. The catch here is that the new WCF service should be able handle the old input request and should be able to send back the response in the exact same format.

When I generate a wsdl and add it in the soapUI project. The Body is getting wrapped inside a tag with the method name ("UserVerification" is the Operation contract name), is there any way to handle this with out using message contracts(I am using legacy types for input parameters so cant change them)

Right now it is coming like this:

<soapenv:Body>
  <wes:UserVerification>
     <!--Optional:-->
     <wes:userVerificationRequest wes:Direction="Request" >

     </wes:userVerificationRequest>
  </wes:UserVerificatio>
</soapenv:Body>

I want it to be like this

<soapenv:Body>
    <wes:UserVerificationRequest wes:Direction="Request" >

    </wes:UserVerificationRequest>
</soapenv:Body>
Nitheesh Reddy
  • 36
  • 1
  • 1
  • 11

1 Answers1

0

WCF by default uses the 'Wrapped' message style. If you want to be able to control how messages are serialized, you can define explicit messages by decorating with the MessageContractAttribute. With explicit message contracts, you can set the IsWrapped property to false.

In your case I think that EchoRequest and EchoResponse shouldn't be DataContracts at all, but rather MessageContracts. They look a lot like MessageContracts to me.

Using Message Contracts

Legends
  • 21,202
  • 16
  • 97
  • 123