Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7840289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:43:51+00:00 2026-06-02T15:43:51+00:00

Hello I am new in android. I am trying to connect my android app

  • 0

Hello I am new in android.

I am trying to connect my android app with my web service made in java using glassfish.

This is my WSDL.

<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://TicketingServices/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://TicketingServices/" name="TicketingServices">
<types>
<xsd:schema>
<xsd:import namespace="http://TicketingServices/"     schemaLocation="http://localhost:8080/TicketingService/TicketingServices?xsd=1"/>
</xsd:schema>
</types>
<message name="login">
<part name="parameters" element="tns:login"/>
</message>
<message name="loginResponse">
<part name="parameters" element="tns:loginResponse"/>
</message>
<message name="ola">
<part name="parameters" element="tns:ola"/>
</message>
<message name="olaResponse">
<part name="parameters" element="tns:olaResponse"/>
</message>
<message name="teste">
<part name="parameters" element="tns:teste"/>
</message>
<message name="testeResponse">
<part name="parameters" element="tns:testeResponse"/>
</message>
<portType name="TicketingServices">
<operation name="login">
<input wsam:Action="http://TicketingServices/TicketingServices/loginRequest"  message="tns:login"/>
<output wsam:Action="http://TicketingServices/TicketingServices/loginResponse" message="tns:loginResponse"/>
</operation>
<operation name="ola">
<input wsam:Action="http://TicketingServices/TicketingServices/olaRequest" message="tns:ola"/>
<output wsam:Action="http://TicketingServices/TicketingServices/olaResponse" message="tns:olaResponse"/>
</operation>
<operation name="teste">
<input wsam:Action="http://TicketingServices/TicketingServices/testeRequest" message="tns:teste"/>
<output wsam:Action="http://TicketingServices/TicketingServices/testeResponse" message="tns:testeResponse"/>
</operation>
</portType>
<binding name="TicketingServicesPortBinding" type="tns:TicketingServices">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="login">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="ola">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="teste">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TicketingServices">
<port name="TicketingServicesPort" binding="tns:TicketingServicesPortBinding">
<soap:address location="http://localhost:8080/TicketingService/TicketingServices"/>
</port>
</service>
</definitions>

This is my androidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pt.ubi.tecketing"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />   
    <uses-permission android:name="android.permission.INTERNET" />  
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".TecketingAppActivity"
        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>

This is my Androidapp code

package pt.ubi.tecketing;

import android.app.Activity;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.*;
import org.ksoap2.transport.HttpTransportSE;
import org.ksoap2.transport.HttpsTransportSE;

public class TecketingAppActivity extends Activity {

private static final String URL = "http://192.168.1.159:8080/TicketingService/TicketingServices?wsdl";
private static final String METHOD_NAME = "teste";
private static final String SOAP_ACTION = "TicketingServices";  
private static final String NAMESPACE = "http://TicketingServices/";         

TextView lblAviso; 
String resultsRequestSOAP;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    lblAviso = (TextView) findViewById(R.id.lblAvisoInternet);      

    //Criando os padâmetros de entrada
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    //request.addProperty("texto", "ola");      

    //Envelope SOAP
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.setOutputSoapObject(request);

    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);


    try {
        lblAviso.setText("AQUI1");

       //Chamada ao WS
       androidHttpTransport.call(SOAP_ACTION, envelope);
       lblAviso.setText("AQUI2");


       //String com o retorno
         resultsRequestSOAP = (String) envelope.getResponse();


        lblAviso.setText("teste"+resultsRequestSOAP);

    } catch (Exception e) {

        lblAviso.setText("ERRO");       

    }


}

}

This is my Web service code.

@WebService(serviceName = "TicketingServices", targetNamespace ="http://TicketingServices/")
public class TicketingServices {    

@WebMethod(operationName = "login")
public String login(@WebParam(name = "username") String username, @WebParam(name = "password") String password, @WebParam(name = "server") final String server) {

    return username;
}

@WebMethod(operationName = "ola")
public String ola(@WebParam(name = "texto") String texto) {

    return texto;
}

@WebMethod(operationName = "teste")
public String teste() {

    return "Ola";
}
}

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:43:53+00:00Added an answer on June 2, 2026 at 3:43 pm

    The problem was in my android code, I wrote:

         resultsRequestSOAP = (String) envelope.getResponse();
    

    and the correct is:

         SoapObject resultsRequestSOAP=(SoapObject)envelope.bodyIn;                     
    

    Thank you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am trying to start the android browser from a service using this
Guys i am trying to connect my android app to php server and using
Hello StackOverflow Users, I am new to android and trying to develop a game
I'm trying to make work this example from http://developer.android.com/resources/tutorials/views/hello-timepicker.html , no errors while compiling
I am trying to make an Android/ Java application that needs to connect to
In my android service, I'm starting a new thread like this thread = new
I'm trying to get a PC client to connect to an Android server. This
Hello i am new in android and i really need help with something. I
Hello I'm new to ontologies, my assignment is to create an ontology using Protege
I am trying to build an Android App on Platform 2.2 Froyo. The app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.