이것은 WSDL
입니다. 나는 php
(Yii) 웹 서비스 호출을 통해 Android에 연결했습니다.XmlPullParserException : 예상 : START_TAG <... 정의
<wsdl:definitions name="StatisticController" targetNamespace="http://example.com/webservice/statistic/">
<wsdl:message name="getGeneralstatRequest"/>
<wsdl:message name="getGeneralstatResponse">
<wsdl:part name="return" type="xsd:struct"/>
</wsdl:message>
<wsdl:portType name="StatisticControllerPortType">
<wsdl:operation name="getGeneralstat">
<wsdl:documentation/>
<wsdl:input message="tns:getGeneralstatRequest"/>
<wsdl:output message="tns:getGeneralstatResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="StatisticControllerBinding" type="tns:StatisticControllerPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getGeneralstat">
<soap:operation soapAction="http://example.com/webservice/statistic/getGeneralstat" style="rpc"/>
<wsdl:input>
<soap:body use="encoded" namespace="http://example.com/webservice/statistic/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://example.com/webservice/statistic/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="StatisticControllerService">
<wsdl:port name="StatisticControllerPort" binding="tns:StatisticControllerBinding">
<soap:address location="http://example.com/webservice/statistic/ws/1"/>
</wsdl:port>
</wsdl:service>
Webservice를가 작동 :하지만
10-19 11:17:36.068: W/System.err(11165): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions name='StatisticController' targetNamespace='http://example.com/webservice/statistic/'>@13:91 in [email protected])
XML을 얻을. 나는 http://www.validwsdl.com/
자바 코드 테스트 : 나는 3 주 동안 노력했지만, 그것은 작동하지 않는
private static String domain_name = URLEncoder.encode("example.com");
private static final String METHOD_NAME = "getGeneralstat";
private static final String NAMESPACE = "http://"+ domain_name +"/webservice/statistic/";
//private static final String URL = "http://"+ domain_name +"/webservice/statistic/";
private static final String URL = "http://"+ domain_name +"/webservice/generalstat2.wsdl";
private static final String SOAP_ACTION = NAMESPACE + METHOD_NAME;
...
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL,8000); // trying 8 sec
try {
ht.debug = true;
ht.call(SOAP_ACTION, envelope);
...
} catch ...
} catch ...
} catch (XmlPullParserException xe) {
} catch ...
. 나는 많은 많은 화제를 읽었지 만 문제는 해결되지 않았습니다.
고마워요! 나는 그것을 읽고 당신에게 피드백을 줄 것입니다. – Cipo
오류를 극복하도록 도와주었습니다. 고맙습니다. 오류 메시지로 인해 첫 번째 읽기에서 충돌이 발생하고 WSDL을 제대로 이해하지 못했지만 soapAction에 응답하고 동일한 "정의"를 사용하므로 webservice는 ksopa의 함수 호출을 언더 앤드하지 않기 때문에 사용합니다. – Cipo