On your TransformationPortImpl.java, add a @WebService annotation with
the wsdlLocation specified there. The interface is kind of supposed to
be somewhat "detached" from the wsdl which is why the wsdlLocation
annotation is generated there. That said, it should have worked. I'll
need to dig some more into that. :-(
According to jax-ws spec, on your TransformationPortImpl.java, you would
add something like:
@WebService( wsdlLocation="path/to/wsdl",
endpointInterface="com.foo.TransformationPort",
serviceName="....", portName="...",
targetNamespace="....");
with the "...." things matching what you want found in the wsdl.
Dan
On Wednesday 09 January 2008, Craig Tataryn wrote:
> Hi I have a series of wsdls which I have run through wsdl2java. For
> example, the following would be generated:
>
> TransformationPort.java <-- Service Interface
> GeomService.java <-- class that implements "Service" and for client
> access to the service
> TransformationPort_GeomService_Server.java <-- Publishes the
> TransformationPort to an endpoint.
>
> Then I would create a TransformationPortImpl.java and flesh out my
> service, and have the TransformationPort_GeomService_Server.java use
> that to publish.
>
> Now, the GeomService has the @WebServiceClient annotation with a
> wsdlLocation attribute pointing at the right wsdl. However,
> TransformationPort lacks the wsdlLocation annotation and thus when the
> TransformationPort_GeomService_Server publishes it, and someone goes
> to http://localhost:8080/services/geom/transformation?wsdl, cfx will
> generate the wsdl based off the annotations on the TransformationPort.
>
> I do not want this, I want the original wsdl to be served up to the
> client. So, if I add the wsdlLocation attribute to the @WebService
> annotation on TransformationPort that should work right? It does, but
> with an error because on line 112 of
> org.apache.cxf.wsdl11.WSDLServiceFactory we have:
>
> //and definition is the imported wsdl from the wsdlLocation
> attribute javax.wsdl.Service wsdlService =
> definition.getService(serviceName);
>
> Which returns null because the serviceName is deemed to be
> TransformationPortImplService and this throws:
> throw new ServiceConstructionException(new
> Message("NO_SUCH_SERVICE_EXC", LOG, serviceName));
>
> An abridged version of the wsdl is:
>
> <wsdl:portType name="TransformationPort">
> .
> .
> .
> </wsdl:portType>
>
> <wsdl:binding name="TransformBinding" type="TransformationPort">
>
> </wsdl:binding>
>
> <wsdl:service name="GeomService">
> <wsdl:port name="TransformationPort" binding="TransformBinding">
> <soap:address
>
> location="http://localhost:8080/services/geom/transformation"/>
> </wsdl:port>
> </wsdl:service>
>
> If anyone can lead me to where I have gone astray that would be great.
> What would I have to do to get this up and running without cxf
> generating my wsdl when a user requests from ?wsdl ?
>
> Thanks.
>
> Craig.
--
J. Daniel Kulp
Principal Engineer, IONA
[EMAIL PROTECTED]
http://www.dankulp.com/blog