NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
hexghost



Joined: 15 Jan 2009
Posts: 3

PostPosted: Thu Jan 15, 2009 5:58 pm    Post subject: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

Hello,

I have a web service client project I've created in Netbeans. It has been working fine. I just recently upgraded to NB6.5 and then went to make some changes to the project. When I deployed the application, I'm getting errors about a file not found, relating to the WSDL.

Tracing through, I found that it appears NB6.5 is hardcoding the path to the local copy of the WSDL file inside the Service class it makes for the web service.

Here's what I'm talking about, in the auto-created Service class:
Quote:

@WebServiceClient(name = "Service", targetNamespace = "http://test.com/webservice/KISalesMarketing", wsdlLocation = "file:/Users/ghost/projects/LeadsSubmitter/src/conf/xml-resources/web-service-references/Service.asmx/wsdl/www.test.com/KISalesAndMarketing/Service.asmx.wsdl")
public class Service
extends javax.xml.ws.Service


As you can see, it hardcoded my local path for the WSDL file. It's also hardcoded a few lines into the class:
Quote:

static {
URL url = null;
try {
URL baseUrl;
baseUrl = com.test.landings.ws.client.Service.class.getResource(".");
url = new URL(baseUrl, "file:/Users/ghost/projects/LeadsSubmitter/src/conf/xml-resources/web-service-references/Service.asmx/wsdl/www.test.com/KISalesAndMarketing/Service.asmx.wsdl");
} catch (MalformedURLException e) {
logger.warning("Failed to create URL for the wsdl Location: 'file:/Users/ghost/projects/LeadsSubmitter/src/conf/xml-resources/web-service-references/Service.asmx/wsdl/www.test.com/KISalesAndMarketing/Service.asmx.wsdl', retrying as a local file");
logger.warning(e.getMessage());
}


This of course is causing my application to fail to work when I deploy it to production, since the paths are not the same.

So, two questions:

1. Why the #$^@ is Netbeans hardcoding a path like this
2. How do I stop it from doing it, or fix it


I appreciate any help on this - it definitely wasn't happening in earlier versions so I can only assume something changed in 6.5


[/quote]
Back to top
mkuchtiak



Joined: 16 Jan 2009
Posts: 1

PostPosted: Fri Jan 16, 2009 9:43 am    Post subject: Reply with quote

Yes, that's known issue.
The workaround is to use jax-ws-catalog.xml, which maps remote resources to local files(located in project),

Example:

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
<system systemId="http://www.webservicex.net/BibleWebservice.asmx?wsdl"
uri="wsdl/www.webservicex.net/BibleWebservice.asmx.wsdl"/>
<system systemId="http://www.webservicex.net/globalweather.asmx?wsdl"
uri="wsdl/www.webservicex.net/globalweather.asmx.wsdl"/>
<system systemId="file:/space/home/mkuchtiak/Documents/wsdl/AddNumbers_org.wsdl" uri="wsdl/AddNumbers_org.wsdl"/>
<system systemId="file:/space/home/mkuchtiak/Documents/wsdl/CurrencyConvertor.asmx"
uri="wsdl/CurrencyConvertor.asmx.wsdl"/>
</catalog>

The jax-ws-catalog.xml must be located in WEB-INF(META-INF) folder and local resources are referenced relatively to this
location.

Thank You for pointing at this problem again.
Hopefully, this will be fixed in next release.

See also the enhancement:
http://www.netbeans.org/issues/show_bug.cgi?id=149790
Back to top
hexghost



Joined: 15 Jan 2009
Posts: 3

PostPosted: Fri Jan 16, 2009 5:51 pm    Post subject: Reply with quote

mkuchtiak,


Thanks for the response. I sure hope this gets fixed sooner than next release, unless that next release is in a month. This bug has broken a big feature of netbeans - web service client development. I'd wonder why you can't just go back to the NB6.1 code, since that worked fine.

For anyone else out there landing on this thread, I found some resources of Google that describe how to use jax-ws-catalog.xml that might help if you're lost on making the file (like I am):

https://jax-ws.dev.java.net/guide/Developing_client_application_with_locally_packaged_WSDL.html

http://weblogs.java.net/blog/vivekp/archive/2007/06/index.html
Back to top
hexghost



Joined: 15 Jan 2009
Posts: 3

PostPosted: Fri Jan 16, 2009 6:44 pm    Post subject: Reply with quote

mkuchtiak,


Could you provide more info on how to get the jax-ws-catalog file to work? Even if I include it in META-INF/, whenever I build the project netbeans just overwrites my changes in the generated Service class.
Back to top
Spiny



Joined: 04 Apr 2009
Posts: 2

PostPosted: Sat Apr 04, 2009 11:15 pm    Post subject: Reply with quote

hexghost

    1. Make a "wsdl" folder under your WEB-INF
    2. Place yourservice.wsdl in WEB-INF/wsdl
    3. Place jax-ws-catalog.xml in WEB-INF containing:


Code:

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">
    <system systemId="file:/yourdevpath/yourservice.wsdl" uri="wsdl/yourservice.wsdl"/>
</catalog>


However, this won't fix your .class file. It's a workaround so that the thing hangs together at runtime.

It's also not very portable, a <system> tag would be needed for every different developer who works on the project, if they all have a different working directory for the project (yourdevpath)

Netbeans needs a fix really.
Back to top
Melongo Annabel
Posted via mailing list.





PostPosted: Sun Apr 05, 2009 11:19 pm    Post subject: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

Bri,
Can you please file an entry for this at: http://www.netbeans.org/issues
If it's your first time using the system, you should first register. While filing the issue, make sure you include the NB version, the jdk and the OS. After that, comes to this mailing list and paste that issue's link to have people vote for it. The number of votes will set the priority of its implementation.
Thanks




From: Spiny <address-removed>
To: address-removed
Sent: Saturday, April 4, 2009 6:15:44 PM
Subject: [nbj2ee] NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors

hexghost



1. Make a "wsdl" folder under your META-INF

2. Place yourservice.wsdl in META-INF/wsdl

3. Place jax-ws-catalog.xml in META-INF containing:




Code:


<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">

<system systemId="file:/yourdevpath/yourservice.wsdl" uri="wsdl/yourservice.wsdl"/>

</catalog>







However, this won't fix your .class file. It's a workaround so that the thing hangs together at runtime.



It's also not very portable, a <system> tag would be needed for every different developer who works on the project, if they all have a different working directory for the project (yourdevpath)



Netbeans needs a fix really.
Back to top
mkuchtiak
Posted via mailing list.





PostPosted: Mon Apr 06, 2009 7:50 am    Post subject: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

Netbeans 6.7 implemented jax-ws-catalog.xml functionality.
Now, the wsdl file, referenced in WS Client wizard, is downloaded to
META-INF/wsdl and jax-ws-catalog.xml is created in META-INF directory.

Milan

Spiny wrote:
Quote:
hexghost



1. Make a "wsdl" folder under your META-INF

2. Place yourservice.wsdl in META-INF/wsdl

3. Place jax-ws-catalog.xml in META-INF containing:




Code:


<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">

<system systemId="file:/yourdevpath/yourservice.wsdl" uri="wsdl/yourservice.wsdl"/>

</catalog>







However, this won't fix your .class file. It's a workaround so that the thing hangs together at runtime.



It's also not very portable, a <system> tag would be needed for every different developer who works on the project, if they all have a different working directory for the project (yourdevpath)



Netbeans needs a fix really.




Back to top
itreppert



Joined: 23 Dec 2008
Posts: 45

PostPosted: Wed Apr 08, 2009 4:06 pm    Post subject: Re: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

mkuchtiak wrote:
Netbeans 6.7 implemented jax-ws-catalog.xml functionality.
Now, the wsdl file, referenced in WS Client wizard, is downloaded to
META-INF/wsdl and jax-ws-catalog.xml is created in META-INF directory.

Milan


That's ยง$%&/ fine !
Because I work with IceFaces, and IceFaces doesn't work with NB6.7 .
Isn't there a posibility to fix NB 6.5 or the 'new' release NB 6.5.1 to NB 6.5.1.1 ????
Shouldn't be such a problem. Because it makes me crazy to copy the wsdl xsd after every change of the webservice to another location.......
Back to top
juriglx



Joined: 10 Jul 2009
Posts: 4

PostPosted: Fri Jul 10, 2009 11:00 am    Post subject: Re: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

mkuchtiak wrote:
Netbeans 6.7 implemented jax-ws-catalog.xml functionality.
Now, the wsdl file, referenced in WS Client wizard, is downloaded to
META-INF/wsdl and jax-ws-catalog.xml is created in META-INF directory.

Milan

Spiny wrote:
Quote:
hexghost



1. Make a "wsdl" folder under your META-INF

2. Place yourservice.wsdl in META-INF/wsdl

3. Place jax-ws-catalog.xml in META-INF containing:




Code:


<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="system">

<system systemId="file:/yourdevpath/yourservice.wsdl" uri="wsdl/yourservice.wsdl"/>

</catalog>







However, this won't fix your .class file. It's a workaround so that the thing hangs together at runtime.



It's also not very portable, a <system> tag would be needed for every different developer who works on the project, if they all have a different working directory for the project (yourdevpath)



Netbeans needs a fix really.






Hm, I am using Netbeans 6.7 on MacOSX (dev) and want to deploy a WAR to a unix machine (production).
Although there is a jax-ws-catalog.xml in WEB-INF pointing to the wsdl in WEB-INF/wsdl, I get the this "no such file or directory" error on the unix machine because the local path from my dev box is used.

This jax-ws-catalog.xml in WEB-INF is generated by Netbeans and so I copied the jax-ws-catalog.xml and the wsdl directory to META-INF (proposed here) and it didn't work either.

What should I do?
Back to top
christianoliveira



Joined: 14 Jul 2009
Posts: 1

PostPosted: Tue Jul 14, 2009 10:23 am    Post subject: Reply with quote

Hello! I'm going crazy with this thing, we are four people developing a project using WSDL and we are not able to compile the solution to a war and make it work under linux, because of the hardcoding. I'm trying the workaround of use the jax-ws-catalog but it doesn't work properly.

Any idea?
Back to top
juriglx



Joined: 10 Jul 2009
Posts: 4

PostPosted: Tue Jul 14, 2009 10:27 am    Post subject: Reply with quote

I couldn't solve this problem so I uploaded the wsdl on a server. Now it works Smile
Back to top
michael
Posted via mailing list.





PostPosted: Tue Jul 14, 2009 11:45 am    Post subject: NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors Reply with quote

I once used the wsimport task manually, and added the created code to the project (in the normal fashion).
There must be a better way, though :-)

