WCF WSDL don't create the same operation format as the class definition

Aldo Costa 1 Reputation point

Hello Guys, i'm having a problem with a WCF that i need to create, i have this client that send me a XML with something like this.

       <otm:Bejeto xmlns:otm="http://xmlns.oracle.com/apps/otm/transmission/v6.4" xmlns:gtm="http://xmlns.oracle.com/apps/gtm/transmission/v6.4">

The class that i'm writing is something like the sample bellow.

  [DataContract(Namespace = "http://xmlns.oracle.com/apps/otm")]
    public class Bejeto
        [XmlAttribute(Namespace = "http://www.w3.org/2000/xmlns/", AttributeName = "otm")]
        public string otm { get; set; }

        [XmlAttribute(Namespace = "http://www.w3.org/2000/xmlns/", AttributeName = "gtm")]
        public string gtm { get; set; }

        [DataMember(Name = "InnerProp"),
            XmlElement(Namespace = "http://xmlns.oracle.com/apps/otm")]
        public InnerClass InnerProp { get; set; }

    [DataContract(Namespace = "http://xmlns.oracle.com/apps/otm")]
    public class InnerClass
        [DataMember(Name = "A")]
        public string A { get; set; }

        [DataMember(Name = "B")]
        public string B { get; set; }

My operation is like this.

string AddXmlString(Bejeto Bejeto);

And i have this contract interface:

[ServiceContract(Namespace = "http://xmlns.oracle.com/apps/otm"), XmlSerializerFormat()]
    public interface INissanServices

The issue is when we try its WSDL on SOAPUI, the operations looks like that:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:otm="http://xmlns.oracle.com/apps/otm">
         <otm1:Bejeto xmlns:otm="?" xmlns:gtm="?" xmlns:otm1="http://xmlns.oracle.com/apps/otm">

It creates a prefix "otm1", also creates an extra attribute " xmlns:otm1", so the client can't use that.
I just figure it was the problem with compatibility or something...
Oh, i forgot, i can't use string to receive XML, it's a problem with the client tool (OTM), at least they told me that.

I hope someone have a solution for that, anyway,

Thanks a lot people \o/

Microsoft Technologies based on the .NET software framework.
3,346 questions
{count} votes