Although I have requested that AW post the latest errata several times, they have failed to do it. Here is the official (according to me) partial errata for this book Ð its not done yet, but it should help you with the errors I've recorded so far. If you want to send me more errors, please e-mail me at Richard@Monson-Haefel.com
CHANGE:
"In other words,
minOccurs is always "0" and maxOccurs is always "1""
TO:
"In othere words, minOccurs is either "0" or "1" (the
default is "1") and maxOccurs is always "1"".
CHANGE:
<?xml
version="1.0" encoding="UTF-8"?>
<purchaseOrder
orderDate="2003-09-22"
xmlns="http://www.Monson-Haefel.com/jwsbook"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Monson-Haefel.com/jwsbook
po.xsd">
<accountName>Amazon.com</accountName>
<accountNumber>923</accountNumber>
TO:
<?xml
version="1.0" encoding="UTF-8"?>
<purchaseOrder
orderDate="2003-09-22"
xmlns="file://./monsonhaefel/jwsbook"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.Monson-Haefel.com/jwsbook
po.xsd">
<accountName>Amazon.com</accountName>
<accountNumber>923</accountNumber>
CHANGE
// Add the getBookPrice and isbn elements.
MH_NS,
"mh:getBookPrice");
body.appendChild(getBookPrice);
Element isbn = xmlDoc.createElementNS(MH_NS, "isbn");
body.appendChild(isbn);
// Add the xsi:type attribute to the isbn element.
Attr typeAttr = xmlDoc.createAttributeNS(XSI_NS,
"xsi:type");
typeAttr.setValue("xsd:string");
isbn.setAttributeNodeNS(typeAttr);
// Add the text contained by the isbn element.
Text text = xmlDoc.createTextNode("0321146182");
body.appendChild(text);
TO:
// Add the getBookPrice and isbn elements.
MH_NS,
"mh:getBookPrice");
getBookPrice.appendChild(getBookPrice);
Element isbn = xmlDoc.createElementNS(MH_NS, "isbn");
body.appendChild(isbn);
// Add the xsi:type attribute to the isbn element.
Attr typeAttr = xmlDoc.createAttributeNS(XSI_NS,
"xsi:type");
typeAttr.setValue("xsd:string");
isbn.setAttributeNodeNS(typeAttr);
// Add the text contained by the isbn element.
Text text = xmlDoc.createTextNode("0321146182");
isbn.appendChild(text);
CHANGE
<wsdl-file>/WEB-INF/wsdl/bookquote.wsdl</wsdl-file>
<jaxrpc-mapping-file>/WEB-INF/bookquote.map</jaxrpc-mapping-file>
TO
<wsdl-file>/META-INF/wsdl/bookquote.wsdl</wsdl-file>
<jaxrpc-mapping-file>/META-INF/bookquote.map</jaxrpc-mapping-file>
In Listing 24-1, the soap:body elements are incorrect. The following shows the listing as it appears in the book with the incorrect elements highlighted in gray.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="BookQuote"
...
<binding
name="BookQuoteBinding" type="mh:BookQuote">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="rpc"/>
<operation name="getBookPrice">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote/BookQuote"/>
</input>
<output>
<soap:body use="literal"
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote/BookQuote"/>
</output>
<fault name="InvalidIsbnFault" >
<soap:fault
name="InvalidIsbnFault" use="literal" />
</fault>
</operation>
</binding>
...
</definitions>
The soap:body elements should indicate that the Web service uses RPC/Encoded messaging Ð in the book it shows RPC/Literal binding which is not correct for a lightweight mapping. I had expected IBM to change the lightweight to using RPC/Literal per the WS-I BP, but they never did. At any rate, the following shows the correct soap:body lements for Listing 24-1 (changes are shown in bold)
<input>
<soap:body use="encoded"
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded"
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
public BookQuote getDocListPort();
TO:
public BookQuote
getDocLitPort();
CHANGE:
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote/BookQuote" />
TO
namespace="http://www.Monson-Haefel.com/jwsbook/BookQuote" />
CHANGE:
<soap:fault
use="literal"
TO
<soap:fault name="InvalidIsbnFault"
use="literal" />