Java Reference
In-Depth Information
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
<soap:header message="si:SubscriptionInfoMessage"
part="SubscriptionInfo" use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AddressDistanceCalculator">
<wsdl:port name="AddressDistanceCalculatorSoap"
binding="si:AddressDistanceCalculatorSoap">
<soap:address
location="http://ws.strikeiron.com/StrikeIron/
AddressDistanceCalculator" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Here, the WSDL does not indicate its headers as method parameters, and you cannot therefore
use generated Holder objects to pass the headers along with your request. Put more precisely,
it doesn't declare that it uses headers in the abstract part of the WSDL, the port type. But the
concrete aspect, the binding element whose AddressToAddressDistance operation you're
going to invoke, does declare headers. Because they're missing from the abstract part, JAX-
WS won't generate them. You'll have to add them to the message another way.
The object that needs to get added is a LicenseInfo , which also contains a RegisteredUser ,
which has a string user ID and password. I've omitted the types to save space, but they are all
fairly straightforward, and make clear and direct translations to the JAXB objects generated
by JAX-WS that you use in your Java client to invoke the operation.
NOTE
If you want to see the complete WSDL this service uses in order to view the types, go to ht-
tp://ws.strikeiron.com/AddressDistanceCalculator?WSDL . You might first check out a web-based
client that allows you to test it before trying to tie all of the objects together; this is located at ht-
tp://www.strikeiron.com/sample/AddressDistanceCalculator_v2_0/AddressDistanceCalculator.aspx .
You don't have to entirely forego the convenience of JAX-WS and return to lengthy stanzas
of SAAJ code, however. You just have to make a few minor adjustments that are perfectly
simple and elegant once you understand what's involved.
Search WWH ::




Custom Search