我调试了oreilly上面的apache soap的狸子,遇到一个错误,望指教//PO.xml<?xml version="1.0" encoding="UTF-8"?>
<PurchaseOrder xmlns="urn:oreilly-jaws-samples">
<shipTo country="US">
<name>Joe Smith</name>
<street>14 Oak Park</street>
<city>Bedford</city>
<state>MA</state>
<zip>01730</zip>
</shipTo>
<items>
<item partNum="872-AA">
<productName>Candy Canes</productName>
<quantity>444</quantity>
<price>1.68</price>
<comment>I want candy!</comment>
</item>
</items>
</PurchaseOrder>
//apache soap deployment desciptor<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
             id="urn:oreilly-jaws-samples" type="message">
  <isd:provider type="java" scope="Application" methods="PurchaseOrder PurchaseOrderWithAttachment">
    <isd:java class="soap.PurchaseOrderAcceptor"/>
  </isd:provider>
  <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>//SimpleGenericHTTPSoapClient
package soap;import java.io.*;
import java.util.*;import javax.xml.soap.Node;import org.apache.soap.Header;
import org.w3c.dom.Element;
import org.w3c.dom.Text;public class SimpleGenericHTTPSoapClient {
// ////////////
// Default values used if no command line parameters are set
//private static final String DEFAULT_HOST_URL = "http://localhost:8080/SoapTest/SimpleHTTPReceive";
private static final String DEFAULT_HOST_URL = "http://localhost:8080/soap/servlet/rpcrouter";private static final String DEFAULT_DATA_FILENAME = "./PO.xml";private static final String URI = "urn:oreilly-jaws-samples";// ////////////
// Member variables
private String m_hostURL;// data file that will be the body content of a soap envelop
private String m_dataFileName;public SimpleGenericHTTPSoapClient(String hostURL, String dataFileName)
throws Exception {
m_hostURL = hostURL;
m_dataFileName = dataFileName;
System.out.println();
System.out
.println("____________________________________________________");
System.out.println("Starting SimpleGenericHTTPSoapClient:");
System.out.println(" host url = " + m_hostURL);
System.out.println(" data file = " + m_dataFileName);
System.out
.println("____________________________________________________");
System.out.println();
}public void sendSOAPMessage() {
try {
// get soap body to include in the SOAP envelope
FileReader fr = new FileReader(m_dataFileName);
javax.xml.parsers.DocumentBuilder xdb = org.apache.soap.util.xml.XMLParserUtils
.getXMLDocBuilder();
org.w3c.dom.Document doc = xdb
.parse(new org.xml.sax.InputSource(fr));
if (doc == null) {
throw new org.apache.soap.SOAPException(
org.apache.soap.Constants.FAULT_CODE_CLIENT,
"parsing error");
}Vector headElements=new Vector();
Element headElement =doc.createElementNS("urn:oreilly-jaws-samples",
"jaws:MessageHeader");Element e=doc.createElement("From");
Text textNode=doc.createTextNode("Me");
e.appendChild(textNode);
headElement.appendChild(e);e=doc.createElement("To");
textNode=doc.createTextNode("You");
e.appendChild(textNode);
headElement.appendChild(e);e=doc.createElement("MessageId");
textNode=doc.createTextNode("12332333");
e.appendChild(textNode);
headElement.appendChild(e);
headElements.add(headElement);// Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
Header header=new Header();
header.setHeaderEntries(headElements);
envelope.setHeader(header);
// create a vector for collecting the body elements
Vector bodyElements = new Vector();
// obtain the top-level DOM element and place it into the vector
bodyElements.add(doc.getDocumentElement());
// Create the SOAP body element
org.apache.soap.Body body = new org.apache.soap.Body();
body.setBodyEntries(bodyElements);
// Add the SOAP body element to the envelope
envelope.setBody(body);
// Build the Message.
org.apache.soap.messaging.Message msg = new org.apache.soap.messaging.Message();
msg.send(new java.net.URL(m_hostURL), URI, envelope);
System.out
.println("Sent SOAP Message with Apache HTTP SOAP Client.");
// receive response from the transport and dump it to
// the screen
System.out.println("Waiting for response....");
org.apache.soap.transport.SOAPTransport st = msg.getSOAPTransport();
BufferedReader br = st.receive();
String line = br.readLine();
if (line == null) {
System.out.println("HTTP POST was successful. \n");
} else {
while (line != null) {
System.out.println(line);
line = br.readLine();
}
}
}catch (Exception e) {
e.printStackTrace();
}
}//
// NOTE: the remainder of this deals with reading arguments
//
/** Main program entry point. */
public static void main(String args[]) {
// not relevant ...
try {
SimpleGenericHTTPSoapClient client=new SimpleGenericHTTPSoapClient(DEFAULT_HOST_URL,DEFAULT_DATA_FILENAME);
client.sendSOAPMessage();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}//PurchaseOrderAcceptor
package soap;import java.io.StringWriter;
import java.util.Enumeration;
import java.util.Vector;import org.apache.soap.Body;
import org.apache.soap.Envelope;
import org.apache.soap.Header;
import org.apache.soap.rpc.SOAPContext;
import org.apache.soap.util.xml.DOM2Writer;
import org.w3c.dom.Element;public class PurchaseOrderAcceptor {public void purchaseOrder(Envelope requestEnvelope,SOAPContext request,SOAPContext response)
{
System.out.println("Receive a PurchaseOrder");
StringWriter writer=new StringWriter(); 
Header header=requestEnvelope.getHeader();
Vector headerEntries=header.getHeaderEntries();
writer.write("header===>>");
for(Enumeration enu=headerEntries.elements();enu.hasMoreElements();)
{
Element e= (Element) enu.nextElement();
DOM2Writer.serializeAsXML(e, writer);
}Body body=requestEnvelope.getBody();
Vector bodyEntries=body.getBodyEntries();
writer.write("body===>>");
for(Enumeration enu=bodyEntries.elements();enu.hasMoreElements();)
{
Element e= (Element) enu.nextElement();
DOM2Writer.serializeAsXML(e, writer);
}
System.out.println(writer.toString());
try
{
response.setRootPart(
"<PurchaseOrderResponse>Accepted</PurchaseOrderResponse>",
"text/xml");
}catch(Exception e){}}
}
运行的时后出现下面的错误,望指教!!!
.____________________________________________________
Starting SimpleGenericHTTPSoapClient:
 host url = http://localhost:8080/soap/servlet/rpcrouter
 data file = ./PO.xml
____________________________________________________Sent SOAP Message with Apache HTTP SOAP Client.
Waiting for response....
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>No Deserializer found to deserialize a &apos;urn:oreilly-jaws-samples:shipTo&apos; using encoding style &apos;null&apos;.</faultstring>
<faultactor>/soap/servlet/rpcrouter</faultactor>
</SOAP-ENV:Fault></SOAP-ENV:Body>
</SOAP-ENV:Envelope>