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

  • Home
  • SEARCH
  • 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 113163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:39:33+00:00 2026-05-11T02:39:33+00:00

So, I’m getting some compile errors on netbeans 6.5 generated web service code for

  • 0

So, I’m getting some compile errors on netbeans 6.5 generated web service code for a java ME client to a c# (vs2005) web service. I’ve trimmed my example significantly, and it still shows the problem, and not being able to return a collection of things is pretty much a deal-breaker.

c# web service (SimpleWebService.asmx)

<%@ WebService Language='C#' Class='SimpleWebService' %>  using System; using System.Web; using System.Web.Services; using System.Web.Services.Protocols;  [WebService(Namespace = 'http://sphereinabox.com/')] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class SimpleWebService  : System.Web.Services.WebService {      [WebMethod]     public CustomType[] GetSomething() {         return new CustomType[] {new CustomType('hi'), new CustomType('bye')};     }     public class CustomType {         public string Name;         public CustomType(string _name) {             Name = _name;         }         public CustomType() {         }     } } 

WSDL (automatically generated by vs2005):

<?xml version='1.0' encoding='utf-8'?> <wsdl:definitions xmlns:s='http://www.w3.org/2001/XMLSchema' xmlns:soap12='http://schemas.xmlsoap.org/wsdl/soap12/' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/' xmlns:tns='http://sphereinabox.com/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tm='http://microsoft.com/wsdl/mime/textMatching/' xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' targetNamespace='http://sphereinabox.com/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'>   <wsdl:types>     <s:schema elementFormDefault='qualified' targetNamespace='http://sphereinabox.com/'>       <s:element name='GetSomething'>         <s:complexType />       </s:element>       <s:element name='GetSomethingResponse'>         <s:complexType>           <s:sequence>             <s:element minOccurs='0' maxOccurs='1' name='GetSomethingResult' type='tns:ArrayOfCustomType' />           </s:sequence>         </s:complexType>       </s:element>       <s:complexType name='ArrayOfCustomType'>         <s:sequence>           <s:element minOccurs='0' maxOccurs='unbounded' name='CustomType' nillable='true' type='tns:CustomType' />         </s:sequence>       </s:complexType>       <s:complexType name='CustomType'>         <s:sequence>           <s:element minOccurs='0' maxOccurs='1' name='Name' type='s:string' />         </s:sequence>       </s:complexType>     </s:schema>   </wsdl:types>   <wsdl:message name='GetSomethingSoapIn'>     <wsdl:part name='parameters' element='tns:GetSomething' />   </wsdl:message>   <wsdl:message name='GetSomethingSoapOut'>     <wsdl:part name='parameters' element='tns:GetSomethingResponse' />   </wsdl:message>   <wsdl:portType name='SimpleWebServiceSoap'>     <wsdl:operation name='GetSomething'>       <wsdl:input message='tns:GetSomethingSoapIn' />       <wsdl:output message='tns:GetSomethingSoapOut' />     </wsdl:operation>   </wsdl:portType>   <wsdl:binding name='SimpleWebServiceSoap' type='tns:SimpleWebServiceSoap'>     <soap:binding transport='http://schemas.xmlsoap.org/soap/http' />     <wsdl:operation name='GetSomething'>       <soap:operation soapAction='http://sphereinabox.com/GetSomething' style='document' />       <wsdl:input>         <soap:body use='literal' />       </wsdl:input>       <wsdl:output>         <soap:body use='literal' />       </wsdl:output>     </wsdl:operation>   </wsdl:binding>   <wsdl:binding name='SimpleWebServiceSoap12' type='tns:SimpleWebServiceSoap'>     <soap12:binding transport='http://schemas.xmlsoap.org/soap/http' />     <wsdl:operation name='GetSomething'>       <soap12:operation soapAction='http://sphereinabox.com/GetSomething' style='document' />       <wsdl:input>         <soap12:body use='literal' />       </wsdl:input>       <wsdl:output>         <soap12:body use='literal' />       </wsdl:output>     </wsdl:operation>   </wsdl:binding>   <wsdl:service name='SimpleWebService'>     <wsdl:port name='SimpleWebServiceSoap' binding='tns:SimpleWebServiceSoap'>       <soap:address location='http://localhost/SimpleWebService/SimpleWebService.asmx' />     </wsdl:port>     <wsdl:port name='SimpleWebServiceSoap12' binding='tns:SimpleWebServiceSoap12'>       <soap12:address location='http://localhost/SimpleWebService/SimpleWebService.asmx' />     </wsdl:port>   </wsdl:service> </wsdl:definitions> 

