Client generated by wsimport not using WS-Addressing when connecting to WCF

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Client generated by wsimport not using WS-Addressing when connecting to WCF

metro-3
I'm creating a web service client in NetBeans 6.5.1 that consumes a WCF web service using the wsHttpBinding binding. It looks like NetBeans 6.5.1 ships with JAX-WS RI 2.1.4. I add the web service to my project in NetBeans (which I'm assuming runs wsimport to create the proxy) and then I drag the method name from the web service reference to my code window which generates the code to make the call. What happens is the client hangs when it makes the soap call. I've examined the soap envelope that is sent by JAX-WS and its missing the WS-Addressing headers. I've checked the WSDL generated by WCF and it includes the <wsaw:UsingAddressing /> element in the policy so I'm assuming that wsimport should see this and configure the proxy to use WS-Addressing. I created a second endpoint on my WCF service that *does not* use WS-Addressing and it connects fine (Actually, it errors out because there are no WS-Security headers set but thats ok for now. One step at a time...) so I'm sure it the lack of the WS-Addressing headers thats causing it to hang.

Here is the url to the WSDL:
https://services.reachmail.net/Prototype/System.svc?wsdl

Here is the code that makes the call:

reachmail.SystemService service = new reachmail.SystemService();
reachmail.Sys port = service.getReachmailSystem();

// Here is where it hangs...
reachmail.VersionInfo result = port.getVersion();

I'm a complete noob when it comes to Java so I apologize in advance for my ignorance. I have seen other posts out there describing this exact same problem but no resolution. Is there something I'm missing here? Is there something that needs to be configured on the client side? Do I need a newer version of something or do I need to install an additional library? I have been googling for days now, investigating any lead I could find and have turned up nothing.

TIA,

m
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=342174

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to WCF

metro-3
You need to have Metro instead of just JAX-WS:

https://metro.dev.java.net/

https://metro.dev.java.net/servlets/ProjectDocumentList?folderID=11086&expandFolder=11086&folderID=10314
[Message sent by forum member 'jdg6688' (jdg6688)]

http://forums.java.net/jive/thread.jspa?messageID=342182

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
jdg6688,

Thanks for your reply. I've spent the better part of the day trying to get Metro installed with NetBeans 6.5.1. I can install the Metro package into a folder (Simple enough) but I'm having a hard time figuring out how to integrate it with the NetBeans 6.5.1 IDE. I've also tried installing GlassFish and then going to the update manager and downloading Metro, but I still run into the same issue, not sure how to integrate it.

On another note, I noticed that GlassFish v3 is installed as a plugin in NetBeans 6.5.1 and if you display all plugins (Including hidden ones) there are two WSIT plugins installed (Which I thought was what was needed from the Metro dist to interop with WCF). Could Metro be installed via plugin as well?

Do you know where I can find a tutorial or some resource that explains how to install Metro so that its integrated with NetBeans 6.5.1?

Again, I apologize for my ignorance. I'm a .NET developer building internet facing WCF services and am trying to verify that they are interopable with a couple of Java SOAP stacks and IDE's. I'm also trying to put together some tutorials that step a Java developer through configuration of a client that can call our web API. It's been a little challenging... :)

Thanks again,

m

PS: I'm using the Windows version of the NetBeans IDE, not sure if that makes any difference.
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=342344

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
Oh, and one more thing (I completely forgot to mention this). When wsimport runs it spits out the following warning (I included the surrounding lines for context):

wsimport-client-TimeService:
D:\Temp\JavaApplication2\build\generated\wsimport\client\org\tempuri is not found and thus excluded from the dependency check
command line: wsimport -d D:\Temp\JavaApplication2\build\generated\wsimport\client -extension -Xnocompile -keep -s D:\Temp\JavaApplication2\build\generated\wsimport\client -catalog D:\Temp\JavaApplication2\catalog.xml -verbose D:\Temp\JavaApplication2\xml-resources\web-service-references\TimeService\wsdl\hal\Time\TimeService.svc.wsdl -wsdllocation http://hal/Time/TimeService.svc?wsdl
parsing WSDL...


[WARNING] SOAP port "WSHttpBinding_ITimeService": uses a non-standard SOAP 1.2 binding.
  line 1 of file:/D:/Temp/JavaApplication2/xml-resources/web-service-references/TimeService/wsdl/hal/Time/TimeService.svc.wsdl

generating code...

org\tempuri\GetTime.java
org\tempuri\GetTimeResponse.java
org\tempuri\ITimeService.java
org\tempuri\ObjectFactory.java
org\tempuri\TimeService.java
org\tempuri\package-info.java
com\microsoft\schemas\_2003\_10\serialization\ObjectFactory.java
wsimport-client-generate:

I created a dummy WCF time service that just returns a string with the time and I get the same behavior when I use the WCF wsHttpBinding but it works fine if I use the basicHttpBinding.
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=342345

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
Ok, figured it out. You have to pass an instance of the AddressingFeature class into the port factory method. For example:

