Hi:
I'm building a sample from scratch and I'm trying to reconcile the files
generated by wscompile with the simple toejb example.
I generate a WSDL file from my service implementation and service
interface and the WSDL file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="GenomicsEndpoint"
targetNamespace="
http://com.heapware/wsdl/GenomicsEndpoint"
xmlns:tns="
http://com.heapware/wsdl/GenomicsEndpoint"
xmlns="
http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns2="
http://com.heapware/types/GenomicsEndpoint"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<types>
<schema
targetNamespace="
http://com.heapware/types/GenomicsEndpoint"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="
http://com.heapware/types/GenomicsEndpoint"
xmlns:soap-enc="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="
http://schemas.xmlsoap.org/wsdl/"
xmlns="
http://www.w3.org/2001/XMLSchema">
<import namespace="
http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="Gene">
<sequence>
<element name="locus" type="int"/>
<element name="symbol"
type="string"/></sequence></complexType></schema></types>
<message name="GenomicsEndpoint_locateGene">
<part name="String_1" type="xsd:string"/></message>
<message name="GenomicsEndpoint_locateGeneResponse">
<part name="result" type="ns2:Gene"/></message>
<portType name="GenomicsEndpoint">
<operation name="locateGene" parameterOrder="String_1">
<input message="tns:GenomicsEndpoint_locateGene"/>
<output
message="tns:GenomicsEndpoint_locateGeneResponse"/></operation></portType>
<binding name="GenomicsEndpointBinding" type="tns:GenomicsEndpoint">
<operation name="locateGene">
<input>
<soap:body
encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="
http://com.heapware/wsdl/GenomicsEndpoint"/></input>
<output>
<soap:body
encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" use="encoded"
namespace="
http://com.heapware/wsdl/GenomicsEndpoint"/></output>
<soap:operation soapAction=""/></operation>
<soap:binding transport="
http://schemas.xmlsoap.org/soap/http"
style="rpc"/></binding>
<service name="GenomicsEndpoint">
<port name="GenomicsEndpointPort"
binding="tns:GenomicsEndpointBinding">
<soap:address
location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>
The files generated by wscompile don't match the files from the hello
example and the naming conventions seem to differ. Specifically, I got a
GenomicsEndpoint_Service_Impl.class, a GenomicsEndpointService.class, a
GenomicsEndpoint_PortType.class and a GenomicsEndpoint_PortType_Stub.class.
It looks like wscompile added the _Service_Impl suffix to the service
implementation and the _Service suffix to the service interface. That's
ok. However, wscompile also added the suffix _PortType_Stub and
generated a GenomicsEndpoint_PortType.class.
It would be great if someone could you either point me to some docs that
explain the naming conventions or give me the nickel tour. I was
thinking my code would look like the following:
import javax.xml.rpc.Stub;
...
//gets the stub from the service implementation, the type of the stub is
//actually GenomicsEndpoint_PortType_Stub
Stub stub = (Stub)(new
GenomicsEndpoint_Service_Impl().getGenomicsEndpointPort());
//gets the interface from the stub
GenomicsEndpoint endpoint = (GenomicsEndpoint)stub;
This is what the hello example shows, but I'm getting a class cast
exception at runtime when I try to cast the stub to the interface.
So can someone point me in the right direction ?
--
Thanks,
Richard