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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:19:21+00:00 2026-06-18T05:19:21+00:00

I am currently try to generate JAX-RPC webservices from java source using the Emitter

  • 0

I am currently try to generate JAX-RPC webservices from java source using the Emitter class (the same as the Java2WSDL tool) provided in Websphere. I am currently using WAS6.1 and WAS7.0 for testing. The issue is when I attempt to generate the WSDL for ‘FooRequest’ the ComplexType ‘Foo’ is missing the Bar[] from it’s definition in the wsdl. When I change ‘FooRequest’ to return Bar[] the wsdl is generated correctly and everything is fine.

Why aren’t the arrays being generated in the wsdl correctly?
Is there something which I am doing wrong?
What is the correctly way to generate the wsdl with the arrays?


Foo.Java

package test;

import com.ibm.ws.webservices.wsdl.fromJava.Emitter;

public class Foo {

    private Bar[] bars;

    private Bar bar;

    private String[] data;

    public Bar[] getBars() {
        return bars;
    }

    public void setBars(Bar[] bars) {
        this.bars = bars;
    }

    public Bar getBar() {
        return bar;
    }

    public void setBar(Bar bar) {
        this.bar = bar;
    }

    public String[] getData() {
        return data;
    }

    public void setData(String[] data) {
        this.data = data;
    }

    public static void main(String[] args) {
        Emitter parser = new Emitter();

        parser.setCls("test.FooRequest");
        parser.setLocationUrl("http://localhost:8080/services/doFooService");

        // Set style/use
        parser.setStyle("document");
        parser.setUse("literal");

        parser.setIntfNamespace("urn:doFooService");
        parser.setClasspath("C:\\temp\\foo");

        parser.setWrapped(true);

        // Generate WSDL
        try {
            parser.emit("C:\\temp\\foo\\Foo.wsdl");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Bar.java

package test;

public class Bar {

    private String baz;

    public String getBaz() {
        return baz;
    }

    public void setBaz(String baz) {
        this.baz = baz;
    }
}

FooRequest.java

package test;

public class FooRequest {

    public Foo getFoo(String input) {
        Foo foo = new Foo();
        Bar[] bars = new Bar[5];
        Bar bar;
        for (int i = 0; i < bars.length; i++) {
            bar = new Bar();
            bar.setBaz("baz:" + (i + 1));
            bars[i] = bar;
        }
        foo.setBars(bars);
        bar = new Bar();
        bar.setBaz("Power Bar");
        foo.setBar(bar);

        String[] data = new String[5];
        for (int i = 0; i < data.length; i++) {
            data[i] = "baz:" + (i + 1);
        }
        return foo;
    }
}

Foo.wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:impl="urn:doFooService" xmlns:intf="urn:doFooService" xmlns:tns1="http://test" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:doFooService">
    <wsdl:types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:doFooService">
            <import namespace="http://test" />
            <element name="getFooResponse">
                <complexType>
                    <sequence>
                        <element name="getFooReturn" nillable="true" type="tns1:Foo" />
                    </sequence>
                </complexType>
            </element>
            <element name="getFoo">
                <complexType>
                    <sequence>
                        <element name="input" nillable="true" type="xsd:string" />
                    </sequence>
                </complexType>
            </element>
        </schema>
        <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test">
            <complexType name="Foo">
                <sequence>
                    <element name="bar" nillable="true" type="tns1:Bar" />
                </sequence>
            </complexType>
            <complexType name="Bar">
                <sequence>
                    <element name="baz" nillable="true" type="xsd:string" />
                </sequence>
            </complexType>
        </schema>
    </wsdl:types>
    <wsdl:message name="getFooResponse">
        <wsdl:part element="impl:getFooResponse" name="parameters" />
    </wsdl:message>
    <wsdl:message name="getFooRequest">
        <wsdl:part element="impl:getFoo" name="parameters" />
    </wsdl:message>
    <wsdl:portType name="FooRequest">
        <wsdl:operation name="getFoo">
            <wsdl:input message="impl:getFooRequest" name="getFooRequest" />
            <wsdl:output message="impl:getFooResponse" name="getFooResponse" />
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="doFooServiceSoapBinding" type="impl:FooRequest">
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="getFoo">
            <wsdlsoap:operation soapAction="" />
            <wsdl:input name="getFooRequest">
                <wsdlsoap:body use="literal" />
            </wsdl:input>
            <wsdl:output name="getFooResponse">
                <wsdlsoap:body use="literal" />
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="FooRequestService">
        <wsdl:port binding="impl:doFooServiceSoapBinding" name="doFooService">
            <wsdlsoap:address location="http://localhost:8080/services/doFooService" />
        </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-18T05:19:23+00:00Added an answer on June 18, 2026 at 5:19 am

    I found a solution in case anyone finds this question in the future.

    The issue was that I had previously obtained jars from an installation of old websphere 6.1:

    • bootstrap.jar
    • classloader.jar
    • emf.jar
    • ffdc.jar
    • j2ee.jar
    • ras.jar
    • wccm_base.jar
    • webserverices.jar
    • wsdl4j.jar
    • wsexception.jar

    These jars had been passed to me via unknown other other, with no version numbers or metadata of any form. I have no idea if they are real releases of intact, but they work. Initially I was using them with the provided websphere 6.1 JRE (java 1.5), but as I was now deploying to websphere 7.0 I changed my software to use the websphere 7.0 (java 1.6). What I wasn’t aware of is that the jar’s and the java 1.5 release were specific to each other, so when using the java 1.6 JRE the Emitter class wouldn’t fail, simply generate an incorrect wsdl.

    To fix this, I just changed the software back to use the java 1.5 JRE until I have the time to correct the jar’s.

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

Sidebar

Related Questions

I am currently try to retrieve a latitude and longitude value from a location.
I am currently using code similar to this: try { // IE ONLY var
I am currently using two catch blocks after a try block. The first catches
I am currently recompiling gtk+ and dependencies from source (I have no other choices).
I'm currently playing with Rails 3.1 RC4, and when I try to generate a
I'm on Windows 7, using javah in Cygwin 1.7.13. I'm currently attempting to generate
I am currently trying to create/generate a CSV file using one of three classes:
I currently use Com4j to talk to iTunes from my Java app, unfortunately it
I am using a .Net HtmlTextWriter to generate HTML. try { htw.RenderBeginTag( HtmlTextWriterTag.Span );
I currently try to use Reachability in iOS 5.1 on iPad. There is a

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.