Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2005

Tip: Looking for answers? Try searching our database.

consuming java web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rafa Llarena - 25 Apr 2005 18:44 GMT
Hi,

I'm writting a code in C# which needs to consume a Java-written web service.
This service was written in a RPC/Literal way, so I've used a tool I found
(r2d) to transform the RPC/Literal wsdl into a Document/Literal, and from
this wsdl I've generated the proxy class using wsdl.exe.
The request works correctly, and the Java service returns the results I
expect (I inspect the SOAP packet), but I'm not able to get the results out
of this reponse. This is the reponse I get:

<?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>
       <MethodResponse xmlns="urn:Mywebservices">
           <response xmlns="">
               <result>1</result>
           </response>
       </MethodResponse>
    </soapenv:Body>
</soapenv:Envelope>

The web method is called by a method generated by wsdl.exe and his return
value is a MethodReponse object (MethodReponse class was also generated by
wsdl.exe), but the object returned by this method is not like the one I've
received (the one I expect regarding the SOAP reponse with the a "1" in the
result field).
It is an uninitialized object.
Where could the problem be found?
I hope I've explained myself properly.

Rafa Llarena
Rafa Llarena - 27 Apr 2005 12:19 GMT
The Java web service has been changed to Document/literal. So know, I just
generate the proxy class with wsdl.exe and try to call the web method. The
problem remains the same, so it is not a Document/RPC problem, but a code
problem. Heres my code:

{
javaService js = new javaService();
testMethod vReq = new  testMethod();

vReq.param1 = 1;

reponseWS info = null;
info = js.testMethod(vReq);
int state = info.result;
if (state = = 0) return false;
else return true;
}

javaService is the class that represents the web service, testMethod is the
class that represents the web method and reponseWS is the class that
represents the web method return value. All this classes are generated by
wsdl.exe.
Although I inspect the SOAP reponse, and I can see "result"'s value is 1,
the content of the "info" object is not the correct one. It's always 0, as
if it's not even initialized.
Maybe all this doesn' work the way I'm trying to do it.
Anyone??

Rafa Llarena

> Hi,
>
[quoted text clipped - 32 lines]
>
> Rafa Llarena
Rafa Llarena - 28 Apr 2005 09:52 GMT
I've kept researching and I've arrived to the conclusion that the problem
maybe in the return value of the web method. It returns a struct, and .NET
seems to have a problem retrieving this struct. Am I wrong here? Is there
anything I have to do when the web method's return type is a structure?
If anyone has a clue, please, answer

Rafa

> The Java web service has been changed to Document/literal. So know, I just
> generate the proxy class with wsdl.exe and try to call the web method. The
[quoted text clipped - 63 lines]
>>
>> Rafa Llarena
Brock Allen - 28 Apr 2005 13:44 GMT
It's possible that the Java WebService is defined using WSDL and XSD that
the .NET framework can't consume automatically. You might have to work with
the XML message directly in your client.

-Brock
DevelopMentor
http://staff.develop.com/ballen

> I've kept researching and I've arrived to the conclusion that the
> problem
[quoted text clipped - 80 lines]
>>> I hope I've explained myself properly.
>>> Rafa Llarena
Rafa Llarena - 29 Apr 2005 11:44 GMT
Thank you very much for your answer.
Is there any way to find out if that's actually the problem?

Rafa Llarena

> It's possible that the Java WebService is defined using WSDL and XSD that
> the .NET framework can't consume automatically. You might have to work
[quoted text clipped - 88 lines]
>>>> I hope I've explained myself properly.
>>>> Rafa Llarena

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.