Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old November 19th, 2012, 01:06 AM   #1 (permalink)
Member
Thread Author (OP)
 
Join Date: Dec 2011
Location: chennai
Posts: 158
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default unable to access my WSDL file on my android emulator

Hi.,

I have developed one android application

this is my code:

[HIGH]
public class RetailerActivity extends Activity {
private static final String SOAP_ACTION = "http://ws.testprops.com/customerData";
private static final String METHOD_NAME = "customerData";
private static final String NAMESPACE = "http://ws.testprops.com";
private static final String URL = "http://87.76.29.180:8080/TestPrompts/services/Fetch?wsdl";


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL);
try {
ht.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
SoapPrimitive s = response;
String str = s.toString();
String resultArr[] = str.split("&");//Result string will split & store in an array

TextView tv = new TextView(this);
for(int i = 0; i<resultArr.length;i++){
tv.append(resultArr[i]+"\n\n");
}
setContentView(tv);

} catch (Exception e) {
e.printStackTrace();
}
}
}
[/HIGH]This is my local tomcat apache server wsdl file:

http://localhost:8089/TestPrompts/services/Fetch?wsdl

means it is successfully worked for my emulator and android device.please see this screenshot:http://screencast.com/t/r4RISmZvL

The same TestPrompts project only i have exported and created war file and uploaded in my tomcat server.

This is my tomcat server wsdl file:

http://87.76.29.180:8080/TestPrompts/services/Fetch?wsdl

But here i have faced one problem:

I have to put these URL means doesn't getting any result on both emulator and android device.Simply am getting black blank screen only.please refer my screenshot:http://screencast.com/t/o5k1qEfQ0

My console window shows following error:
Quote:
11-19 15:12:55.232: D/SntpClient(73): request time failed: java.net.SocketException: Address family not supported by protocol
please help me.how can i resolve this error.

Advertisements
krishnaveni is offline  
Last edited by krishnaveni; November 19th, 2012 at 03:47 AM.
Reply With Quote
sponsored links
Old November 20th, 2012, 09:25 AM   #2 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Unfortunately, I don't use the emulator, so I can't really be of much help, however, I did some searching and came across this thread on SO: android - java.net.SocketException: Address family not supported by protocol issue - Stack Overflow

Do you have a physical device to test on?
__________________
My blog, Inverted Keystrokes, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)
jonbonazza is offline  
Reply With Quote
Old November 21st, 2012, 11:57 PM   #3 (permalink)
Member
Thread Author (OP)
 
Join Date: Dec 2011
Location: chennai
Posts: 158
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

I have tested on my android 2.2 device also.am getting simple blank screen only on my android device.
krishnaveni is offline  
Last edited by krishnaveni; November 22nd, 2012 at 03:21 AM.
Reply With Quote
Old November 22nd, 2012, 12:37 PM   #4 (permalink)
Senior Member
 
jonbonazza's Avatar
 
Join Date: Jul 2010
Gender: Male
Posts: 1,935
 
Device(s): Nexus 4, Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Carrier: ATT

Thanks: 235
Thanked 482 Times in 294 Posts
Default

Do you have the internet permission added to your manifest?
jonbonazza is offline  
Reply With Quote
Old November 22nd, 2012, 09:44 PM   #5 (permalink)
Member
Thread Author (OP)
 
Join Date: Dec 2011
Location: chennai
Posts: 158
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes i have added internet permission already.

This is my manifest file.
Quote:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.retailer.client"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_ST ATE" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".RetailerActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
please help me how can i resolve my error.

The webservice code is given below:
Quote:
package com.testprops.ws;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.PreparedStatement;

public class Fetch {
public String customerData(){
String customerInfo = "";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/android","andidur","fgffgd6");
//Find customer information where the customer ID is maximum
PreparedStatement statement = con.prepareStatement("SELECT * FROM xcart_customers");
ResultSet result = statement.executeQuery();
while(result.next()){
customerInfo = customerInfo + result.getString("login") + "&" + result.getString("password") + "&"+result.getString("firstname") + "&"+result.getString("email");
//Here "&"s are added to the return string. This is help to split the string in Android application
}
}
catch(Exception exc){
System.out.println(exc.getMessage());
}
return customerInfo;
}
}
please give me some solution.how can i resolve this problem.
krishnaveni is offline  
Last edited by krishnaveni; November 24th, 2012 at 03:09 AM.
Reply With Quote
Old November 24th, 2012, 03:13 AM   #6 (permalink)
Member
Thread Author (OP)
 
Join Date: Dec 2011
Location: chennai
Posts: 158
 
Device(s):
Carrier: Not Provided

Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi.,

I got the solution for this after i have gave permission globally on my mysql database.so all are allowed to access my mysql database.but i wish to allow to access my mysql database myself(alone) only.others doesn't allow to access my mysql database.so this situation how can i manage security.please give me solution for this.
krishnaveni is offline  
Last edited by krishnaveni; November 25th, 2012 at 11:12 PM.
Reply With Quote
Reply
Tags
android, apache, emulator, java, java on android, network connection, tomcat


Go Back   Android Forums > Android Development > Application Development

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 11:59 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.