NetBeans Forums

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

WSDL location woes

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Andrew Chandler
Posted via mailing list.





PostPosted: Mon Sep 22, 2008 3:23 pm    Post subject: WSDL location woes Reply with quote

Greetings folks – hopefully someone on here can give us a insight on what we’ve missed. We have a fairly complex JEE app using OpenESB – While using Netbeans to develop the web services we’re running into issues where netbeans is hardcoding a filepath to the WSDL which is wreaking havoc when we ttry to have more than one developer work on the project or deploy the ear outside netbeans.

Essentially we are doing the following:

Write a WSDL
Auto generate service an XSD’s from wsdl using netbeans
Implement service


<![if !supportLists]>- <![endif]>The problem seems to be that the generated service that netbeans provides doesn’t look for the WSDL in a resource path like in the META-INF but instead provides a hardcoded filesystem path – we need it to be either relative to the rest of the project or an http request so that more than one developer can work on this and so that it doesn’t have to only be built on a single developers box. This has us pulling out our hair here so any help is really appreciated.

PS. The Netbeans web services editors SOMETIMES lets us set an attribute on the service that allows us to specify an attribute for wsdllocation which allows us to do what we want, however it doesn’t seem to save the attribute when netbeans exits/renters it reverts back to default location – other times when we try to edit the attribute it just tells us that it must be auto generated.
Back to top
bramakumar
Posted via mailing list.





PostPosted: Mon Sep 22, 2008 3:43 pm    Post subject: WSDL location woes Reply with quote

This e-mail and any attachments are intended only for the individual or company to which it is addressed and may contain information which is privileged, confidential and prohibited from disclosure or unauthorized use under applicable law. If you are not the intended recipient of this e-mail, you are hereby notified that any use, dissemination, or copying of this e-mail or the information contained in this e-mail is strictly prohibited by the sender. If you have received this transmission in error, please return the material received to the sender and delete all copies from your system.
Back to top
Manuel Mall
Posted via mailing list.





PostPosted: Mon Sep 22, 2008 3:47 pm    Post subject: WSDL location woes Reply with quote

Andrew,

Assuming you use JAX-WS you could use XML catalogs to map locations. Put a file named jax-ws-catalog.xml into your META-INF directory. The file looks roughly:

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

<system systemId="the wsdllocation url in your generated file"
uri="a location relative to META-INF"/>
</catalog>

For example we have our wsdl's on deployment stored in META-INF/wsdl so it looks like:

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

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

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

....
</catalog>

I believe you can also use the JAX-WS API to set the wsdllocation at runtime overwriting the annotation but I don't have the details at hand.

Hope this helps

Manuel


From: Andrew Chandler [mailto:address-removed]
Sent: Monday, 22 September 2008 11:23 PM
To: address-removed
Subject: [nbusers] WSDL location woes


Greetings folks - hopefully someone on here can give us a insight on what we've missed. We have a fairly complex JEE app using OpenESB - While using Netbeans to develop the web services we're running into issues where netbeans is hardcoding a filepath to the WSDL which is wreaking havoc when we ttry to have more than one developer work on the project or deploy the ear outside netbeans.

Essentially we are doing the following:

Write a WSDL
Auto generate service an XSD's from wsdl using netbeans
Implement service


<![if !supportLists]>- <![endif]>The problem seems to be that the generated service that netbeans provides doesn't look for the WSDL in a resource path like in the META-INF but instead provides a hardcoded filesystem path - we need it to be either relative to the rest of the project or an http request so that more than one developer can work on this and so that it doesn't have to only be built on a single developers box. This has us pulling out our hair here so any help is really appreciated.

PS. The Netbeans web services editors SOMETIMES lets us set an attribute on the service that allows us to specify an attribute for wsdllocation which allows us to do what we want, however it doesn't seem to save the attribute when netbeans exits/renters it reverts back to default location - other times when we try to edit the attribute it just tells us that it must be auto generated.
Back to top
Andrew Chandler
Posted via mailing list.





PostPosted: Mon Sep 22, 2008 7:05 pm    Post subject: WSDL location woes Reply with quote

Hey thanks for the reply!

Yes we’re using jaxws – however if I’m understanding things correctly (we’ve done a lot of experimenting since I received your email) it doesn’t solve all the problems I’m trying to overcome


To be clear

We have 5 developers working on these things.

Dev 1 Project path
/home/andy/work/webserviceproject

Dev 2 Project path
/home/shawn/work/webserviceproject


(and so on)

Using your solution I could get a development environment properly with Dev1 and be fat dumb and happy and even build something that could be deployed to our test server. However if Dev 2 also has to work on these web services the part of the catalog
<system systemId="the wsdllocation url in your generated file" is wrong. Plus the generated sources are wrong because they still have /home/andy in them. Or something like that – it basically comes down to only one developer seems to be able to do this and it screws up as soon as we try to get multiple developers into things.