import javax.xml.ws.soap.*;
...
client.TestService service = new client.TestService();
client.test port =
        service.getTest(new AddressingFeature(true, true));
// TODO process result here
string result = port.doSomething();
System.out.println("Result = "+result);

I'm surprised that no one was able to answer this question since it seems that this would be a common thing. I'm wondering if there is an issue either on the .NET side or the wsimport side where the UsingAddressing policy is not recognized or communicated correctly. I would think that wsimport would see that and automatically configure the proxy to use WS-Addressing, not requiring the developer to do it manually.

More about this class:
http://java.sun.com/javase/6/docs/api/javax/xml/ws/soap/AddressingFeature.html

Anyways, thanks to those who posted a response.

m
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=342615

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
UsingAddressing extension is replaced by wsam:Addressing policy in WS-Adressing Metdata specification. If you use metro(not JAX-WS RI), it should have configured the port with addressing.

In JAX-WS 2.2 onwards, you don't have to specify AddressingFeature to enable addressing if the WSDL already contains wsam:Addressing policy.
[Message sent by forum member 'jitu' (jitu)]

http://forums.java.net/jive/thread.jspa?messageID=343310

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
That makes sense. I'm also now  have a problem where wsimport is not configuring the proxy to use WS-Security even though the policy in my WSDL specifies it must be used. Sounds like its all the same problem.

Well the bigger issue I am having is how to install Metro so that it is referenced by NetBeans. I'm creating a sample NetBeans project that accesses our web service API and I cant seem to figure out how to plug Metro into the NetBeans environment. Are there any tutiorals or documents out there that show how this can be done? I've been looking high and low and have not found anything.

TIA,

m

Message was edited by: michaelobrien
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=343318

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to WCF

metro-3
In reply to this post by metro-3
I guess this is not resolved. See above...
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=343319

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to WCF

metro-3
Is this what you're looking for, Michael?

https://jax-ws.dev.java.net/guide/index.html#wsit_tutorial
[Message sent by forum member 'robmacgrogan' (robmacgrogan)]

http://forums.java.net/jive/thread.jspa?messageID=343446

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
Yeah, I've looked all over the Metro site. The only type of installation instructions I can find are using the GlassFish Update Tool (https://metro.dev.java.net/nonav/1.4/docs/install.html). GlassFish 3 Prelude is installed in NetBeans as a plugin but I don't think the GlassFish Update Tool is (At least I cant find it anyways). It looks like just the GlassFish jar's are installed. When you install GlassFish manually the update tool is there but the GlassFish installation is not wired into the NetBeans IDE.

So I guess my question is, if your developing in NetBeans and want to install Metro how do you do it? You can install GlassFish 3 Prelude as a NetBeans plugin, but does this mean Metro is then installed too (It really doesn't look like it)? And I cant seem to find any manual installation instructions anywhere.

Thanks,

m
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=343451

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
I think this may work. These are the manual steps to install metro and configure NB to use that
Take latest metro from metro.dev.java.net (Maybe you can take the latest metro 1.5)
If you are using Glassfish v2(or 2.1) then it is easy to install metro on top of it
Just copy metro's webservices-rt and webservices-tools.jar to AS/lib
Next in NB click Tools->Server-> Add Server
and add this new GF v2 server
Now you can develop and deploy on this server.

Let me know if that helps.
Regards,
Bhakti
[Message sent by forum member 'bhaktimehta' (bhaktimehta)]

http://forums.java.net/jive/thread.jspa?messageID=343458

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
I downloaded Metro 1.5, unpacked it and referenced it in my project and still no dice. I'm not doing a sever project, just a simple Swing app that consumes a service.
[Message sent by forum member 'michaelobrien' (michaelobrien)]

http://forums.java.net/jive/thread.jspa?messageID=344879

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Client generated by wsimport not using WS-Addressing when connecting to

metro-3
In reply to this post by metro-3
Hello
Referencing metro libraries ahead of JDK1.6 worked for me. Here is the environment info
-----------------------------
NetBeans 6.7.1
Metro 2.0EA
-----------------------------
I did the following
File | New Project | Java | Java Application
Project | Properties | Libraries | Compile
- Here I added the jars in metro 2.0EA/lib folder.
Add a web services client from WSDL (usual way)
Run the client.

You will get this kind of info on console

run-single:
Sep 23, 2009 7:52:48 PM [com.sun.xml.ws.assembler.MetroConfigLoader]  <init>
INFO: Default metro-default.xml configuration file located at: 'jar:file:/D:/svn/WCFTest/lib/webservices-rt.jar ................

I create the port w/o using AddressingFeature

 org.tempuri.EchoService service = new org.tempuri.EchoService();
 org.tempuri.IEcho port = service.getWSHttpBindingIEcho();

I have verified the client against a WCF service that uses reliable sessions also.

HTH

-rajeev.
[Message sent by forum member 'rjha94' ([hidden email])]

http://forums.java.net/jive/thread.jspa?messageID=365319

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]