views:

23

answers:

0

Hello,

I don't know how it is possible but services provided by Rails are different consumed in WPF and Silverlight.

When I seek for ****.com/api/wsdl/ (it is Rails SOAP service) WPF generates all the methods, events etc.

When I seek for the same URI in Silverlight I have only:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="urn:ActionWebService", ConfigurationName="***********.ApiApiPort")]
public interface ApiApiPort {
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ApiApiPortChannel : ***********.Modules.Login.***********.ApiApiPort, System.ServiceModel.IClientChannel {
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ApiApiPortClient : System.ServiceModel.ClientBase<***********.Modules.Login.***********.ApiApiPort>, ***********.Modules.Login.***********.ApiApiPort {

    private BeginOperationDelegate onBeginOpenDelegate;

    private EndOperationDelegate onEndOpenDelegate;

    private System.Threading.SendOrPostCallback onOpenCompletedDelegate;

    private BeginOperationDelegate onBeginCloseDelegate;

    private EndOperationDelegate onEndCloseDelegate;

    private System.Threading.SendOrPostCallback onCloseCompletedDelegate;

    public ApiApiPortClient() {
    }

    public ApiApiPortClient(string endpointConfigurationName) : 
            base(endpointConfigurationName) {
    }

    public ApiApiPortClient(string endpointConfigurationName, string remoteAddress) : 
            base(endpointConfigurationName, remoteAddress) {
    }

    public ApiApiPortClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(endpointConfigurationName, remoteAddress) {
    }

    public ApiApiPortClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(binding, remoteAddress) {
    }

    public System.Net.CookieContainer CookieContainer {
        get {
            System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
            if ((httpCookieContainerManager != null)) {
                return httpCookieContainerManager.CookieContainer;
            }
            else {
                return null;
            }
        }
        set {
            System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
            if ((httpCookieContainerManager != null)) {
                httpCookieContainerManager.CookieContainer = value;
            }
            else {
                throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
                        "ookieContainerBindingElement.");
            }
        }
    }

    public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;

    public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;

    private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
        return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
    }

    private object[] OnEndOpen(System.IAsyncResult result) {
        ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
        return null;
    }

    private void OnOpenCompleted(object state) {
        if ((this.OpenCompleted != null)) {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
        }
    }

    public void OpenAsync() {
        this.OpenAsync(null);
    }

    public void OpenAsync(object userState) {
        if ((this.onBeginOpenDelegate == null)) {
            this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
        }
        if ((this.onEndOpenDelegate == null)) {
            this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
        }
        if ((this.onOpenCompletedDelegate == null)) {
            this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
        }
        base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
    }

    private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
        return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
    }

    private object[] OnEndClose(System.IAsyncResult result) {
        ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
        return null;
    }

    private void OnCloseCompleted(object state) {
        if ((this.CloseCompleted != null)) {
            InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
            this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
        }
    }

    public void CloseAsync() {
        this.CloseAsync(null);
    }

    public void CloseAsync(object userState) {
        if ((this.onBeginCloseDelegate == null)) {
            this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
        }
        if ((this.onEndCloseDelegate == null)) {
            this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
        }
        if ((this.onCloseCompletedDelegate == null)) {
            this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
        }
        base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
    }

    protected override ***********.Modules.Login.***********.ApiApiPort CreateChannel() {
        return new ApiApiPortClientChannel(this);
    }

    private class ApiApiPortClientChannel : ChannelBase<***********.Modules.Login.***********.ApiApiPort>, ***********.Modules.Login.***********.ApiApiPort {

        public ApiApiPortClientChannel(System.ServiceModel.ClientBase<***********.Modules.Login.***********.ApiApiPort> client) : 
                base(client) {
        }
    }
}

I don't have any methods and events that should be available... Whats more these two events

public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;

public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;

aren't generated at all in WPF!

Can anyone help me?

Regards, Daniel Skowroński