We also tried to add the wsdllocation attribute via the web services attribute editor and it yelled at us that it had to be set by the IDE –

HOWEVER if we hand edit the jaxws-build.xml to add the wsdllocation as a property at generation time then the generated code has a URI of META_INF/wsdl/something.wsdl in it and seems happy so far. The only thing we found is that every time we add a new web service the whole jaxws-build.xml gets regenerated so of course we loose our customization.


I guess our goal would be to create a netbeans or maven project that was self contained – in that all file references were relative to the root of the project and not absolute paths. Am I making any sense?



From: Manuel Mall [mailto:address-removed]
Sent: Monday, September 22, 2008 10:47 AM
To: 'address-removed'
Subject: RE: [nbusers] WSDL location woes



Andrew,

Assuming you use JAX-WS you could use XML catalogs to map locations. Put a file named jax-ws-catalog.xml into your META-INF directory. The file looks roughly:

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

<system systemId="the wsdllocation url in your generated file"
uri="a location relative to META-INF"/>
</catalog>

For example we have our wsdl's on deployment stored in META-INF/wsdl so it looks like:

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

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

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

....
</catalog>

I believe you can also use the JAX-WS API to set the wsdllocation at runtime overwriting the annotation but I don't have the details at hand.

Hope this helps

Manuel


From: Andrew Chandler [mailto:address-removed]
Sent: Monday, 22 September 2008 11:23 PM
To: address-removed
Subject: [nbusers] WSDL location woes


Greetings folks - hopefully someone on here can give us a insight on what we've missed. We have a fairly complex JEE app using OpenESB - While using Netbeans to develop the web services we're running into issues where netbeans is hardcoding a filepath to the WSDL which is wreaking havoc when we ttry to have more than one developer work on the project or deploy the ear outside netbeans.

Essentially we are doing the following:

Write a WSDL
Auto generate service an XSD's from wsdl using netbeans
Implement service


<![if !supportLists]>- <![endif]>The problem seems to be that the generated service that netbeans provides doesn't look for the WSDL in a resource path like in the META-INF but instead provides a hardcoded filesystem path - we need it to be either relative to the rest of the project or an http request so that more than one developer can work on this and so that it doesn't have to only be built on a single developers box. This has us pulling out our hair here so any help is really appreciated.

PS. The Netbeans web services editors SOMETIMES lets us set an attribute on the service that allows us to specify an attribute for wsdllocation which allows us to do what we want, however it doesn't seem to save the attribute when netbeans exits/renters it reverts back to default location - other times when we try to edit the attribute it just tells us that it must be auto generated.


--
This message has been scanned for viruses and
dangerous content by [/b]MailScanner[b], and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Back to top
Manuel Mall
Posted via mailing list.





PostPosted: Tue Sep 23, 2008 11:20 am    Post subject: WSDL location woes Reply with quote

Hi,

Makes perfect sense to me what you are saying and I don't have a solution for you. However, I can describe what we are doing which of course may not work for you.

<![if !supportLists]>1) <![endif]>In a project where we develop the server end and the client end we simply deploy the annotated classes to Glassfish and then generate the client stubs by pointing to the local Glassfish installation. This means all wsdl's have the same address for all developers http://localhost:8080/...?wsdl as they all would have a local Glassfish install.
<![if !supportLists]>2) <![endif]>In the case where we need to work from a hand written WSDL for client development we use a custom ant script (initially derived from jaxws-build.xml). The script can set the wsdllocation to be put into the generated sources to a standard value.

Cheers


From: Andrew Chandler [mailto:address-removed]
Sent: Tuesday, 23 September 2008 3:04 AM
To: address-removed
Cc: Shawn McDermott
Subject: RE: [nbusers] WSDL location woes


Hey thanks for the reply!

