Per spec, it's not supposed to (and if we did, it would fail the TCK). The
serviceName (and portName) attribute is for the service implementation only.
The interface represents the portType which can be used by several
services/ports/bindings and thus does not get those attributes set.
Normally, in this case, you would use the serviceName attribute on the
jaxws:client element.
<jaxws:client id="siebelClient"
serviceClass="blablabla.NameSoap"
address="http://...."
xmlns:tns="http://......."
serviceName="tns:name"
wsdlLocation="path/Name.wsdl">
<jaxws:properties>
<entry key="schema-validation-enabled" value="true" />
</jaxws:properties>
</jaxws:client>
Dan
On Wed November 18 2009 10:16:49 am Malte Finsterwalder wrote:
> Hi!
>
> I'm wondering, where wsdl2java gets the information what to put into
> the @WebService-Annotation.
>
> I'm throwing a WSDL with the following entries at wsdl2java:
>
> <wsdl:portType name="NameSoap">
> ....
> </wsdl:portType>
>
> <wsdl:binding name="NameSoap" type="tns:NameSoap">
>
> <wsdl:service name="Name">
> <wsdl:port name="NameSoap" binding="tns:NameSoap">
> <soap:address location="http://....." />
> </wsdl:port>
> </wsdl:service
>
> The following interface is generated:
>
> @WebService(targetNamespace = "http://blablabla/", name = "NameSoap")
> public interface NameSoap {
>
> Now I try to create a client with validation in spring:
>
> <jaxws:client id="siebelClient"
> serviceClass="blablabla.NameSoap"
> address="http://...."
> wsdlLocation="path/Name.wsdl">
> <jaxws:properties>
> <entry key="schema-validation-enabled" value="true" />
> </jaxws:properties>
> </jaxws:client>
>
> But I get an error, when I start the app stating that
> {http://blablabla/}NameSoapService can't be found.
> When I add serviceName="Name" to the @WebService-Annotation,
> everything works fine.
> But I don't want to manipulate the generated code.
> What can I do to fix this?
>
> BTW: Supplying "-sn Name" to wsdl2java didn't help.
>
> Greetings,
> Malte
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog