locked
Windows store app, Service Reference

    Question

  • In a windows store app i have a Service Reference that looks something like thisenter image description here

    this is the xaml of the wsdl: http://paste2.org/B00MD3Wt

    and in the generated Referece.cs file i have this

    ...

        [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class WSDocuShareJoinWirelessClient : System.ServiceModel.ClientBase<xxxServiceReference.IWSDocuShareJoinWireless>, xxx.ServiceReference.IWSDocuShareJoinWireless {
    
        public WSDocuShareJoinWirelessClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }

    ...

    what i want to know is the binding parameter that should be used when i do this

    private WSDocuShareJoinWirelessClient client = new WSDocuShareJoinWirelessClient(binding,remoteAddress);

    i noticed now i also get these 2 warnings enter image description here

    Tuesday, November 04, 2014 4:59 PM

Answers

  • Hi Thought2,

    The system will generate the proxy class when you add a new service reference. I think there is no problem with this proxy class. Consuming a web service is simple using “service reference”. I doubt there should be something special in the web service. The exception “Java.lang.NullPointerException” shows that. Please try to check the Java web service.

    If you still have questions, please post more information about your scenario.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, November 13, 2014 7:54 AM
    Moderator

All replies

  • Your client does not have a parameter less contructor?

    var client = new WSDocuShareJoinWirelessClient();

    Tuesday, November 04, 2014 5:53 PM
  • it only has the one with 2 parameters

    i tried something like this, using one of the functions (Constants.endPoint = address of my webservice)

    private static BasicHttpBinding binding = new BasicHttpBinding();
            private static EndpointAddress endpoint = new EndpointAddress(Constants.endPoint);
    
            private WSDocuShareJoinWirelessClient client = new WSDocuShareJoinWirelessClient(binding, endpoint);
    
            public async Task<IEnumerable<File>> GetFilesAsync()
            {
                try
                {
                    var request = new abiRequest();
                    var role = new abiRole();
                    var searchResponse = await client.getSearchResultAsync(request, role);
                    var fileNames = searchResponse.@return.resultats
                        .Select(x => x.ToString());
    
                    return searchResponse.@return.resultats
                        .Select(x => new File(x.ToString()));
                }
                catch (Exception e)
                {
                    Debug.WriteLine("-E- " + e.Message);
                    return null;
                }
            }
    but im getting this exception  XD   not sure what to make of it
    java.lang.NullPointerException


    Tuesday, November 04, 2014 5:59 PM
  • Hi Thought2,

    The system will generate the proxy class when you add a new service reference. I think there is no problem with this proxy class. Consuming a web service is simple using “service reference”. I doubt there should be something special in the web service. The exception “Java.lang.NullPointerException” shows that. Please try to check the Java web service.

    If you still have questions, please post more information about your scenario.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, November 13, 2014 7:54 AM
    Moderator