Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Handling return values from Java web service

Handling return values from Java web service

Scheduled Pinned Locked Moved C#
csharpjavawcfdata-structuresxml
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bjohnson33
    wrote on last edited by
    #1

    Hi all I'm calling a non-.net web service and getting myself confused. The object that is being created from the WSDL includes and out_msg, which is basically the return value. Within out_msg, there is an array of deal objects, however it's not a true array as I can't enumerate it - how do I convert this return value in to something useful (XML, generic list, well, anything really!). /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class out_msg { private object itemField; /// [System.Xml.Serialization.XmlElementAttribute("deals", typeof(deal[]))] [System.Xml.Serialization.XmlElementAttribute("errors", typeof(out_msgErrors))] public object Item { get { return this.itemField; } set { this.itemField = value; } } } Thanks Ben

    L E 2 Replies Last reply
    0
    • B Bjohnson33

      Hi all I'm calling a non-.net web service and getting myself confused. The object that is being created from the WSDL includes and out_msg, which is basically the return value. Within out_msg, there is an array of deal objects, however it's not a true array as I can't enumerate it - how do I convert this return value in to something useful (XML, generic list, well, anything really!). /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class out_msg { private object itemField; /// [System.Xml.Serialization.XmlElementAttribute("deals", typeof(deal[]))] [System.Xml.Serialization.XmlElementAttribute("errors", typeof(out_msgErrors))] public object Item { get { return this.itemField; } set { this.itemField = value; } } } Thanks Ben

      L Offline
      L Offline
      leppie
      wrote on last edited by
      #2

      Look in the debugger the type, and cast it...

      xacc.ide
      The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

      B 1 Reply Last reply
      0
      • B Bjohnson33

        Hi all I'm calling a non-.net web service and getting myself confused. The object that is being created from the WSDL includes and out_msg, which is basically the return value. Within out_msg, there is an array of deal objects, however it's not a true array as I can't enumerate it - how do I convert this return value in to something useful (XML, generic list, well, anything really!). /// [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class out_msg { private object itemField; /// [System.Xml.Serialization.XmlElementAttribute("deals", typeof(deal[]))] [System.Xml.Serialization.XmlElementAttribute("errors", typeof(out_msgErrors))] public object Item { get { return this.itemField; } set { this.itemField = value; } } } Thanks Ben

        E Offline
        E Offline
        Ennis Ray Lynch Jr
        wrote on last edited by
        #3

        You can tweak and change the xsd file to suit your needs. The xml serializer is very leniant. Just do your best to make it match the input schema.


        Need a C# Consultant? I'm available.
        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

        L 1 Reply Last reply
        0
        • L leppie

          Look in the debugger the type, and cast it...

          xacc.ide
          The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

          B Offline
          B Offline
          Bjohnson33
          wrote on last edited by
          #4

          Thanks Leppie - think I was having a Friday brain melt-down. Had already tried casting to an ArrayList and a generic list of deals objects. But, of course, it was just a good old fashioned array. Cheers Ben

          L 1 Reply Last reply
          0
          • E Ennis Ray Lynch Jr

            You can tweak and change the xsd file to suit your needs. The xml serializer is very leniant. Just do your best to make it match the input schema.


            Need a C# Consultant? I'm available.
            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            Ennis Ray Lynch, Jr. wrote:

            The xml serializer is very leniant.

            But not forgiving! Ever had to debug that lame generic XML serialization exceptions? You have to drill down into about 45 inner exceptions to get to the root of the cause :)

            xacc.ide
            The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

            1 Reply Last reply
            0
            • B Bjohnson33

              Thanks Leppie - think I was having a Friday brain melt-down. Had already tried casting to an ArrayList and a generic list of deals objects. But, of course, it was just a good old fashioned array. Cheers Ben

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Bjohnson33 wrote:

              Friday brain melt-down

              Thats ok :) Happens to everyone ;P

              xacc.ide
              The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups