5
votes

I have a .Net WCF client/proxy built based on a Delphi service. The Delphi service is providing SOAP messages in a format that my client has been unable to process.

Based on the guidance here: Delphi SOAP Envelope and WCF I've come to understand that WCF expects "Document/Literal/Wrapped" style to be the way in which the message is serialized. As it turns out, the Delphi service is using "rpc" as the style.

I cannot get the delphi service to change its style.

Is there a way I can tell the WCF client to use "rpc" instead.

For reference, here's the Delphi service I'm building against: http://www.tntschools.com/AkiTimeTableService/wsdl/ICourses

1
How did you create client/proxy? Via Add Service Reference or you have built it manually?Rest Wing
I used "Add Service Reference" to build it.Irwin
See the answer below. Please post message of the exception you are getting in WCF client.Rest Wing

1 Answers

4
votes

When adding the service reference this way, each generated message contract is decorated in similar way as following one:

[DebuggerStepThrough]
[GeneratedCode( "System.ServiceModel", "4.0.0.0" )]
[MessageContract( WrapperName = "GetCourseList", WrapperNamespace = "urn:CoursesIntf-ICourses",
    IsWrapped = true )]
public partial class GetCourseListRequest
{
    [MessageBodyMember( Namespace = "", Order = 0 )]
    public string licence;

    public GetCourseListRequest()
    {
    }

    public GetCourseListRequest( string licence )
    {
        this.licence = licence;
    }
}

Each generated operation contract is decorated in similar way as following one:

[GeneratedCode( "System.ServiceModel", "4.0.0.0" )]
[ServiceContract( ConfigurationName = "ServiceReferences.ICourses" )]
public interface ICourses
{
    [OperationContract( Action = "urn:CoursesIntf-ICourses#GetCourseList", ReplyAction = "*" )]
    [XmlSerializerFormat( Style = OperationFormatStyle.Rpc, SupportFaults = true,
        Use = OperationFormatUse.Encoded )]
    [ServiceKnownType( typeof( TCourse ) )]
    GetCourseListResponse GetCourseList( GetCourseListRequest request );

    // Remaining operation contracts omitted
}

Check the Reference.cs to determine whether your message and operation contracts are decorated same way. If they are, the issue lies elsewhere. Exception message would be helpful to track down the issue (e.g. it may be the order of elements in returned SOAP message).