locked
SoapHttpClientProtocol and self-closing elements RRS feed

  • Question

  • I'm programming a client for consuming a web service. I have the wsdl and xsd that I pulled in to create the web reference, and for the most part everything works fine. The only flaw is that the reference class, which inherits from SoapHttpClientProtocol, supplies empty elements in the array that is part of the arguments for one of the service's methods, but the service will only accept self-closing elements (or a self-closing array with no elements) for that argument.

    The reference class makes the call like this:

    object[] results1 = this.Invoke("findRecords", new object[] {
                            username,
                            filter,
                            offset,
                            count});

    where 'filter' is a partial class used to hold filtering information in an array of sorts. The constructor does not set any initial or default values, nor do the member definitions, so creating a new filter object to pass into the method can be done without adding any data to it.

    Is there any way to instruct the system to use self-closing elements instead of empty elements in this scenario?

    • Moved by LeoTang Wednesday, November 28, 2012 6:36 AM (From:Windows Communication Foundation (WCF))
    Tuesday, November 27, 2012 4:33 PM

Answers

  • I just figured it out this morning. I won't get into details but suffice to say that it was one of those tiny little things that result in a big face-palm. Everything is running smoothly now.

    Thanks!

    • Marked as answer by Antessima Thursday, November 29, 2012 5:31 PM
    Thursday, November 29, 2012 5:31 PM

All replies

  • Please supply code that reproduces the problem.

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Thursday, November 29, 2012 4:27 PM
    Moderator
  • I just figured it out this morning. I won't get into details but suffice to say that it was one of those tiny little things that result in a big face-palm. Everything is running smoothly now.

    Thanks!

    • Marked as answer by Antessima Thursday, November 29, 2012 5:31 PM
    Thursday, November 29, 2012 5:31 PM