Michael

-----Original Message-----
From: christianoliveira [mailto:address-removed]
Sent: Tuesday, July 14, 2009 1:24 PM
To: address-removed
Subject: [nbj2ee] NB6.5 Web Services: NB is hardcoding path to WSDL, causing errors


Hello! I'm going crazy with this thing, we are four people developing a project using WSDL and we are not able to compile the solution to a war and make it work under linux, because of the hardcoding. I'm trying the workaround of use the jax-ws-catalog but it doesn't work properly.



Any idea?
Back to top
KevinE



Joined: 19 Oct 2009
Posts: 4

PostPosted: Mon Oct 19, 2009 11:11 pm    Post subject: local wsdl errors Reply with quote

christianoliveira wrote:
Hello! I'm going crazy with this thing, we are four people developing a project using WSDL and we are not able to compile the solution to a war and make it work under linux, because of the hardcoding. I'm trying the workaround of use the jax-ws-catalog but it doesn't work properly.

Any idea?


I'm having the same issue with 6.7.1 is there not a setting to tell netbeans to reference the wsdl from the project instead of the hard coded path to my hard drive? I played around with the catalog but I'm probably not setting the path correctly. I just started learning webservices and using netbeans. Any help would be appreciated.
Back to top
KevinE



Joined: 19 Oct 2009
Posts: 4

