After generating the artifacts for a Java WS client,
- why is the wsdllocation reference required?
- why is the WSDL needed at runtime?
I might see a reason for some validation, but shouldn’t that be optional?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Summary: While from a design perspective the WSDL is not necessary for a web service client, the implementation effected by Sun for a web service client has a hard dependency on the WSDL. The apparent purpose is to generate some of the runtime dependencies dynamically.
First: it is considered a good practice to package your WSDL, and reference it, if you expect to produce a portable client.
Now, with that aside, the WSDL would not be required if the implementation generated all required runtime artifacts.
For Java, the wsimport tool generates some static artifacts (interfaces and possibly support code to meet performance targets) and leaves other elements to be dynamically created at runtime. From the start, we see the WSDL document takes a primary position in the Service constructor:
The WSDL document is resolved to a
sourcedata stream; if not provided, it defaults to (liberties taken to extract the core essence):and digging deeper, to a WSServiceDelegate:
It’s creating at least some portion of the underlying service support dynamically.
The wsdlLocation is integral to the Java implementation.