How to make Web service use TCP transport with JAX-WS

SOAP/TCP right now is the part of WSIT project, but it's also possible to use it with clear JAX-WS framework.
There are lots of places, which should be improved, however nothing could stop us using it right now :)
Several steps, especially for the server side, are similar or even same to WSIT ones, however the client side configuration is completely different.

So, "how to deploy web service to Glassfish and make it reachable via SOAP/TCP?".
  1. JavaEE 5 or JSR109 WS deployment.
    Actually all Web services deployed to Glassfish using this deployment method become TCP transport enabled. They are automatically registered on SOAP/TCP listener and ready to process.
    \*One known issue with JavaEE 5 deployment of WS is: if WS is being deployed to a Web container - then it is required for this WS to have the descriptor web.xml, where it will be specified to load on startup. In this case the SOAP/TCP listener will get to know about this web service.

  2. Servlet deployment.
    For this deployment type, things are not much different. In this case one more servlet context listener should be added to a web service's (web appliction's) web.xml file [1].
    And the servlet should be set to load on startup. Otherwise the SOAP/TCP listener will not be aware know about Web Service, until WSStartupServlet will not be started.  

"How to make client to choose SOAP/TCP as transport to work with web service?"

We need to configure JAX-WS client to be aware of SOAP/TCP transport. For that reason, we have to provide following service provider file [2], located on client classpath, and contain line [3] in it.
Web service WSDL file, which is provided to a client, should contain Web service endpoint address (/definitions/service/port/soap:address@location) with SOAP/TCP specific protocol schema [4]. Only in that case SOAP/TCP transport pipe will be attached and used for sending/receiving SOAP messages. Currently server side WSDL generation doesn't support protocol schema changing for SOAP/TCP, so this change should be made manually.


[1] <listener-class>com.sun.xml.ws.transport.tcp.server.glassfish.WSStartupServlet</listener-class>
[2]  META-INF/services/com.sun.xml.ws.api.pipe.TransportPipeFactory
[3]  com.sun.xml.ws.transport.tcp.client.TCPTransportPipeFactory
[4]  vnd.sun.ws.tcp
Comments:

I am trying to make a call from a java client to a C# server using the soap.tcp://localhost:111 URI but cannot get the dispatch to complete the call... I am wondering if the comment about how to enable a client to send and receive soap over tcp is related to my problem Thanks.

Posted by Kacem Boufelliga on June 17, 2007 at 12:24 AM CEST #

Hello,
1) just want to make sure... Are you using WSIT or JAX-WS RI?
2) default MS C# implementation doesn't have SOAP/TCP support. MS has own WS tcp protocol implementation.
3) Company Noemax [1] is completing C# SOAP/TCP implementation for .Net. Trial version should be available very soon. On Noemax forum you can get more details about that.
[1] http://www.noemax.com/

Posted by guest on June 18, 2007 at 04:02 AM CEST #

I am using JAX-WS RI. I am now experimenting with WSIT and Grizzly. The soap/tcp on the C#.Net side works fine using SoapReciever and SoapSender. It is in the java side that I am having problems when using the soap.tcp protocol scheme instead of http.

Posted by Kacem Boufelliga on June 18, 2007 at 09:54 AM CEST #

By SOAP/TCP C# side, do you mean Noemax implementation? Because default C# TCP transport is not SOAP/TCP.

Posted by oleksiys on June 20, 2007 at 12:16 PM CEST #

Let me clarify! The server is written with MS Visual Studio in C#.NET. It uses SoapReceiver and SoapSender (meaning it is does not have a wsdl or webmethod so only tcp communication not http) and implements a basic Publisher/Subscribe pattern with events. It is also using WSE 3.0 and Soap 1.1. I am working on having a java client to subscribe to the C#.Net Publisher. I don't know abything about Noemax. I believe someone misunderstood the problem and gave a wrong reference to Noemax!

Posted by Kacem Boufelliga on June 20, 2007 at 12:48 PM CEST #

