By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

.NET/JAVA Interoperability

P: n/a
Hi,
I'm facing some problem with respect to .NET client invoking a Java
WebService.
I'm able to access a Java WebService, whose binding is RPC/Encoded.But
the same
WebService when deployed using Document/Literal gives a problem.

Please find below my problem:
I have a method being exposed in Java WebService by name callMethod()
that returns a string.
The proxy generated for this method using wsdl.exe is as follows:

---------------------------------------------------------------------------
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("call MethodResponse",
Namespace="http://arun:8080/Training/services/Sample11")]
public callMethodResponse callMethod()
{
object[] results = this.Invoke("callMethod", new object[0]);
return ((callMethodResponse)(results[0]));
}
---------------------------------------------------------------------------

I invoke the method from C# using the following syntax:

------------------------------------------------------------
Sample11 obj = new Sample11();
callMethodResponse objRes;
objRes = obj.callMethod();
string str;
str = objRes.callMethodReturn;
------------------------------------------------------------

Initially I recieved an error saying "java.lang.exception:Body not
found".
I could set this right by changing the SoapParameterStyle in
SoapDocumentMethodAttribute
from SoapParameterStyle.Bare to SoapParameterStyle.Wrapped.

Now objRes has a null value.I'm not able to receive the simple string
"Hello", which I'm returning
from the Java WebService.

But everything works fine when RPC/Encoded is used.

Will be greatful if somebody could help me out in this.
Arun.
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.