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 ?
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">
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>
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:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>hello world faaaaake</soap:Body></soap:Envelope>
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.
One last time:
Before the "hello world fake", there are begin tags...
After the "hello world fake", there are end tags...
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.
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;
userIds = "admin";
tUserInfo userInfos = mentor.getUserInfo(userIds);
Console.Out.WriteLine("I guess it worked. " + userInfos.Length);
Console.Out.WriteLine("userid: " + userInfos.userId);
//OrderProcess.Person person = new OrderProcess.Person();
//person.name = "kelly";
//OrderProcess.OrderItem items = new OrderProcess.OrderItem;
//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)
else if (result.AuthenticationResult == tAuthenticationResult.badpassword)
else if (result.AuthenticationResult == tAuthenticationResult.success)
auth_result.Text = result.ToString();
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....
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.
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