Generated (netbeans) code that fails to compile, this was created going through the ‘Add -> New JavaME to Web Services Client’ wizard. (SimpleWebService_Stub.java)

    public ArrayOfCustomType GetSomething() throws java.rmi.RemoteException {         Object inputObject[] = new Object[] {         };          Operation op = Operation.newInstance( _qname_operation_GetSomething, _type_GetSomething, _type_GetSomethingResponse );         _prepOperation( op );         op.setProperty( Operation.SOAPACTION_URI_PROPERTY, 'http://sphereinabox.com/GetSomething' );         Object resultObj;         try {             resultObj = op.invoke( inputObject );         } catch( JAXRPCException e ) {             Throwable cause = e.getLinkedCause();             if( cause instanceof java.rmi.RemoteException ) {                 throw (java.rmi.RemoteException) cause;             }             throw e;         }  //////// Error on next line, symbol ArrayOfCustomType_fromObject not defined         return ArrayOfCustomType_fromObject((Object[])((Object[]) resultObj)[0]);     } 

it turns out with this contrived example (the ‘CustomType’ in my production problem has more than one field) I also get errors from this fun code in the same generated (SimpleWebService_Stub.java) generated code. The errors are that string isn’t defined (it’s String in java, and besides I think this should be talking about CustomType anyway).

private static string string_fromObject( Object obj[] ) {     if(obj == null) return null;     string result = new string();     return result; } 
  • 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. 2026-05-11T02:39:33+00:00Added an answer on May 11, 2026 at 2:39 am

    Clearly you shouldn’t be using fancy built-in things like netbeans’s stub generator. Noes, you should be using the Sun (or Sprint branded…) stub generator which you can get to by:

    1. Right-Clicking your project
    2. select Properties
    3. Select Platform on the left side of new dialog
    4. Click on Manage Emulators on the rigt side
    5. Select the emulator of your choice (Sun Java(TM) Wirless Tookit 2.5 for CLDC) on the left of this new dialog
    6. Click on the Tools & Extensions tab.
    7. Click the Open Utilities button.
    8. Select the Stub Generator Utility in this new dialog
    9. Cry about the large number of steps and dialogs involved.
    10. Click Launch
    11. Specify your WSDL Url http://localhost/SimpleWebService/SimpleWebService.asmx?WSDL
    12. Specify your ouput path ** C:\code\SimpleMobile\src\ **
    13. Specify your output package simplewebservice or whatever you
    14. Press the OK button.
    15. Ignore the errors about being unable to compile if you’re going to compile with netbeans. error : com.sun.tools.javac.Main is not availble in the classpath.. error: comilation failed, errors should have been reported
    16. Repeat all of the above any time the web service changes, and the stubs need to be regenerated.
    17. Write a batch file to do this to save your sanity.

    ugh. Well anyway, the above I found in Jonathan Knudsen’s book ‘Kicking Butt with MIDP and MSA: Creating Great Mobile Applications’

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

Sidebar

Ask A Question

Stats

  • Questions 113k
  • Answers 113k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You could try installing 3.5 SP1 on your windows server… May 11, 2026 at 10:08 pm
  • Editorial Team
    Editorial Team added an answer wow, i don't want to come across as an answer… May 11, 2026 at 10:08 pm
  • Editorial Team
    Editorial Team added an answer What I did was creating a c++ dll that I… May 11, 2026 at 10:08 pm

Related Questions

So, I've read that it is not a good idea to install VS2008 on
So I am writing a registration form and I need the display name to
So, I know that try/catch does add some overhead and therefore isn't a good
So, I am seeing a curious problem. If I have a function // counter
So, I am a total beginner in any kind of Windows related programming. I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.