String result = "";
SoapObject rpc = new SoapObject("http://tempuri.org/", "UserLogin");
rpc.addProperty("loginName", "aaa");
rpc.addProperty("pwd", "bbb");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
envelope.bodyOut = rpc;
envelope.dotNet = true;
envelope.setOutputSoapObject(rpc);
HttpTransportSE ht = new HttpTransportSE("http://192.168.200.31:8022/HuoYanAgentVehicleService.svc"); 
ht.debug = true;
try {
ht.call("http://tempuri.org/IHuoYanAgentVehicleService/UserLogin", envelope);//这里出错
if(envelope.getResponse()!=null){
    SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
    result = response.toString();
}
System.out.println("detail" + result);
return result;
} catch (IOException e) {
e.printStackTrace();
} catch (XmlPullParserException e) {
// TODO Auto-generated catch block
System.out.println("*******"+ ht.requestDump.toString());
            System.out.println("*******"+ ht.responseDump.toString()); 
e.printStackTrace();
}错误描述:
org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@40890440) 
http://192.168.200.31:8022/HuoYanAgentVehicleService.svc为webservice可访问
那位大侠帮看看啊

解决方案 »

  1.   

    xml:
    <?xml version="1.0" encoding="UTF-8"?>
    -<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/" name="HuoYanAgentVehicleService">-<wsp:Policy wsu:Id="WSHttpBinding_IHuoYanAgentVehicleService_policy">-<wsp:ExactlyOne>-<wsp:All><wsaw:UsingAddressing/></wsp:All></wsp:ExactlyOne></wsp:Policy>-<wsdl:types>-<xsd:schema targetNamespace="http://tempuri.org/Imports"><xsd:import namespace="http://tempuri.org/" schemaLocation="http://uxinwebtest1.uxin.youxinpai.com:8022/HuoYanAgentVehicleService.svc?xsd=xsd0"/><xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" schemaLocation="http://uxinwebtest1.uxin.youxinpai.com:8022/HuoYanAgentVehicleService.svc?xsd=xsd1"/></xsd:schema></wsdl:types>-<wsdl:message name="IHuoYanAgentVehicleService_UserLogin_InputMessage"><wsdl:part name="parameters" element="tns:UserLogin"/></wsdl:message>-<wsdl:message name="IHuoYanAgentVehicleService_UserLogin_OutputMessage"><wsdl:part name="parameters" element="tns:UserLoginResponse"/></wsdl:message>-<wsdl:message name="IHuoYanAgentVehicleService_GetAgentVehicleListByUserId_InputMessage"><wsdl:part name="parameters" element="tns:GetAgentVehicleListByUserId"/></wsdl:message>-<wsdl:message name="IHuoYanAgentVehicleService_GetAgentVehicleListByUserId_OutputMessage"><wsdl:part name="parameters" element="tns:GetAgentVehicleListByUserIdResponse"/></wsdl:message>-<wsdl:portType name="IHuoYanAgentVehicleService">-<wsdl:operation name="UserLogin"><wsdl:input message="tns:IHuoYanAgentVehicleService_UserLogin_InputMessage" wsaw:Action="http://tempuri.org/IHuoYanAgentVehicleService/UserLogin"/><wsdl:output message="tns:IHuoYanAgentVehicleService_UserLogin_OutputMessage" wsaw:Action="http://tempuri.org/IHuoYanAgentVehicleService/UserLoginResponse"/></wsdl:operation>-<wsdl:operation name="GetAgentVehicleListByUserId"><wsdl:input message="tns:IHuoYanAgentVehicleService_GetAgentVehicleListByUserId_InputMessage" wsaw:Action="http://tempuri.org/IHuoYanAgentVehicleService/GetAgentVehicleListByUserId"/><wsdl:output message="tns:IHuoYanAgentVehicleService_GetAgentVehicleListByUserId_OutputMessage" wsaw:Action="http://tempuri.org/IHuoYanAgentVehicleService/GetAgentVehicleListByUserIdResponse"/></wsdl:operation></wsdl:portType>-<wsdl:binding name="WSHttpBinding_IHuoYanAgentVehicleService" type="tns:IHuoYanAgentVehicleService"><wsp:PolicyReference URI="#WSHttpBinding_IHuoYanAgentVehicleService_policy"/><soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>-<wsdl:operation name="UserLogin"><soap12:operation style="document" soapAction="http://tempuri.org/IHuoYanAgentVehicleService/UserLogin"/>-<wsdl:input><soap12:body use="literal"/></wsdl:input>-<wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation>-<wsdl:operation name="GetAgentVehicleListByUserId"><soap12:operation style="document" soapAction="http://tempuri.org/IHuoYanAgentVehicleService/GetAgentVehicleListByUserId"/>-<wsdl:input><soap12:body use="literal"/></wsdl:input>-<wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding>-<wsdl:service name="HuoYanAgentVehicleService">-<wsdl:port name="WSHttpBinding_IHuoYanAgentVehicleService" binding="tns:WSHttpBinding_IHuoYanAgentVehicleService"><soap12:address location="http://uxinwebtest1.uxin.youxinpai.com:8022/HuoYanAgentVehicleService.svc"/>-<wsa10:EndpointReference><wsa10:Address>http://uxinwebtest1.uxin.youxinpai.com:8022/HuoYanAgentVehicleService.svc</wsa10:Address>-<Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"><Dns>localhost</Dns></Identity></wsa10:EndpointReference></wsdl:port></wsdl:service></wsdl:definitions>
      

  2.   

    看看你 服务端的协议是不是  basicHttpBinding