Jun 18, 2009 at 4:05 AM
Edited Jun 18, 2009 at 4:07 AM

Could someone tell me how the ServiceAgent classes were generated?  They indicate in the files that they were generated by a tool.  Is this the same tool that creates ServiceReferences?

I'm asking because I would like to better understand how these classes were able to make use of the classes defined in DataContracts instead of generating partials for all of the classes within the generated service reference class.

Thanks in advance.

Jun 18, 2009 at 4:30 AM

I found the following regard svcutil.exe.  Now, I'm even more curious on how this works...  Were the files edited by hand?


/reference:<file path>

References types in the specified assembly. When generating clients, use this option to specify assemblies that might contain types that represent the metadata being imported.

You cannot specify message contracts and XmlSerializer types using this switch.

If DateTimeOffset referenced, this type is used instead of generating a new type. If the application is written using .NET Framework 3.5, SvcUtil.exe references DateTimeOffset automatically.

Short Form: /r

Jun 19, 2009 at 9:12 PM

Previously there was a post regarding the IVC not using Acord on the wire.  There were several solutions posted, however this appears to cause some problems with the ServiceAgent classes.

If the following is added to the ServiceContract to support Acord on the wire:

 [XmlSerializerFormat(Style = OperationFormatStyle.Document)]

There are serialization exceptions when the message is received by the client.  I was able to solve this problem by adding the XmlSerializerFormat to the ServiceAgent interface:

namespace Aah.Acord.ServiceAgents

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "")]
    [System.ServiceModel.ServiceContractAttribute(Namespace = "urn:Acord.CommonInsurance.ServiceContracts", ConfigurationName = "CommonInsuranceInquiry")]
    [System.ServiceModel.XmlSerializerFormat(Style = System.ServiceModel.OperationFormatStyle.Document)]
    public interface CommonInsuranceInquiry

It appears that we have a working solution, but it feels like a hack because we are modifying the code generated classes.

If I try to regenerate the ServiceAgent classes with the [XmlSerializerFormat] attribute then they no longer appear to use the DataContracts generated from XsdObjectGen and instead regenerate the Acord classes based on the service wsdl.  I believe this is because of the post above.

 Any ideas?