Think I understand the problem, may be problem is in its expression :) Let me start from the beginning. MS Web Service TCP transport implementation is available in C#, you're using it. But this protocol is MS private, and there is no Java implementation of it. SOAP/TCP is Sun's implementation of TCP protocol for Web Services, and it's different from MS one. I refer to Noemax, as company which now is completing SOAP/TCP (Sun's) implementation for .Net platform, which you can use with C# to communicate Java WS endpoints. Hope this makes sense.

Posted by oleksiys on June 21, 2007 at 07:18 AM CEST #

Ah! Got it. I did not know that Sun's SOAP/TCP implementation differs from that of MS's one. I already did successfully integrate between an MS C#.NET server and a java client using Axis (I believe it was version 1) with WSE 2.0 + Dime. The current project I am on working on requires WSE 3.0 and MTOM. I thought using Sun WSIT would be a better way to go than Axis 2 which I have not yet tried. Is the Noemax the only way to go for using SUN WSIT soap.tcp scheme and can you provide a sample code for a java soap.tcp call in WSIT? Thanks.

Posted by Kacem Boufelliga on June 21, 2007 at 08:37 AM CEST #

WSIT can definitely help you in .Net<->Java communication using MTOM.
>is the Noemax the only way to go for using SUN WSIT soap.tcp
Yes. MS prefers to not publish their tcp transport specs.
> can you provide a sample code for a java soap.tcp call in WSIT
In order to use SOAP/TCP with WSIT, you don't need to make any code change. However you will need to make some changes to Web Service policy description file either manually [1], or just mark the checkbox in Netbeans[2].

WBR

[1] http://blogs.sun.com/oleksiys/entry/how_to_make_web_service
[2] http://blogs.sun.com/oleksiys/entry/soap_tcp_support_in_netbeans

Posted by oleksiys on June 21, 2007 at 09:50 AM CEST #

[Trackback] JBossWS has announced support for Metro. Many JBoss users are already using Metro, see Metro announcement for details at http://blogs.sun.com/theaquarium/entry/what_s_in_a_name. This is the latest addition to the Application Servers supporting Metro, ...

Posted by Vivek Pandey's Blog on July 03, 2007 at 02:31 PM CEST #

I am trying to call the simple addition web service (appearing in the netbeans tutorials) from a java client; I have enabled TCP both for service and the client from the netbeans menu as shown in

http://blogs.sun.com/oleksiys/entry/soap_tcp_support_in_netbeans.

However, when I look at the messages appearing in the Server Admin Console under Monitor/Messages, the transport type for all of the requests still appears as HTTP.

I have also tried the method described in this blog, adding the service provider file and changing to
<soap:address location="vnd.sun.ws.tcp://localhost:8080/CalculatorWSService/CalculatorWS"></soap:address>

When I run this, I get the following exception

Exception: javax.xml.ws.WebServiceException: Unsupported endpoint address: vnd.sun.ws.tcp://localhost:8080/CalculatorWSService/CalculatorWS

I would really appreciate if anyone could help. Thanks!

Posted by Floer on May 20, 2008 at 10:33 PM CEST #

Hello,

Do you have any idea about how to make a Web service use TCP transport with JAX-WS
on JBoss environment?

Regards,
Prathamesh

Posted by Prathamesh on June 12, 2008 at 08:35 AM CEST #

Hi,

can you provide a sample code for calling WCF soap.tcp service from WSIT.

Thanks,
Raj.

Posted by raj on September 30, 2008 at 12:19 AM CEST #

I tried to execute the JAX-WS web service client program. Through ant script, it is working fine. I am able to send request and I am able to receive response from service provider. But When I am running the code thro' command prompt, I am getting the following error.

"Unsupported endpoint error: x-jms://localhost:7222/Bla! Bla! Bla!"

Can anyone please suggest me to resolve this issue.

Thanks and Regards,
Rajendiran Ramlingam

Posted by Rajendiran Ramalingam on November 07, 2008 at 03:18 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

oleksiys

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today