5 Replies Latest reply on Apr 30, 2007 2:59 AM by cdreyer1

    JbossWS 1.2.1 and .Net 2.0 client

    cdreyer1

      Hi,

      Since upgrading to JbossWS 1.2.x I have interoperability issues with .Net 2.0 clients. For some reason I lose Integer values. They are received by my JBoss web services as null values. Calling the same web service from a client like SoapUI works nicely. Please help!

      Using annotations what is the preferred configuration for .Net 2.0 interoperability?

      Thanks,
      Claus

        • 1. Re: JbossWS 1.2.1 and .Net 2.0 client
          fheldt

          I have the same problem!

          I have a webservice that receives a class (fillled from a .NET 2.0 client) which contains some double values. Since 1.2.1 the EJB (JSR-181) receives null values for these doubles.

          I'm currently trying to encircle the error, but at the moment i have no idea what is happening here...

          • 2. Re: JbossWS 1.2.1 and .Net 2.0 client
            cdreyer1

            I believe I found the bug. It is described here -> http://support.microsoft.com/kb/925272

            In my .Net code I have field names ending with Specified on the object I'm sending through the web service (e.g. for an Integer field called NumberOfHits there will be a bool field called NumberOfHitsSpecified). If the Specified field is set to true, then it will be send. Else the .Net bug described above will have set it to false, and it won't be send.

            This is only true for optional fields. So another solution is to make the field required in the WSDL. I have used the @XmlElement annotation like this

            @XmlElement(required = true)
            Integer NumberOfHits;


            The last solution is to get the hotfix from Microsoft or get a service pack for the .Net Framework, but I have not found any of them. Anybody?

            Regards,
            Claus

            • 3. Re: JbossWS 1.2.1 and .Net 2.0 client
              heiko.braun

              So, do we consider this to be .NET problem?

              • 4. Re: JbossWS 1.2.1 and .Net 2.0 client
                centecbertl

                JBossWS is standard conforming, and per se this is not a JBossWS problem. But it means that updating to new JBossWS versions breaks a lot of client code or requires to put XMLElement on all generated DataStructures for
                nillable non-complex Data fields. Thus it is a JBossWS users problem.

                Detail:
                (i.e. autoboxing Long, Integer, Double types, Date types, BigDecimal,.....

                I was lucky, since I generate all these by using androMDA, thus it was easy to add XmlElement to several hundred data structures in the correct places.

                It could help other JBossWS users to document the behaviour, and make it configurable (e.g. property nillablesAreRequired).

                The situation is even worse on .net side: when a .net client reads a complex data structure it does not set the ...Required fields on its own. Thus something like

                tradeService.updateTradePriceQuote(quotationService.getQuote(isin))
                


                with a complex data structure Quote, carrying quotation detail as BigDecimals does not work any longer (what it used to do with JBossWS1.0.x and JSR 181 annotations)


                • 5. Re: JbossWS 1.2.1 and .Net 2.0 client
                  cdreyer1

                  Heiko, yes it is a .Net problem.

                  The XMLSerializer class in the .NET Framework 2.0 has a bug with optional elements.