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 6183141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:18:59+00:00 2026-05-24T01:18:59+00:00

I have a simple web service operation like so: @WebService(endpointInterface = soap.service.sei.HelloWorldSei) public class

  • 0

I have a simple web service operation like so:

@WebService(endpointInterface = "soap.service.sei.HelloWorldSei")
public class Sib {
   public String sayHello() {
      return "Hello World!";
   }
}

I’m using the ksoap2 library for android.
In my android activity, I have:

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 androidHttpTransport = new HttpTransportSE(URL);
    try {
            androidHttpTransport.call(SOAP_ACTION, envelope);
            SoapPrimitive  resultsRequestSOAP = (SoapPrimitive) envelope.getResponse();
            lblResult.setText(resultsRequestSOAP.toString());
        } catch (Exception e) {
            System.out.println("******* THERE WAS AN ERROR ACCESSING THE WEB SERVICE");
            e.printStackTrace();
        }
}

My question is – Since the ‘sayHello’ operation takes no parameters, do I need to include any ‘PropertyInfo’ instances?

  • 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-05-24T01:18:59+00:00Added an answer on May 24, 2026 at 1:18 am

    Yes, it seems that you can. Here’s a working android soap client:

        package soap.service.image;
    
        import org.ksoap2.SoapEnvelope;
        import org.ksoap2.serialization.SoapObject;
        import org.ksoap2.serialization.SoapPrimitive;
        import org.ksoap2.serialization.SoapSerializationEnvelope;
        import org.ksoap2.transport.HttpTransportSE;
    
        import android.app.Activity;
        import android.os.Bundle;
    
        public class ImageSoapActivity extends Activity {
    
            private static final String NAMESPACE = "http://image.webservice";
            private static final String URL = "http://10.0.2.2:8080/images?wsdl";
            private static final String METHOD_NAME = "getImage";
            private static final String SOAP_ACTION = "http://image.webservice/getImage";   
    
            /** 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 androidHttpTransport = new HttpTransportSE(URL);
                try {
                    androidHttpTransport.call(SOAP_ACTION, envelope);
                    SoapPrimitive  resultsRequestSOAP = (SoapPrimitive) envelope.getResponse();
                    System.out.println("****** RESULT: " + resultsRequestSOAP.toString());
                } catch (Exception e) {
                    System.out.println("******* THERE WAS AN ERROR ACCESSING THE WEB SERVICE");
                    e.printStackTrace();
                }        
            }
    }
    

    As you can see, no PropertyInfo objects required 😉 On the service side, I’m using Jax-ws. Hope this helps somebody else out. Oh, and it’s also worth mentioning, that if you are using Jax-ws to build a soap service, I find that I get the dreaded “cannot find dispatch method” exception in android if I don’t use the following elements in the @WebService annotation for my service endpoint interface and service implementation bean: Here is the service endpoint interface

    package soap.service.sei;
    
    import javax.jws.WebService;
    // I get an error in android if I don't include these elements in the
    // @WebService annotation
    @WebService(name = "ImageSei", targetNamespace = "http://image.webservice")
    public interface ImageSei {
        public byte[] getImage();
    }
    

    Here is my service implementation bean

    package soap.service.impl;
    
    import java.awt.image.BufferedImage;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.io.IOException;
    
    import javax.imageio.ImageIO;
    import javax.jws.WebService;
    
    import soap.service.sei.ImageSei;
    // I get an error in android if I don't include these elements in the
    // @WebService annotation
    @WebService(endpointInterface = "soap.service.sei.ImageSei", portName = "ImageWSPort",
            serviceName = "ImageWSService", targetNamespace = "http://image.webservice")
    public class ImageSib implements ImageSei {
    
        @Override
        public byte[] getImage() {
            byte[] imageBytes = null;
            try {
                File imageFile = new File("C:\\images\\car.png");
                BufferedImage img = ImageIO.read(imageFile);
                ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
                ImageIO.write(img, "png", baos);
                baos.flush();
                imageBytes = baos.toByteArray();
                baos.close();
            } catch (IOException ioe) {
                ioe.printStackTrace();
            }
            System.out.println("Got request");
            return imageBytes;
        }
    
    }
    

    As you can see, this service reads an image as a series of bytes and sends it to the android device as a byte array.

    enter image description here

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

Sidebar

Related Questions

No related questions found

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.