Hi ,
am getting xml pull parser exception ....while consuming webservice from the
sap server...PLZ any one tell me where am making the mistake.....thanks in
advance
static StringBuilder sb;
private static final String SOAP_ACTION =
"urn:sap-com:document:sap:soap:functions:mc-style/zemptrack_overview";
private static final String METHOD_NAME = "zemptrack_overview";
private static final String NAMESPACE =
"urn:sap-com:document:sap:soap:functions:mc-style";
private static String URL = "
http://tracking.dataaccess.eu/sap/bc/srt/wsdl/bndg_9ADFF19D0400221969C2CB/wsdl11/allinone/ws_policy/document
";
TextView usernameEditText;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final String username = "arun";
final String password = "arun";
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication
getPasswordAuthentication() {
PasswordAuthentication pa = new
PasswordAuthentication (username, password.toCharArray());
return pa;
}
});
BufferedReader in = null;
StringBuffer sb = new StringBuffer();
try {
URL url = new URL(URL);
URLConnection connection = url.openConnection();
in = new BufferedReader(new InputStreamReader(connection
.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
sb.append(line);
}
} catch (java.net.ProtocolException e) {
sb.append("User Or Password is wrong!");
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e) {
System.out.println("Exception");
}
}
System.out.println("The Data is: " + sb.toString());
Log.i("first", "track");
final TextView usernameEditText = (TextView)
findViewById(R.id.textView1);
final SoapObject request = new SoapObject(NAMESPACE,
METHOD_NAME);
// request.addProperty("ZemptrackEarnOview",
lblResult);
request.addProperty("Userid","SRINIS");
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
System.out.println("hell") ;
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new
HttpTransportSE(URL);
try {
Log.i("fourth", "track");
androidHttpTransport.call(SOAP_ACTION, envelope);
androidHttpTransport.debug = true;
SoapObject response = (SoapObject)envelope.getResponse();
Log.i("third", "track");
int MnthTotal = Integer.parseInt(response.toString());
String Name = response.toString();
Log.i("second", "track");
return;
}
catch (XmlPullParserException ex) {
ex.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
----------------------
<wsdl:definitions
targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
<wsdl:documentation>
<sidl:sidl/>
</wsdl:documentation>
<wsp:UsingPolicy wsdl:required="true"/>
<wsp:Policy wsu:Id="BN_BN_zemptrack_overview">
<saptrnbnd:OptimizedXMLTransfer uri="
http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true"/>
<saptrnbnd:OptimizedXMLTransfer uri="
http://www.w3.org/2004/08/soap/features/http-optimization"
wsp:Optional="true"/>
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding>
<wsp:Policy>
-
<sp:TransportToken>
-
<wsp:Policy>
<sp:HttpsToken/>
</wsp:Policy>
</sp:TransportToken>
-
<sp:AlgorithmSuite>
-
<wsp:Policy>
<sp:TripleDesRsa15/>
</wsp:Policy>
</sp:AlgorithmSuite>
-
<sp:Layout>
-
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
-
<wsp:Policy wsu:Id="IF_IF_zemptrack_overview">
-
<sapsession:Session>
<sapsession:enableSession>false</sapsession:enableSession>
</sapsession:Session>
-
<sapcentraladmin:CentralAdministration wsp:Optional="true">
<sapcentraladmin:BusinessApplicationID>E0503D400221969C2CB</sapcentraladmin:BusinessApplicationID>
</sapcentraladmin:CentralAdministration>
</wsp:Policy>
-
<wsp:Policy wsu:Id="OP_IF_OP_ZemptrackEarnOview">
<sapcomhnd:enableCommit>false</sapcomhnd:enableCommit>
<sapblock:enableBlocking>true</sapblock:enableBlocking>
<saptrhnw05:required>no</saptrhnw05:required>
<saprmnw05:enableWSRM>false</saprmnw05:enableWSRM>
</wsp:Policy>
-
<wsdl:types>
-
<xsd:schema attributeFormDefault="qualified"
targetNamespace="urn:sap-com:document:sap:rfc:functions">
-
<xsd:simpleType name="char12">
-
<xsd:restriction base="xsd:string">
<xsd:maxLength value="12"/>
</xsd:restriction>
</xsd:simpleType>
-
<xsd:simpleType name="char80">
-
<xsd:restriction base="xsd:string">
<xsd:maxLength value="80"/>
</xsd:restriction>
</xsd:simpleType>
-
<xsd:simpleType name="curr15.2">
-
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="15"/>
<xsd:fractionDigits value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
-
<xsd:schema attributeFormDefault="qualified"
targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
<xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/>
-
<xsd:element name="ZemptrackEarnOview">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element name="Userid" type="n0:char12" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
-
<xsd:element name="ZemptrackEarnOviewResponse">
-
<xsd:complexType>
-
<xsd:sequence>
<xsd:element name="MnthTotal" type="n0:curr15.2"/>
<xsd:element name="Name" type="n0:char80"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
-
<wsdl:message name="ZemptrackEarnOview">
<wsdl:part name="parameters" element="tns:ZemptrackEarnOview"/>
</wsdl:message>
-
<wsdl:message name="ZemptrackEarnOviewResponse">
<wsdl:part name="parameter" element="tns:ZemptrackEarnOviewResponse"/>
</wsdl:message>
-
<wsdl:portType name="zemptrack_overview">
-
<wsp:Policy>
<wsp:PolicyReference URI="#IF_IF_zemptrack_overview"/>
</wsp:Policy>
-
<wsdl:operation name="ZemptrackEarnOview">
-
<wsp:Policy>
<wsp:PolicyReference URI="#OP_IF_OP_ZemptrackEarnOview"/>
</wsp:Policy>
<wsdl:input message="tns:ZemptrackEarnOview"/>
<wsdl:output message="tns:ZemptrackEarnOviewResponse"/>
</wsdl:operation>
</wsdl:portType>
-
<wsdl:binding name="zemptrack_overview" type="tns:zemptrack_overview">
-
<wsp:Policy>
<wsp:PolicyReference URI="#BN_BN_zemptrack_overview"/>
</wsp:Policy>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
-
<wsdl:operation name="ZemptrackEarnOview">
<soap:operation soapAction="" style="document"/>
-
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
-
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:service name="service">
-
<wsdl:port name="zemptrack_overview" binding="tns:zemptrack_overview">
<soap:address location="
http://tracking.dataacess.eu/sap/bc/srt/rfc/sap/zemptrack_overview/800/zemptrack_overview/zemptrack_overview
"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en