Example 19.2 does not work
oxyale Jul 6, 2007 4:54 PMUsing the following environment:
Server: 4.2.0.GA
JDK: 1.5.0_12-b04
I have a problem with example 19.2 ? the sample that uses dotNet as a consumer of a J2EE web service. For this sample, myj2ee portion compiles/deploys. I was able to get the 19.1 example to work, and used the Java client from it to test/consume the 19.2 Web Service. However, when I compile the .net client, I get the following error:
C:\ex19_2\dotnet>Client.exe
Unhandled Exception: System.Net.WebException: The request failed with HTTP status 404: /titan/TravelAgentBean. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TravelAgentService.createCabin(Cabin Cabin) at Client.Main()
among the troubleshooting attempted, I got rid of the TravelAgentService.cs and run the following command:
>WSDL /language:c# /out:TravelAgentService.cs http://127.0.0.1:8080/TravelAgentBeanService/TravelAgentBean?wsdl
It creates the new TravelAgentService.cs file, but now it doesn?t compile:
Client.cs(6,8): error CS0246: The type or namespace name 'Cabin' could not be found (are you missing a using
directive or an assembly reference?)
Client.cs(6,28): error CS0246: The type or namespace name 'Cabin' could not be found (are you missing a using
directive or an assembly reference?)
Client.cs(15,8): error CS1502: The best overloaded method match for
'TravelAgentService.createCabin(createCabin)' has some invalid arguments
Client.cs(15,26): error CS1503: Argument '1': cannot convert from 'Cabin' to 'createCabin'
Client.cs(17,8): error CS0246: The type or namespace name 'Cabin' could not be found (are you missing a using
directive or an assembly reference?)
Client.cs(17,24): error CS1502: The best overloaded method match for 'TravelAgentService.findCabin(findCabin)'
has some invalid arguments
Client.cs(17,40): error CS1503: Argument '1': cannot convert from 'int' to 'findCabin'
So I gave up on that and just went straight to Microsoft Visual Studio and tried to write a client app ? I am able to ?Add Web Reference? to http://localhost:8080/TravelAgentBeanService/TravelAgentBean?wsdl
However, the WSDL description that it pulls, has these methods:
"TravelAgentService" Description
Methods:
createCabin ( createCabin As createCabin ) As createCabinResponse findCabin ( findCabin As findCabin ) As findCabinResponse
I don't know what to do with these calls ? I was expecting something like:
createCabin( Cabin As cabin) As createCabinResponseor something.
Can anyone help me ? I just want to run the example 19.2. I admit that I don't know enough about the JAX-RPC Wrappers to do much good here, but getting this example to run would certainly be a great first step.
-oxyale