views:

375

answers:

0

Hi, I have a java webservice which connects to a .Net 2.0 client. I have a requirement to write an equivalent of the Java service in .Net 3.5 WCF. It is desirable to be able to simply plugin in the WCF service without changing the client.

After a lot of trial and error (http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/efad0851-b6ad-47d3-b16a-ac8734c2e62e#page:2) I came to the point where I can call the WCF service but the return parameter is not correctly read. The return parameter is a string but it returns null. I created a proxy from the WCF wsdl in the .net 2.0 client so now I have one working proxy which correctly reads in the parameter and one non working which was created by the Java service's wsdl which connects to the WCF service but cannot interpred the parameter correclty. I looked in the proxy classes of both and this is what I have:

Here is what I have in the working proxy:

/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("getComponentManager",     RequestNamespace="http://wsframework.server.com/", ResponseNamespace="http://wsframework.server.com/", Use=System.Web.Services.Description.SoapBindingUse.Literal,   ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string getComponentManager() {
        object[] results = this.Invoke("getComponentManager", new object[0]);
        return ((string)(results[0]));
    }

Here is what I have in the non working proxy:

/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("getComponentManager",     Use=System.Web.Services.Description.SoapBindingUse.Literal,     ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("getComponentManagerResponse", Namespace="http://wsframework.server.com/")]
public getComponentManagerResponse getComponentManager([System.Xml.Serialization.XmlElementAttribute("getComponentManager", Namespace="http://wsframework.server.com/")] getComponentManager getComponentManager1) {
object[] results = this.Invoke("getComponentManager", new object[] {
                    getComponentManager1});
return ((getComponentManagerResponse)(results[0]));
}

Apparently the the non working copy does not read the return parameter stright of results but expects the return parameter to be of type getComponentManagerResponse. Does anybody know how to make the WCF service return the parameter in the same way as the Java service does ? Or does anybody know how to create the WCF service contract from the xsd schema of the Java's service ?