<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://ws.sitech.com"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://ws.sitech.com">
<wsdl:documentation>网上商城预约号码: 网上商城预约号码<wsdl:documentation>
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://ws.sitech.com">
<xs:element name="callService">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="pin"
nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="callServiceResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return"
nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="callServiceRequest">
<wsdl:part name="parameters" element="ns:callService" />
</wsdl:message>
<wsdl:message name="callServiceResponse">
<wsdl:part name="parameters" element="ns:callServiceResponse" />
</wsdl:message>
<wsdl:portType name="sPreOrderPortType">
<wsdl:operation name="callService">
<wsdl:input message="ns:callServiceRequest"
wsaw:Action="urn:callService" />
<wsdl:output message="ns:callServiceResponse"
wsaw:Action="urn:callServiceResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="sPreOrderSoap11Binding"
type="ns:sPreOrderPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="callService">
<soap:operation soapAction="urn:callService"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="sPreOrderSoap12Binding"
type="ns:sPreOrderPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="callService">
<soap12:operation soapAction="urn:callService"
style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="sPreOrderHttpBinding"
type="ns:sPreOrderPortType">
<http:binding verb="POST" />
<wsdl:operation name="callService">
<http:operation location="sPreOrder/callService" />
<wsdl:input>
<mime:content type="text/xml" part="callService" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="callService" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="sPreOrder">
<wsdl:port name="sPreOrderHttpSoap11Endpoint"
binding="ns:sPreOrderSoap11Binding">
<soap:address
location="http://10.153.195.5:53000/esbWS/services/sPreOrder/" />
</wsdl:port>
<wsdl:port name="sPreOrderTcpSoap11Endpoint"
binding="ns:sPreOrderSoap11Binding">
<soap:address
location="tcp://10.153.195.5:52000/esbWS/services/sPreOrder" />
</wsdl:port>
<wsdl:port name="sPreOrderHttpSoap12Endpoint"
binding="ns:sPreOrderSoap12Binding">
<soap12:address
location="http://10.153.195.5:53000/esbWS/services/sPreOrder/" />
</wsdl:port>
<wsdl:port name="sPreOrderTcpSoap12Endpoint"
binding="ns:sPreOrderSoap12Binding">
<soap12:address
location="tcp://10.153.195.5:52000/esbWS/services/sPreOrder" />
</wsdl:port>
<wsdl:port name="sPreOrderHttpEndpoint"
binding="ns:sPreOrderHttpBinding">
<http:address
location="http://10.153.195.5:53000/esbWS/services/sPreOrder/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
package com.sinovatech.webservice;import javax.xml.namespace.QName;import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;import com.sinovatech.webservice.bossdto.SPreOrderDTO;public class WsClient {
private static final Log log = LogFactory.getLog(WsClient.class); private RPCServiceClient serviceClient; private Options options; private EndpointReference targetEPR; /**
 * 网上商城预约号码
 * 
 * @param dto
 * @return
 */
public String sPreOrder(SPreOrderDTO dto) {
log.info("start visit boss web service server : sPreOrder");
StringBuilder busiInfo = new StringBuilder()
.append("<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"no\" ?>")
.append("<ROOT>")
.append("<LOGIN_ACCEPT type=\"long\">")
.append(dto.getLogin_accept())
.append("</LOGIN_ACCEPT>")
// 流水号(为第三方订单ID)
.append("<ID_TYPE type=\"string\">")
.append(dto.getId_type())
.append("</ID_TYPE>")
// 证件类型
.append("<ID_ICCID type=\"string\">").append(dto.getId_iccid())
.append("</ID_ICCID>")
// 证件号码
.append("<NUM_LIST type=\"string\">").append(dto.getNum_list())
.append("</NUM_LIST>")
// 预约号码结果集
.append("<DIFF_FLAG type=\"string\">").append(
dto.getDiff_flag()).append("</DIFF_FLAG>")// 是否异地标识
.append("</ROOT>");
return busiInfo.toString();
} public WsClient() { } public WsClient(String endpoint) {
try {
serviceClient = new RPCServiceClient();
// options = serviceClient.getOptions();
options = new Options();
targetEPR = new EndpointReference(endpoint);
options.setTo(targetEPR);
options.setAction("urn:callService");
// options.setSoapVersionURI("");
serviceClient.setOptions(options);
} catch (Exception e) {
e.printStackTrace();
}
} public Object[] invokeOp(String targetNamespace, String opName,
Object[] opArgs, Class<?>[] opReturnType) {
try {
// 设定操作的名称
QName opQName = new QName(targetNamespace, opName);
// 设定返回值 // Class<?>[] opReturn = new Class[] { opReturnType };

// 操作需要传入的参数已经在参数中给定,这里直接传入方法中调用
if(serviceClient!=null)
System.out.println("================serviceClient is not null");
return serviceClient.invokeBlocking(opQName, opArgs, opReturnType);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

public String invokeOp2(String targetNamespace, String opName,
Object[] opArgs) {
try {
// 设定操作的名称
QName opQName = new QName(targetNamespace, opName);
// 设定返回值 // Class<?>[] opReturn = new Class[] { opReturnType };
OMElement element = serviceClient.invokeBlocking(opQName, opArgs); 
// 操作需要传入的参数已经在参数中给定,这里直接传入方法中调用
if(serviceClient!=null)
System.out.println("================serviceClient is not null");
// return serviceClient.invokeBlocking(opQName, opArgs, opReturnType);
return element.getFirstElement().getText();
} catch (Exception e) {
e.printStackTrace();
}
return null;
} public String axis2Client() {
final String endPointReference = "http://10.153.195.5:53000/esbWS/services/sPreOrder";
final String targetNamespace = "http://ws.sitech.com";
WsClient client = new WsClient(endPointReference);
String opName = "callService";
SPreOrderDTO dto = new SPreOrderDTO();
dto.setLogin_accept(201001210001l);
dto.setId_type("0");
dto.setId_iccid("101010101");
dto.setNum_list("19700000001");
dto.setDiff_flag("1");
Object[] opArgs = new Object[] { sPreOrder(dto) };
Class<?>[] opReturnType = new Class[] { String[].class }; Object[] response = client.invokeOp(targetNamespace, opName, opArgs,
opReturnType);
String result = client.invokeOp2(targetNamespace, opName, opArgs);
System.out.println("result========" + result);
if(response == null)
System.out.println("=============response is null");
else
System.out.println("=============response is not null");
// return (((String[]) response[0])[0]);
return result;
}
上面是一个服务端的wsdl,一个是根据这个wsdl写的客户端,我用了两种方法接收返回值,这两种方法都不行,用invokeOp这个方法得到的object是空的,用invokeOp2这个方法得到的字符串是空的,请问有什么错误使我得不到返回值