mateo666

Hello

i'm trying to have svcutil generate the same typename in the proxy as in the service but can't get it

here is a little example:

Service side i have some datacontracts defined in one assembly like this

Code Snippet

///

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")]

[System.SerializableAttribute()]

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, TypeName="OTA_AirBookRQ")]

[System.ComponentModel.TypeConverterAttribute(typeof(System.ComponentModel.ExpandableObjectConverter))]

[XmlRoot("OTA_AirBookRQ")]

public partial class OTA_AirBookRQ

{

now in the service i have

Code Snippet

[XmlSerializerFormat()]

[ServiceContract(Name = "MyService", Namespace = "http://somehost.com/MyService")]

public interface IMyService

{

[OperationContract()]

OTA_AirBookRS Book(OTA_AirBookRQ OTA_airBookRQ);

i then generate a proxy using svcutil but the client i get redefine the types as :

Code Snippet

BookResponseBookResult Book(BookOTA_airBookRQ OTA_airBookRQ);

/// <remarks/>

[System.CodeDom.Compiler.GeneratedCodeAttribute("svcutil", "3.0.4506.30")]

[System.SerializableAttribute()]

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("code")]

[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]

public partial class BookOTA_airBookRQ

{

Is there a way to get the same type as in the service side. Not share types but just have the same name

OTA_AirBookRQ instead of BookOTA_airBookRQ

and

OTA_AirBookRS instead of BookResponseBookResult

ps: I'm using the XmlSerializer for compatibility mode with an old asmx service.

Thanks

Mateo



Re: Windows Communication Foundation (Indigo) svcutil and generated proxy question?

Mohammad Makarechian - MSFT

Hello,

If you're not sharing the types between the service and client sides, what is the reason that you require the types to have the same name

What is important is that if you call the operation contracts (that use the types in question) on the client side using the proxy code, the corresponding service-side operation contracts are invoked with the expected parameters passed to them and the expected return value (if any) returned.

Thanks.





Re: Windows Communication Foundation (Indigo) svcutil and generated proxy question?

mateo666

I would say the main reason is for clarity.

Typenames of 8 char Instead of typenames of 30 characters would be a plus for my client.

I do agree with you with the important part but that was not my question.

So if there is a way to control the output of those typenames please write back

thanks again.





Re: Windows Communication Foundation (Indigo) svcutil and generated proxy question?

mateo666

No one else has any clues about this one

Is it possible to control the generated type names

Thanks





Re: Windows Communication Foundation (Indigo) svcutil and generated proxy question?

Nathan Anderson - MSFT

Is there a reason they're being declared as anonymous

Code Snippet
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, TypeName="OTA_AirBookRQ")]

If they aren't anonymous it should give you the OM you want.

Thanks.





Re: Windows Communication Foundation (Indigo) svcutil and generated proxy question?

Ishan VM

Hey Nathan,

looking at your query , it seemed like that u r dealing with Sabre web services. In fact, i m stuck with the same method OTA_AirBookRQ .

I'm not able to generate the Request Payload for the service . I'm having all the required parameters . But i dont know how to attach them with air itinerary !

Can u help me out on this:

I'm available at ishan@sumerusolutions.com

Thanks and Regards,

Ishan