PostPosted: Wed Oct 28, 2009 2:14 pm    Post subject: Re: local wsdl errors Reply with quote

[quote="KevinE"]
christianoliveira wrote:
Hello! I'm going crazy with this thing, we are four people developing a project using WSDL and we are not able to compile the solution to a war and make it work under linux, because of the hardcoding. I'm trying the workaround of use the jax-ws-catalog but it doesn't work properly.

Any idea?



I messed around with the catalog setting for an entire day. I moved the wsdl folder to both meta-inf and web-inf, then meta-inf exclusively, then web-inf exclusively. None of the settings seemed to work. I located a jaxws-build.xml file that had a hard coded wsdl location property set. I'm not an ant guy so I'm not sure what the means exactly. I do know that the catalog changes that were suggested do not work. 6.8 beta is available. I'll try that out and post back.
Back to top
KevinE



Joined: 19 Oct 2009
Posts: 4

PostPosted: Wed Oct 28, 2009 5:22 pm    Post subject: Re: local wsdl errors Reply with quote

[quote="KevinE"
I messed around with the catalog setting for an entire day. I moved the wsdl folder to both meta-inf and web-inf, then meta-inf exclusively, then web-inf exclusively. None of the settings seemed to work. I located a jaxws-build.xml file that had a hard coded wsdl location property set. I'm not an ant guy so I'm not sure what the means exactly. I do know that the catalog changes that were suggested do not work. 6.8 beta is available. I'll try that out and post back.[/quote]


6.8 beta does not grey out (disable) the package text box. If you put in a package name you will get an error.

Web Service Client can not be created by JAXWS:wsimport utility
...
...
...

Alas, 6.8 has the same issue with hardcoding the wsdl path. lovely.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo