Skip to main content

@WebService wsdlLocation

5 replies [Last post]
bpm
Offline
Joined: 2007-03-01

Attempting "Start with WSDL and Java" approach as discussed in JSR 181 spec, looks like setting @WebService(wsdlLocation="...") is a way to do this, but this setting never seems to have any effect -- a new wsdl gets generated (whether through wsgen or at deployment time) that does not reflect the wsdl referenced by wsdlLocation. Tried absolute/relative file, http URLs, no luck. Any advice?

Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
csergiu77
Offline
Joined: 2005-02-06

I know this is an old thread but i did the exact steps:

1) i had an wdsl already
2) generated classes with wsimport
3) created a webservice
@WebService(serviceName = "UserService", portName = "UserProvisioning", endpointInterface = "com.xyz.UserProvisioning", targetNamespace = "http://www.xyz.com/wsdl/user/provisioning/service", wsdlLocation = "/WEB-INF/wsdl/service.wsdl"

Everything is deployed , but the wsdl file when i access the webpoint from a browser is not the on efrom wsdlLocation is a generated ONE.

They are alomest the same but they have small differences

Do you know why ?

thx for any help.

Glen Mazza

Yes, I believe the JAX-WS specification requires changing the supplied WSDL
in a few areas, actually possibly just the soap address in the service
section (See note #2 here:
http://www.jroller.com/gmazza/entry/creating_a_wsdl_first_web1#notes) .
This is done automatically by the Metro servlet that is hosting the web
service.

Glen

metro-3 wrote:
>
> I know this is an old thread but i did the exact steps:
>
> 1) i had an wdsl already
> 2) generated classes with wsimport
> 3) created a webservice
> @WebService(serviceName = "UserService", portName = "UserProvisioning",
> endpointInterface = "com.xyz.UserProvisioning", targetNamespace =
> "http://www.xyz.com/wsdl/user/provisioning/service", wsdlLocation =
> "/WEB-INF/wsdl/service.wsdl"
>
> Everything is deployed , but the wsdl file when i access the webpoint from
> a browser is not the on efrom wsdlLocation is a generated ONE.
>
> They are alomest the same but they have small differences
>
> Do you know why ?
>
> thx for any help.
> [Message sent by forum member 'csergiu77' (csergiu77)]
>
> http://forums.java.net/jive/thread.jspa?messageID=335730
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
> For additional commands, e-mail: users-help@metro.dev.java.net
>
>
>

--
View this message in context: http://www.nabble.com/Re%3A-%40WebService-wsdlLocation-tp22398501p223986...
Sent from the Metro - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

wierob
Offline
Joined: 2007-03-26

If you want to write a web service wsdl first and like your wsdl to be returned from ?wsdl you must do:

1) write your wsdl ;)
2) generate code from this wsdl with wsimport (this generates an interface among other)
3) implement the above interface as follows

@WebServicer(endpointInterface="qualifiedNameOfGeneratedInterface",
wsdlLocation="pathToYourWsdl")
public class ServiceImpl implements GeneratedInterface {

}

bhaktimehta
Offline
Joined: 2004-03-18

Hmm. I have seen tests which use this Start with Wsdl and Java approach and have the wsdlLocation="META-INF/wsdl/foo.wsdl" as mentioned in JSR 109. Please can you try specifying the wsdlLocation and if that does not work please file an issue in glassfish.dev.java.net category webservices and also attach your war file

bpm
Offline
Joined: 2007-03-01

O.k. after another look I see the spec says that supporting "Start with WSDL and Java" is optional. I guess that is the case here.

To be clear, wsdlLocation does work on the container side, where it seems to simply be a means to inform the container to use this pre-existing wsdl rather than generating a new one. This supports the needs of "Start from WSDL". However, in "Start from WSDL and Java" you want to be told during compilation/generation --prior to deployment-- if/how the Java you supplied doesn't match up the WSDL you specified. Since apt or wsgen seem to just ignore wsdlLocation, I guess it's just unsupported (unless there is some other way to do this).