哪位大哥能告诉我这个生成的XML是什么样子的?
hodat 2012-08-04 03:12:28 /* 56 */ DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder();
/* 57 */ Document doc = xdb.newDocument();
/* 58 */ Element root = doc.createElement("getprice");
/* 59 */ Element tempEl = doc.createElement("org");
/* 60 */ tempEl.appendChild(doc.createTextNode(org));
/* 61 */ root.appendChild(tempEl);
/* */
/* 63 */ tempEl = doc.createElement("dst");
/* 64 */ tempEl.appendChild(doc.createTextNode(dst));
/* 65 */ root.appendChild(tempEl);
/* */
/* 67 */ tempEl = doc.createElement("airline");
/* 68 */ tempEl.appendChild(doc.createTextNode(airline));
/* 69 */ root.appendChild(tempEl);
/* */ try {
/* 71 */ Call call = new Call();
/* 72 */ call.setTargetObjectURI(this.targetURI);
/* 73 */ call.setMethodName("sendCmd");
/* 74 */ call.setEncodingStyleURI("http://xml.apache.org/xml-soap/literalxml");
/* 75 */ Vector params = new Vector();
/* 76 */ params.addElement(new Parameter("element", Element.class, root, "http://xml.apache.org/xml-soap/literalxml"));
/* 77 */ call.setParams(params);
/* 78 */ Response resp = call.invoke(this.routerURL, "");
/* 79 */ if (!resp.generatedFault()) {
/* 80 */ Parameter ret = resp.getReturnValue();
/* 81 */ Element resultEl = (Element)ret.getValue();
/* 82 */ return resultEl;
/* */ }
我自己做出来的是
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns2079:sendCmd xmlns:ns2079="urn:SOAPService"><element xmlns:ns1285="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1285:Array"><getprice xmlns:ns4656="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4656:Array"><org xmlns:ns4376="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">SZX</org><dst xmlns:ns3862="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">HAK</dst><airline xmlns:ns3899="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">CZ6443</airline></getprice></element></ns2079:sendCmd></SOAP-ENV:Body></SOAP-ENV:Envelope>
但是返回的一直是
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>The 'http://schemas.xmlsoap.org/soap/encoding/:arrayType' attribute must be specified for every array.</faultstring>
那位大哥可以办公运行一下看看生成的XML是什么样子的?
不胜感激