Yes we're using jaxws - however if I'm understanding things correctly (we've done a lot of experimenting since I received your email) it doesn't solve all the problems I'm trying to overcome


To be clear

We have 5 developers working on these things.

Dev 1 Project path
/home/andy/work/webserviceproject

Dev 2 Project path
/home/shawn/work/webserviceproject


(and so on)

Using your solution I could get a development environment properly with Dev1 and be fat dumb and happy and even build something that could be deployed to our test server. However if Dev 2 also has to work on these web services the part of the catalog
<system systemId="the wsdllocation url in your generated file" is wrong. Plus the generated sources are wrong because they still have /home/andy in them. Or something like that - it basically comes down to only one developer seems to be able to do this and it screws up as soon as we try to get multiple developers into things.


We also tried to add the wsdllocation attribute via the web services attribute editor and it yelled at us that it had to be set by the IDE -

HOWEVER if we hand edit the jaxws-build.xml to add the wsdllocation as a property at generation time then the generated code has a URI of META_INF/wsdl/something.wsdl in it and seems happy so far. The only thing we found is that every time we add a new web service the whole jaxws-build.xml gets regenerated so of course we loose our customization.


I guess our goal would be to create a netbeans or maven project that was self contained - in that all file references were relative to the root of the project and not absolute paths. Am I making any sense?



From: Manuel Mall [mailto:address-removed]
Sent: Monday, September 22, 2008 10:47 AM
To: 'address-removed'
Subject: RE: [nbusers] WSDL location woes



Andrew,

Assuming you use JAX-WS you could use XML catalogs to map locations. Put a file named jax-ws-catalog.xml into your META-INF directory. The file looks roughly:

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

<system systemId="the wsdllocation url in your generated file"
uri="a location relative to META-INF"/>
</catalog>

For example we have our wsdl's on deployment stored in META-INF/wsdl so it looks like:

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

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

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

....
</catalog>

I believe you can also use the JAX-WS API to set the wsdllocation at runtime overwriting the annotation but I don't have the details at hand.

Hope this helps

Manuel


From: Andrew Chandler [mailto:address-removed]
Sent: Monday, 22 September 2008 11:23 PM
To: address-removed
Subject: [nbusers] WSDL location woes


Greetings folks - hopefully someone on here can give us a insight on what we've missed. We have a fairly complex JEE app using OpenESB - While using Netbeans to develop the web services we're running into issues where netbeans is hardcoding a filepath to the WSDL which is wreaking havoc when we ttry to have more than one developer work on the project or deploy the ear outside netbeans.

Essentially we are doing the following:

Write a WSDL
Auto generate service an XSD's from wsdl using netbeans
Implement service


<![if !supportLists]>- <![endif]>The problem seems to be that the generated service that netbeans provides doesn't look for the WSDL in a resource path like in the META-INF but instead provides a hardcoded filesystem path - we need it to be either relative to the rest of the project or an http request so that more than one developer can work on this and so that it doesn't have to only be built on a single developers box. This has us pulling out our hair here so any help is really appreciated.

PS. The Netbeans web services editors SOMETIMES lets us set an attribute on the service that allows us to specify an attribute for wsdllocation which allows us to do what we want, however it doesn't seem to save the attribute when netbeans exits/renters it reverts back to default location - other times when we try to edit the attribute it just tells us that it must be auto generated.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Back to top
pitonyak



Joined: 25 Sep 2008
Posts: 7
Location: Columbus, Ohio

PostPosted: Thu Sep 25, 2008 7:31 pm    Post subject: Reply with quote

I used the following test code, but I was not using jax-ws
Code:
        try { // Call Web Service Operation
            org.me.calculator.CalculatorWSService service = new org.me.calculator.CalculatorWSService();
            org.me.calculator.CalculatorWS port = service.getCalculatorWSPort();
            int i = 3;
            int j = -10;
            int result = port.add(i, j);
            System.out.println("Result (" + i + ", " + j + ") = " + result);
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }

        try { // Call Web Service Operation
            java.net.URL wsdlURL = new URL("http://localhost:8080/CalculatorWSApplication/CalculatorWSService?WSDL");
            javax.xml.namespace.QName qName = new QName("http://calculator.me.org/", "CalculatorWSService");
            org.me.calculator.CalculatorWSService service = new org.me.calculator.CalculatorWSService(wsdlURL, qName);
            org.me.calculator.CalculatorWS port = service.getCalculatorWSPort();
            int i = 3;
            int j = 7;
            int result = port.add(i, j);
            System.out.println("Result (" + i + ", " + j + ") = " + result);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        try { // Call Web Service Operation
            java.net.URL wsdlURL = new URL("http://localhost:8787/CalculatorWSApplication/CalculatorWSService?WSDL");
            javax.xml.namespace.QName qName = new QName("http://calculator.me.org/", "CalculatorWSService");
            org.me.calculator.CalculatorWSService service = new org.me.calculator.CalculatorWSService(wsdlURL, qName);
            org.me.calculator.CalculatorWS port = service.getCalculatorWSPort();
            int i = 13;
            int j = 17;
            int result = port.add(i, j);
            System.out.println("Result (" + i + ", " + j + ") = " + result);
        } catch (Exception ex) {
            ex.printStackTrace();
        }


The first set, uses the default. I then call the web service on two different servers (they are on different ports).
Back to top
thorty.w



Joined: 08 Jan 2010
Posts: 4

PostPosted: Fri Jan 08, 2010 8:49 am    Post subject: Reply with quote

An other answer is to Ue another Constructor for the Service Object:

myService myservice = new myService(wsdllocation, servicename ); to get the Service Object.



This is how I solved the problem.

Greetz from Germany
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
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