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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:00:49+00:00 2026-06-17T00:00:49+00:00

I need my web service class to return an array of the following customer

  • 0

I need my web service class to return an array of the following customer class which has an array in itself.

When create the web service the wsdl will be created but when I try to access it using its url it shows the following error.

Following error will be shown when I add ?wsdl to address

AXIS error

Could not generate WSDL!

There is no SOAP service at this location

Following Error will be shown when I do not add ?wsdl to address

AXIS error

No service is available at this URL

My Customer class

package myclasses;

public class customer {
private String name;
private int age;
private int[] rankings;

public customer(){
    //Any initializations here.
}

public customer(String n, int a) {
    this.name = n;
    this.age = a;
    rankings = new int[2];
    rankings[0] = 1;
    rankings[1] = 2;

}

public String getName() {
    return name;
}

............Rest of setter and getters goes here .............

}

My Web service class

     package services;

import myclasses.customer;

import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebResult;
import javax.jws.soap.SOAPBinding; 

@WebService (name="Hellos", 
targetNamespace="http://localhost:8081/Mywebservice2/services/Hellos")  
@SOAPBinding  
(  
      style = SOAPBinding.Style.RPC,  
      use = SOAPBinding.Use.LITERAL,  
      parameterStyle = SOAPBinding.ParameterStyle.WRAPPED  
 )  
public class Hellos {

    @WebMethod
    public @WebResult(name="name",partName="name") String getName(){
        return "Jack";
    }
    
    @WebMethod
    public @WebResult (name="customers",partName="customers") customer[] mycustomers() {
        customer[] cus = new customer[2];
        cus[0] = new customer("Jack", 28);
        cus[1] = new customer("Alex", 29);
        return cus;
        
    }
}

My wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://services" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services" xmlns:intf="http://services" xmlns:tns1="http://myclasses" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://services" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://myclasses"/>
   <element name="getName">
    <complexType/>
   </element>
   <element name="getNameResponse">
    <complexType>
     <sequence>
      <element name="getNameReturn" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="mycustomers">
    <complexType/>
   </element>
   <element name="mycustomersResponse">
    <complexType>
     <sequence>
      <element maxOccurs="unbounded" name="mycustomersReturn" type="tns1:customer"/>
     </sequence>
    </complexType>
   </element>
  </schema>
  <schema elementFormDefault="qualified" targetNamespace="http://myclasses" xmlns="http://www.w3.org/2001/XMLSchema">
   <complexType name="customer">
    <sequence>
     <element name="age" type="xsd:int"/>
     <element name="name" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="getNameResponse">

      <wsdl:part element="impl:getNameResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="mycustomersResponse">

      <wsdl:part element="impl:mycustomersResponse" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="mycustomersRequest">

      <wsdl:part element="impl:mycustomers" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:message name="getNameRequest">

      <wsdl:part element="impl:getName" name="parameters">

      </wsdl:part>

   </wsdl:message>

   <wsdl:portType name="Hellos">

      <wsdl:operation name="getName">

         <wsdl:input message="impl:getNameRequest" name="getNameRequest">

       </wsdl:input>

         <wsdl:output message="impl:getNameResponse" name="getNameResponse">

       </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="mycustomers">

         <wsdl:input message="impl:mycustomersRequest" name="mycustomersRequest">

       </wsdl:input>

         <wsdl:output message="impl:mycustomersResponse" name="mycustomersResponse">

       </wsdl:output>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="HellosSoapBinding" type="impl:Hellos">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getName">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getNameRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getNameResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="mycustomers">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="mycustomersRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="mycustomersResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="HellosService">

      <wsdl:port binding="impl:HellosSoapBinding" name="Hellos">

 

        <wsdlsoap:address location="http://localhost:8081/Mywebservice2/services/Hellos"/>
    
           </wsdl:port>
    
        </wsdl:service>
    
     </wsdl:definitions>
  • 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-17T00:00:51+00:00Added an answer on June 17, 2026 at 12:00 am

    The value type “myclasses.customer” used via the service class “services.Hellos” does not have a public default constructor

    Just use this in customer class.

    public customer()
    {
      //Any initializations here.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need my web service to return JSON... I have the following code in
Hi i am working on web service application in android.i need a class that
I need to create a web service that returns XML data to some of
I have a WSDL that the consumer of my web service expects will be
I'm trying to write a WCF Web service that will return my data as
I have a web service which returns something of type MyData . public class
We're running an Axis 1 Java client. The web service will sometime return an
We return instances of the class AuthenticateUserOutput from a WCF web service. So we
I need to deploy the same web service for each customer. This @javax.jws.WebService uses
I have to invoke a restful Web-Service from client side java class. I need

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.