This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 104470 - Generated code has compilation errors.
Summary: Generated code has compilation errors.
Status: RESOLVED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: Client (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-22 05:25 UTC by pcmreddy
Modified: 2008-03-12 16:21 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
error (545.67 KB, image/jpeg)
2007-05-22 05:26 UTC, pcmreddy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pcmreddy 2007-05-22 05:25:51 UTC
Build : NetBeans IDE Dev (Build 070518)
1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
Windows XP version 5.1 running on x86
en_US (nb); Cp1252

How to reproduce.
Create a webapplication.
Add Webservice clients using the following WSDLs
http://wsparam.strikeiron.com/ZipInfo3?WSDL and
http://wsparam.strikeiron.com/emailverify_3_0?WSDL

Now goto index.jsp and add webservice cleints.
This services requres to supply userid and passwd.

Generated code does not allow user to add this information.

Looks like generated client code has some problems.
When I checked the generated client java files I found code error in the
following metod.


@WebEndpoint(name = "EmailVerificationSoap")
    public EmailVerificationSoap getEmailVerificationSoap(WebServiceFeature...
features) {
        return (EmailVerificationSoap)super.getPort(new
QName("http://www.strikeiron.com", "EmailVerificationSoap"),
EmailVerificationSoap.class, features);
    }

Pl. see attached screen capture for error details.

Client for ZIPinfo also has the same error at the same location.
Comment 1 pcmreddy 2007-05-22 05:26:47 UTC
Created attachment 42630 [details]
error
Comment 2 pcmreddy 2007-05-22 05:40:55 UTC
In another attempt reproduce this issue:
Now no webservice client java files are generated.
Comment 3 Lukas Jungmann 2007-05-22 13:21:43 UTC
> Now no webservice client java files are generated.

dup of issue 102203? Probably also a cause of the problems in generated code

> Generated code does not allow user to add this information.

http://www.strikeiron.com/info/faqs_wsa.aspx#wsa1 seems to be out of date since
in the WSDLs there's no LicenseInfo operation. It has been replaced by header 
in a SOAP message.

Following code shows how to add header to the request (Note: this is JAX-WS RI
specific):

            email.EmailVerificationSoap port = service.getEmailVerificationSoap();

            email.LicenseInfo li = new email.LicenseInfo();
            email.UnregisteredUser uu = new email.UnregisteredUser();
            uu.setEmailAddress("requestor's email");
            li.setUnregisteredUser(uu);
            ((WSBindingProvider) port).setOutboundHeaders(new
email.ObjectFactory().createLicenseInfo(li));

            String email = "some email";
            boolean checkAllServers = false;
            email.ValidateEmailResult result = port.validateEmail(email,
checkAllServers);
            out.println("Result = "+result);

To call this service from JAX-WS also copy generated LicenseInfo class to source
packages and add @XmlRootElement(namespace="http://ws.strikeiron.com") on top of
the class.
Comment 4 Lukas Jungmann 2007-05-25 12:23:33 UTC
To clean this issue a bit:

The WSDL on the given URL has been changed recently and the code generated now
is better (but see issue 104830).

The part with not providing ability to set username and password in generated
code is still valid and it is tracked within issue 104550. Thanks for moving
this part there!

The issue with no generated classes is tracked within issue 102203 (already P1)
since I believe it's the same problem.

Downgrading this to P3 and leaving this open to track the last part of this
report - the error shown in attached screenshot.

Milan, I think that the problem is that the "build/generated/client/" source
root does not have JAX-WS 2.1.x jars on its internal classpath (this might be
valid also for the ws from wsdl case - "build/generated/service" source root).
Comment 5 Milan Kuchtiak 2007-10-01 16:26:20 UTC
Right, likely, we should add jax-ws jars regardless running on JDK1.5 or JDK1.6
Comment 6 Lukas Jungmann 2008-03-12 16:21:41 UTC
Should be already fixed. Please file new issue if you find reproducible test case and include NB and JDK version numbers
in the report.

Thanks.