10 Replies Latest reply on Nov 6, 2005 9:37 AM by anil.saldhana

    Urgent!  .NET client compatibility with JBoss 4.0.1?

    kdolan1

      I have been messing around with JBoss web services and .NET clients for days and needed a solution a week ago (isn't that always the case).

      I have seen the Wiki link for JBoss and .NET and I have followed building the document/literal samples. The result is that the OrderProcess sample deploys (and I can get the wsdl) in JBoss 4.0.3 but not in JBoss 4.0.1 (I get a message like The OperationDesc for the method x is not synchronized, etc.).

      If moving to JBoss 4.0.3 is out of the question for me at this time, does anyone know *if* it is even possible to get a .NET client to work with JBoss 4.0.1?

      Many, many thanks to anyone who can give me a straight answer on this.

      For a gold star, if it is possible, how?

      Kelly

        • 1. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
          nehring

          Is your scenario a .Net client with JBoss 4.0.1 server? Visual Studio should be able to build a client-side proxy okay. I actually use JBoss 4.0.2, but I do have .Net 1.1 clients running in production. (Soon to migrate to JBoss 4.0.3sp1)

          Do you have any clients that can talk to the web service: Perl SOAP-Lite, JAX-RPC, etc? The JBoss IDE for Eclipse will generate a JUnit test client.

          Does your webservice show up okay in http://localhost:8080/ws4ee ?

          r,
          Lance

          • 2. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
            kdolan1

            Our scenario is .NET client with JBoss 4.0.1 server. We wrote a Java web service and it deploys just fine within JBoss. In writing the .NET client, we add a web reference and it sees the WSDL just fine too. When it comes to execution, the .NET client appears to call the web service okay and by sniffing the SOAP message returned, the web service is returning the correct response. However, the return value the .NET client always see is null.

            We have a Java client that calls the web service just fine.

            We tried writing a .NET web service to see what it is returning so we could compare things. One of our developers noticed that the SOAP messages differed only in return character and namespace notation.

            The Java web service returned:

            <?xml version="1.0" encoding="UTF-8"?>
            <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <soapenv:Body>
            <ns1:HelloWorldResponse xmlns:ns1="http://Walkthrough/XmlWebServices/">
            wazzup
            </ns1:HelloWorldResponse>
            </soapenv:Body>
            </soapenv:Envelope>


            The .NET web service returned:

            <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>hello world</soap:Body></soap:Envelope>

            Thanks!

            • 3. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
              kdolan1

              Oops...I was given the wrong SOAP message for the .NET. The correct message is shown below:

              <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>hello world faaaaake</soap:Body></soap:Envelope>

              • 4. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                kdolan1

                Okay...the posting is stripping out the information.

                After the soap:Body begin tag and "hello world fake", you should see:



                After "hello world fake" and the soap:Body end tag, you should see:



                ...only without the < and >. For some reason if I provide the true symbols, everything in between is getting stripped out.

                • 5. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                  kdolan1

                  One last time:

                  Before the "hello world fake", there are begin tags...

                  HelloWorldResponse xmlns="http://Walkthrough/XmlWebServices/"

                  HelloWorldResult

                  After the "hello world fake", there are end tags...

                  HelloWorldResult

                  HelloWorldResponse


                  • 6. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                    nehring

                    What does your .Net C# code look like?

                    Everything is wrapped with objects that Visual Studio should have generated. So you basically:

                    1) Instantiate a proxy object. a.k.a. web reference.
                    2) Then you'll instantiate a request object and populate it's parameters.
                    3) Use the request object as the argument when calling the webmethod on the proxy object.
                    4) It'll return a response object, unless an exception is getting thrown.
                    5) You'll then use the acessors to see what's in the response object.


                    Are you seeing any exceptions with a try/catch clause around the webmethod call? My biggest complaint about .Net is the lack of checked expections......oh well.

                    r,
                    Lance

                    • 7. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                      kdolan1

                      Steps 1-5 is what I'm doing. I do not have a try/catch around the web method call but I know it is not throwing anything because I have a number of calls to different web services and it is getting past the ones not working write.

                      BTW - If I deploy my Java web service in JBoss 4.0.3 everything works fine.

                      Here's the current state of my code within the .NET client. The calls to OrderProcess are from the JBoss 4.0.3 sample which only deploys under 4.0.3 and not 4.0.1. The other two calls are ours. The authenticate call returns an enumeration.

                      private void button1_Click(object sender, System.EventArgs e)
                      {
                      MentorWS.Mentor mentor = new MentorWS.Mentor();
                      String[] userIds = new String[1];
                      userIds[0] = "admin";
                      tUserInfo[] userInfos = mentor.getUserInfo(userIds);
                      Console.Out.WriteLine("I guess it worked. " + userInfos.Length);
                      Console.Out.WriteLine("userid: " + userInfos[0].userId);

                      //OrderProcess.Person person = new OrderProcess.Person();
                      //person.name = "kelly";
                      //OrderProcess.OrderItem[] items = new OrderProcess.OrderItem[2];
                      //OrderProcess.processOrder po = new OrderProcess.processOrder();
                      //po.arrayOfOrderItem_1 = items;
                      //po.Person_2 = person;
                      //OrderProcess.OrderProcessService op = new OrderProcess.OrderProcessService();
                      //OrderProcess.processOrderResponse por = op.processOrder(po);
                      //OrderProcess.OrderResponse resp = por.result;
                      //Console.Out.WriteLine("order message: " + resp.message);

                      AuthenticateUser param = new AuthenticateUser();
                      param.userId = auth_username.Text;
                      param.password = auth_password.Text;

                      AuthenticateUserResponse result = mentor.authenticateUser(param);
                      Console.Out.WriteLine("result: " + result.AuthenticationResult.ToString());
                      if (result.AuthenticationResult == tAuthenticationResult.baduserid)
                      {
                      Console.Out.WriteLine("bad uid");
                      }
                      else if (result.AuthenticationResult == tAuthenticationResult.badpassword)
                      {
                      Console.Out.WriteLine("bad pass");
                      }
                      else if (result.AuthenticationResult == tAuthenticationResult.success)
                      {
                      Console.Out.WriteLine("success");
                      }
                      else
                      {
                      Console.Out.WriteLine("bad code");
                      }
                      auth_result.Text = result.ToString();
                      }

                      • 8. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                        nehring

                        It may be that 4.0.1 is not providing the namespace for the response that .Net is wanting.

                        I would expect, then, that a SOAP response from 4.0.1 and 4.0.3 are different in that respect. From what I've seen .Net will silently discard request/response parameters that don't have the namespace declared on each parameter way it expects. I have this problem in the reverse scenario - with a JBoss client and .Net webservice.

                        Is it possible for you to use the ws4ee part of 4.0.3 in a 4.0.1 installation? I'm not sure how difficult that is....

                        • 9. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                          kdolan1

                          This we will have to try. You are right about the namespace thing. One of our developers just tweaked the JBoss code that generates the namespace stuff to do it the way .NET wants it. It works for string based methods (e.g., string params, string return types, string arrays) but not complex java types.

                          For now, that is good enough for me. For the couple of methods that are not working, we are willing to add new methods that return the same information in a string format.

                          • 10. Re: Urgent!  .NET client compatibility with JBoss 4.0.1?
                            anil.saldhana

                            Use the latest version of JBoss to atleast test your scenario instead of 4.0.1. I think there was a namespace bug fixed in 4.0.2