hi
am having a wsdl file address am posting to http post request to get xml
response....but am getting the response as wsdl file data. can any one
suggest me where am doing wrong ...i attached the code and log messages

thaking you


import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.AbstractHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicHttpResponse;
import org.apache.http.protocol.HTTP;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class Tracking extends Activity {

         TextView usernameEditText;

           public void onCreate(Bundle savedInstanceState) {
               super.onCreate(savedInstanceState);
               setContentView(R.layout.main);


                    try {
                              String xmlRequest = "<?xml version=\"1.0\"
encoding=\"utf-8\"?>"
                                 + "<soapenv:Envelope "
                                 + " xmlns:soapenv=\"
http://schemas.xmlsoap.org/soap/envelope/\"";
                                 + "
xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\""+

                           ("<soapenv:Body>"
                        + "  <urn:ZemptrackEarnOview>"
                        + " <Userid>SRINIVASUS</Userid>/\""

                        + "</ </urn:ZemptrackEarnOview>> </soap:Body>
</soapenv:Envelope>");
                             Log.e("Referral_Request"," xmlRequest"
+xmlRequest);


                        HttpClient httpclient = new DefaultHttpClient();
                        UsernamePasswordCredentials creds = new
UsernamePasswordCredentials("krishnak", "milkyway");
                      ((AbstractHttpClient)
httpclient).getCredentialsProvider().setCredentials(new
AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),creds);


                    //  String postURL = "
http://76.10.226.133:8000/sap/bc/srt/rfc/sap/zemptrack_overview/800/zemptrack_overview/zemptrack_overview
";
                        String postURL = "
http://76.10.226.133:8000/sap/bc/srt/wsdl/bndg_E0D85C5AAE9ADFF19D0400221969C2CB/wsdl11/allinone/ws_policy/document?sap-client=800
";
                        HttpPost post = new HttpPost(postURL);
                        List<NameValuePair> params = new
ArrayList<NameValuePair>();


                                          UrlEncodedFormEntity ent = new
UrlEncodedFormEntity(params,HTTP.UTF_8);
                            post.setHeader("Content-Type",
"text/xml;charset=UTF-8");
                            post.addHeader("SOAPAction: ","");
                            post.addHeader("Authorization:","Basic
c3Jpbml2YXN1czppbml0aWFsMQ==");

                            post.setEntity(ent);

                            BasicHttpResponse httpResponse =
(BasicHttpResponse)httpclient.execute(post);

                            Log.e("httpResponse","Referral_Request"
+httpResponse);
                            Log.e("HTTPStatus","Referral_Request
Response"+httpResponse.getStatusLine().toString());

                            String Status =
httpResponse.getStatusLine().toString();

                            InputStream is =
httpResponse.getEntity().getContent();
                           byte[] buffer = new byte[315];
                            int bytes_read = 0;
                            StringBuilder sb = new StringBuilder();
                            while((bytes_read = is.read(buffer, 0,
buffer.length)) > 0)
                            {
                                    sb.append( new
String(buffer,0,bytes_read));
                            }
                            Log.i("teswt:::","Referral_Request Response data
is:::"+sb.toString());

                            String URL="<url xsi:type=\"xsd:string\">";
                            Log.i("teswt:::","Referral_Request Response data
is:::"+URL+sb.toString().contains(URL));
 } catch (Exception e) {
                          Log.e(getClass().getSimpleName(), e.toString());
                    }

           }

}






09-27 14:41:32.695: INFO/teswt:::(413): Referral_Request Response data
is:::<url xsi:type="xsd:string">false
09-27 15:02:17.004: ERROR/Referral_Request(656):  xmlRequest<?xml
version="1.0" encoding="utf-8"?><soapenv:Envelope  xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style"<soapenv:Body>
<urn:ZemptrackEarnOview> <Userid>SRINIVASUS</Userid>/"</
</urn:ZemptrackEarnOview>> </soap:Body>



</soapenv:Envelope>
09-27 15:02:18.884: ERROR/httpResponse(656):
Referral_Requestorg.apache.http.message.BasicHttpResponse@44ed1ec8


09-27 15:02:18.884: ERROR/HTTPStatus(656): Referral_Request ResponseHTTP/1.1
200 OK




09-27 15:02:19.255: INFO/teswt:::(656): Referral_Request Response data
is:::<?xml version="1.0" encoding="utf-8"?><wsdl:definitions
targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:xsd="
http://www.w3.org/2001/XMLSchema"; xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:http="
http://schemas.xmlsoap.org/wsdl/http/"; xmlns:mime="
http://schemas.xmlsoap.org/wsdl/mime/";
xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" 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:n1="urn:sap-com:document:sap:rfc:functions"><wsdl:documentation><sidl:sidl
xmlns:sidl="http://www.sap.com/2007/03/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"; xmlns:saptrnbnd="
http://www.sap.com/webas/710/soap/features/transportbinding/";
wsp:Optional="true"/><saptrnbnd:OptimizedXMLTransfer uri="
http://www.w3.org/2004/08/soap/features/http-optimization"; xmlns:saptrnbnd="
http://www.sap.com/webas/710/soap/features/transportbinding/";
wsp:Optional="true"/><wsp:ExactlyOne xmlns:wsp="
http://schemas.xmlsoap.org/ws/2004/09/policy"; xmlns:sapsp="
http://www.sap.com/webas/630/soap/features/security/policy"; xmlns:sp="
http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"; xmlns:wsa="
http://www.w3.org/2005/08/addressing"; xmlns:wsu="
http://schemas.xmlsoap.org/ws/2002/07/utility";><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 xmlns:sapsession="
http://www.sap.com/webas/630/soap/features/session/";><sapsession:enableSession>false</sapsession:enableSession></sapsession:Session><sapcentraladmin:CentralAdministration
xmlns:sapcentraladmin="
http://www.sap.com/webas/700/soap/features/CentralAdministration/";
wsp:Optional="true"><sapcentraladmin:BusinessApplicationID>E050E0E32D50BFF1A3D400221969C2CB</sapcentraladmin:BusinessApplicationID></sapcentraladmin:CentralAdministration></wsp:Policy><wsp:Policy
wsu:Id="OP_IF_OP_ZemptrackEarnOview"><sapcomhnd:enableCommit
xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/";>false</sapcomhnd:enableCommit><sapblock:enableBlocking
xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/";>true</sapblock:enableBlocking><saptrhnw05:required
xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/";>no</saptrhnw05:required><saprmnw05:enableWSRM
xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/";>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"
xmlns:n0="urn:sap-com:document:sap:rfc:functions"><xsd:import
namespace="urn:sap-com:document:sap:rfc:functions"/><xsd:simpleType
name="cuky5"><xsd:restriction base="xsd:string"><xsd:maxLength
value="5"/></xsd:restriction></xsd:simpleType><xsd:complexType
name="ZbillStr1"><xsd:sequence><xsd:element name="Name"
type="n0:char80"/><xsd:element name="MnthTotal"
type="n0:curr15.2"/><xsd:element name="Unit"
type="tns:cuky5"/></xsd:sequence></xsd:complexType><xsd:comp

-- 
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

Reply via email to