java - What does the exception 'expected: START_TAG' mean, that appears when calling a webservice -
java - What does the exception 'expected: START_TAG' mean, that appears when calling a webservice -
i calling webservice in android using next code:
public class main { private static final string namespace = "urn:sap-com:document:sap:rfc:functions"; private static string url = "http://hr_develop:unrwa2013@10.130.105.8:8000/sap/bc/srt/wsdl/flv_10002a111ad1/srvc_url/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding?sap-client=520"; private static final string method_name = "z_tm_etm_get_empl_holidays"; private static final string soap_action = "urn:sap-com:document:sap:rfc:functions:ztm_ws_get_emp_holidays:z_tm_etm_get_empl_holidaysrequest"; // private static final string soap_action = namespace + "/" + method_name; public static void main(string args[]) { soapobject request = new soapobject(namespace, method_name); propertyinfo arg1 = new propertyinfo(); arg1.name = "pi_pernr"; arg1.type = propertyinfo.string_class; arg1.setvalue("10101010"); request.addproperty(arg1); soapserializationenvelope envelope = new soapserializationenvelope( soapenvelope.ver11); envelope.setoutputsoapobject(request); httptransportse androidhttptransport = new httptransportse(url); seek { androidhttptransport.call(soap_action, envelope); soapprimitive resultsrequestsoap = (soapprimitive) envelope .getresponse(); system.out.println(resultsrequestsoap.tostring()); } grab (exception e) { system.out.println("error: " + e.getmessage()); } } }
but exception occurs:
expected: start_tag {http://schemas.xmlsoap.org/soap/envelope/}envelope (position:start_tag <html>@1:6 in java.io.inputstreamreader@9f436f5)
edit the wsdl file:
<wsdl:definitions targetnamespace="urn:sap-com:document:sap:rfc:functions"> <wsdl:documentation> <sidl:sidl/> </wsdl:documentation> <wsp:usingpolicy wsdl:required="true"/> <wsp:policy wsu:id="bn__binding"> <wsp:exactlyone> <wsp:all> <sapattahnd:enabled>false</sapattahnd:enabled> <saptrnbnd:optimizedmimeserialization wsp:optional="true"/> <wsaw:usingaddressing wsp:optional="true"/> <wsp:all> <sp:transportbinding> <wsp:policy> <sp:transporttoken> <wsp:policy> <sp:httpstoken> <wsp:policy> <sp:httpbasicauthentication/> </wsp:policy> </sp:httpstoken> </wsp:policy> </sp:transporttoken> <sp:algorithmsuite> <wsp:policy> <sp:basic128rsa15/> </wsp:policy> </sp:algorithmsuite> <sp:layout> <wsp:policy> <sp:strict/> </wsp:policy> </sp:layout> </wsp:policy> </sp:transportbinding> </wsp:all> </wsp:all> <wsp:all> <sapattahnd:enabled>false</sapattahnd:enabled> <saptrnbnd:optimizedxmltransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:optional="true"/> <wsaw:usingaddressing wsp:optional="true"/> <wsp:all> <sp:transportbinding> <wsp:policy> <sp:transporttoken> <wsp:policy> <sp:httpstoken> <wsp:policy> <sp:httpbasicauthentication/> </wsp:policy> </sp:httpstoken> </wsp:policy> </sp:transporttoken> <sp:algorithmsuite> <wsp:policy> <sp:basic128rsa15/> </wsp:policy> </sp:algorithmsuite> <sp:layout> <wsp:policy> <sp:strict/> </wsp:policy> </sp:layout> </wsp:policy> </sp:transportbinding> </wsp:all> </wsp:all> </wsp:exactlyone> </wsp:policy> <wsp:policy wsu:id="bn__binding_soap12"> <wsp:exactlyone> <wsp:all> <sapattahnd:enabled>false</sapattahnd:enabled> <saptrnbnd:optimizedmimeserialization wsp:optional="true"/> <wsaw:usingaddressing wsp:optional="true"/> <wsp:all> <sp:transportbinding> <wsp:policy> <sp:transporttoken> <wsp:policy> <sp:httpstoken> <wsp:policy> <sp:httpbasicauthentication/> </wsp:policy> </sp:httpstoken> </wsp:policy> </sp:transporttoken> <sp:algorithmsuite> <wsp:policy> <sp:basic128rsa15/> </wsp:policy> </sp:algorithmsuite> <sp:layout> <wsp:policy> <sp:strict/> </wsp:policy> </sp:layout> </wsp:policy> </sp:transportbinding> </wsp:all> </wsp:all> <wsp:all> <sapattahnd:enabled>false</sapattahnd:enabled> <saptrnbnd:optimizedxmltransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:optional="true"/> <wsaw:usingaddressing wsp:optional="true"/> <wsp:all> <sp:transportbinding> <wsp:policy> <sp:transporttoken> <wsp:policy> <sp:httpstoken> <wsp:policy> <sp:httpbasicauthentication/> </wsp:policy> </sp:httpstoken> </wsp:policy> </sp:transporttoken> <sp:algorithmsuite> <wsp:policy> <sp:basic128rsa15/> </wsp:policy> </sp:algorithmsuite> <sp:layout> <wsp:policy> <sp:strict/> </wsp:policy> </sp:layout> </wsp:policy> </sp:transportbinding> </wsp:all> </wsp:all> </wsp:exactlyone> </wsp:policy> <wsp:policy wsu:id="if__ztm_ws_get_emp_holidays"> <wsp:exactlyone> <wsp:all> <sapsession:session> <sapsession:enablesession>false</sapsession:enablesession> </sapsession:session> <sapcentraladmin:centraladministration wsp:optional="true"> <sapcentraladmin:businessapplicationid>005056ac6e191ed3979a90345dadf406</sapcentraladmin:businessapplicationid> </sapcentraladmin:centraladministration> </wsp:all> </wsp:exactlyone> </wsp:policy> <wsp:policy wsu:id="op__z_tm_etm_get_empl_holidays"> <wsp:exactlyone> <wsp:all> <saptrhnw05:required>no</saptrhnw05:required> <sapcomhnd:enablecommit>false</sapcomhnd:enablecommit> <sapblock:enableblocking>true</sapblock:enableblocking> <saprmnw05:enablewsrm>false</saprmnw05:enablewsrm> </wsp:all> </wsp:exactlyone> </wsp:policy> <wsdl:types> <xsd:schema attributeformdefault="qualified" targetnamespace="urn:sap-com:document:sap:rfc:functions"> <xsd:simpletype name="char1"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="1"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char10"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="10"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char20"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="20"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char220"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="220"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char30"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="30"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char32"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="32"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char40"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="40"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="char50"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="50"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="date10"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="10"/> <xsd:pattern value="\d\d\d\d-\d\d-\d\d"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="numeric3"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="3"/> <xsd:pattern value="\d*"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="numeric6"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="6"/> <xsd:pattern value="\d*"/> </xsd:restriction> </xsd:simpletype> <xsd:simpletype name="numeric8"> <xsd:restriction base="xsd:string"> <xsd:maxlength value="8"/> <xsd:pattern value="\d*"/> </xsd:restriction> </xsd:simpletype> <xsd:complextype name="ztmsholidays"> <xsd:sequence> <xsd:element name="date" type="tns:date10"/> <xsd:element name="description" type="tns:char40"/> </xsd:sequence> </xsd:complextype> <xsd:complextype name="bapiret2"> <xsd:sequence> <xsd:element name="type" type="tns:char1"/> <xsd:element name="id" type="tns:char20"/> <xsd:element name="number" type="tns:numeric3"/> <xsd:element name="message" type="tns:char220"/> <xsd:element name="log_no" type="tns:char20"/> <xsd:element name="log_msg_no" type="tns:numeric6"/> <xsd:element name="message_v1" type="tns:char50"/> <xsd:element name="message_v2" type="tns:char50"/> <xsd:element name="message_v3" type="tns:char50"/> <xsd:element name="message_v4" type="tns:char50"/> <xsd:element name="parameter" type="tns:char32"/> <xsd:element name="row" type="xsd:int"/> <xsd:element name="field" type="tns:char30"/> <xsd:element name="system" type="tns:char10"/> </xsd:sequence> </xsd:complextype> <xsd:complextype name="ztmtt_holidays"> <xsd:sequence> <xsd:element name="item" type="tns:ztmsholidays" minoccurs="0" maxoccurs="unbounded"/> </xsd:sequence> </xsd:complextype> <xsd:element name="z_tm_etm_get_empl_holidays"> <xsd:complextype> <xsd:sequence> <xsd:element name="pi_pernr" type="tns:numeric8"/> </xsd:sequence> </xsd:complextype> </xsd:element> <xsd:element name="z_tm_etm_get_empl_holidaysresponse"> <xsd:complextype> <xsd:sequence> <xsd:element name="pe_i_holidays" type="tns:ztmtt_holidays"/> <xsd:element name="pe_message" type="tns:bapiret2"/> </xsd:sequence> </xsd:complextype> </xsd:element> </xsd:schema> </wsdl:types> <wsdl:message name="z_tm_etm_get_empl_holidays"> <wsdl:part name="parameters" element="tns:z_tm_etm_get_empl_holidays"/> </wsdl:message> <wsdl:message name="z_tm_etm_get_empl_holidaysresponse"> <wsdl:part name="parameter" element="tns:z_tm_etm_get_empl_holidaysresponse"/> </wsdl:message> <wsdl:porttype name="ztm_ws_get_emp_holidays"> <wsp:policy> <wsp:policyreference uri="#if__ztm_ws_get_emp_holidays"/> </wsp:policy> <wsdl:operation name="z_tm_etm_get_empl_holidays"> <wsp:policy> <wsp:policyreference uri="#op__z_tm_etm_get_empl_holidays"/> </wsp:policy> <wsdl:input message="tns:z_tm_etm_get_empl_holidays"/> <wsdl:output message="tns:z_tm_etm_get_empl_holidaysresponse"/> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="binding" type="tns:ztm_ws_get_emp_holidays"> <wsp:policy> <wsp:policyreference uri="#bn__binding"/> </wsp:policy> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="z_tm_etm_get_empl_holidays"> <soap:operation soapaction="urn:sap-com:document:sap:rfc:functions:ztm_ws_get_emp_holidays:z_tm_etm_get_empl_holidaysrequest" 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="binding_soap12" type="tns:ztm_ws_get_emp_holidays"> <wsp:policy> <wsp:policyreference uri="#bn__binding_soap12"/> </wsp:policy> <wsoap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="z_tm_etm_get_empl_holidays"> <wsoap12:operation soapaction="urn:sap-com:document:sap:rfc:functions:ztm_ws_get_emp_holidays:z_tm_etm_get_empl_holidaysrequest" style="document"/> <wsdl:input> <wsoap12:body use="literal"/> </wsdl:input> <wsdl:output> <wsoap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="officialholidays"> <wsdl:port name="binding" binding="tns:binding"> <soap:address location="http://unrwa-red-71.unrwa.org:8000/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding"/> </wsdl:port> <wsdl:port name="binding_soap12" binding="tns:binding_soap12"> <wsoap12:address location="http://unrwa-red-71.unrwa.org:8000/sap/bc/srt/rfc/sap/ztm_ws_get_emp_holidays/520/officialholidays/binding"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
means web service client expects soap envelope response, receives html page. service calling not available.
java android web-services wsdl
Comments
Post a Comment