---------- Forwarded message ---------- From: arun kumar <arun.kata...@gmail.com> Date: Wed, Sep 7, 2011 at 12:27 PM Subject: consuming webservice using soap (wsdl file genrated in sap server) To: android-developers@googlegroups.com
Hi how to consume webservice from sapserver...am having wsdl file created in sapserver...if i give the user id then the monthly salary will be display..... public class Webservice extends Activity { private static final String NAMESPACE = "urn:sap-com:document:sap:soap:functions:mc-style"; private static String URL = "myurl"; private static final String METHOD_NAME = "ZemptrackEarnOview"; private static final String SOAP_ACTION = "zemptrack_overview"; private Edittext lblResult; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lblResult = (EditText) findViewById(R.id.editText1); SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); Empnfo ei=new EmpInfo(); ei.setValue(" 34343") ; SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.setOutputSoapObject(request); HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); try { androidHttpTransport.call(SOAP_ACTION, envelope); SoapPrimitive resultsRequestSOAP = (SoapPrimitive) envelope.getResponse(); lblResult.setText(resultsRequestSOAP.toString()); } catch (Exception e) { } }} <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>E050E0BFB</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="myurl"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Thanks in advance.... -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en