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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:33:22+00:00 2026-05-31T23:33:22+00:00

Hi i want to make a request for soap using above soap xml <soapenv:Envelope

  • 0

Hi i want to make a request for soap using above soap xml

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:AvailCheck>
         <IUvail>
            <Unit>PC</Unit>
            <Qty>3000</Qty>
         </IUvail>
      </urn:AvailCheck>
   </soapenv:Body>
</soapenv:Envelope>

So I created a code using ksoap library. i created an object for soapobject

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

and added the properties like this

request.addProperty("Unit", "PC");
request.addProperty("Qty", "3000");

but problem is i cant add <IUvail> in the requset.. So how can i add this?

  • 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-31T23:33:23+00:00Added an answer on May 31, 2026 at 11:33 pm

    You can pass a complex object (IUvail) like this:

    IUvail.java

    import java.util.Hashtable;
    
    import org.ksoap2.serialization.KvmSerializable;
    import org.ksoap2.serialization.PropertyInfo;
    import org.ksoap2.serialization.SoapObject;
    
    public class IUvail implements KvmSerializable {
        private String unit;
        private int qty;
    
    public IUvail() {}
    
    public IUvail(String unit, int qty) {
        this.unit = unit;
        this.qty = qty;
    }
    
    public void setUnit(String unit) { this.unit = unit; }
    public void setQty(int qty) { this.qty = qty;}
    public String getUniy() { return unit;}
    public int getQty() { return qty;}
    
    public Object getProperty(int arg0) {
        switch(arg0) {
            case 0:
                return unit;
            case 1:
                return qty;
         }
         return null;
    }
    
    public int getPropertyCount() {
        return 2;
    }
    
    public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo propertyInfo) {
        switch(index){
            case 0:
                propertyInfo.name = "unit";
                propertyInfo.type = PropertyInfo.STRING_CLASS;
                break;
            case 1:
                propertyInfo.name = "qty";
                propertyInfo.type = PropertyInfo.INTEGER_CLASS;
                break;
            default:
                break;
        }
    }
    
    public void setProperty(int index, Object value) {
        switch(index) {
            case 0:
                this.unit = value.toString();
                break;
            case 1:
                this.qty = Integer.parseInt(value.toString());
                break;
            default:
                break;
       }
    }  }
    

    Then

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    IUvail iuvail = new IUvail();
    iuvail.setUnit("PC");
    iuvail.setQty(3000);
    request.addProperty("IUvail", iuvail);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    envelope.addMapping(TARGET_NAMESPACE, "IUvail", new IUvail.getClass());
    
    AndroidHttpTransport transport = new AndroidHttpTransport(URL);
    try {
        transport.call(NAMESPACE + METHOD_NAME, envelope);
        /* Get the response: it depends on your web service implementation */
    } catch (Exception e) {
        e.printStackTrace();
    }
    

    Where NAMESPACE, URL, METHOD_NAME and TARGET_NAMESPACE depends on your ws.

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

Sidebar

Related Questions

So I want to make a http request with a body (say file, file2,
I want to make a request to a SOAP Web Service but I don't
I want to make a request to asp.net page using jQuery.get() . How should
I want to make an Http request and store the result in a JSONObject.
I'm using the Savon gem to make a SOAP request using code similar to
I'm want to make a request to google API and pass the resulting XML
I want to make a request to a web services http://www.w3schools.com/webservices/tempconvert.asmx and I cannot
OK when I make a request I want all the items with the same
I'm trying to make a request/reply section in my project. I want to achieve
When I ping one site it returns Request timed out. I want to make

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.