Skip to main content

SOAP over TCP

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
xuxiaoxia
Offline
Joined: 2013-04-10

Today,I try to use SOAP over TCP with Metro.I follow Chapter 9 of Metro User Guide step by step,but when I run the client I get a Exception,As follows:
SEVERE: WSTCP0001:Processing message failed!
javax.xml.ws.WebServiceException: WSTCP0017:Error executing webservice
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.process(TCPTransportPipe.java:201)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.processRequest(TCPTransportPipe.java:113)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy38.add(Unknown Source)
at com.xxx.ws.client.Client.main(Client.java:19)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:492)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:135)
at com.sun.xml.ws.transport.tcp.io.FramedMessageInputStream.read(FramedMessageInputStream.java:208)
at com.sun.xml.ws.transport.tcp.io.BufferedMessageInputStream.read(BufferedMessageInputStream.java:61)
at com.sun.xml.ws.transport.tcp.io.DataInOutUtils.readInts4(DataInOutUtils.java:90)
at com.sun.xml.ws.transport.tcp.io.DataInOutUtils.readInts4(DataInOutUtils.java:71)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.doSendMagicAndCheckVersions(WSConnectionManager.java:325)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.createConnectionSession(WSConnectionManager.java:193)
at com.sun.xml.ws.transport.tcp.util.WSTCPURI.createConnection(WSTCPURI.java:165)
at com.sun.xml.ws.transport.tcp.util.WSTCPURI.createConnection(WSTCPURI.java:52)
at com.sun.xml.ws.transport.tcp.connectioncache.impl.transport.OutboundConnectionCacheBlockingImpl.tryNewConnection(OutboundConnectionCacheBlockingImpl.java:235)
at com.sun.xml.ws.transport.tcp.connectioncache.impl.transport.OutboundConnectionCacheBlockingImpl.get(OutboundConnectionCacheBlockingImpl.java:458)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.openChannel(WSConnectionManager.java:124)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.setupClientTransport(TCPTransportPipe.java:244)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.process(TCPTransportPipe.java:136)
... 12 more

Exception in thread "main" javax.xml.ws.WebServiceException: WSTCP0017:Error executing webservice
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.process(TCPTransportPipe.java:201)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.processRequest(TCPTransportPipe.java:113)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
at com.sun.xml.ws.client.Stub.process(Stub.java:319)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:157)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140)
at $Proxy38.add(Unknown Source)
at com.xxx.ws.client.Client.main(Client.java:19)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:492)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:135)
at com.sun.xml.ws.transport.tcp.io.FramedMessageInputStream.read(FramedMessageInputStream.java:208)
at com.sun.xml.ws.transport.tcp.io.BufferedMessageInputStream.read(BufferedMessageInputStream.java:61)
at com.sun.xml.ws.transport.tcp.io.DataInOutUtils.readInts4(DataInOutUtils.java:90)
at com.sun.xml.ws.transport.tcp.io.DataInOutUtils.readInts4(DataInOutUtils.java:71)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.doSendMagicAndCheckVersions(WSConnectionManager.java:325)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.createConnectionSession(WSConnectionManager.java:193)
at com.sun.xml.ws.transport.tcp.util.WSTCPURI.createConnection(WSTCPURI.java:165)
at com.sun.xml.ws.transport.tcp.util.WSTCPURI.createConnection(WSTCPURI.java:52)
at com.sun.xml.ws.transport.tcp.connectioncache.impl.transport.OutboundConnectionCacheBlockingImpl.tryNewConnection(OutboundConnectionCacheBlockingImpl.java:235)
at com.sun.xml.ws.transport.tcp.connectioncache.impl.transport.OutboundConnectionCacheBlockingImpl.get(OutboundConnectionCacheBlockingImpl.java:458)
at com.sun.xml.ws.transport.tcp.client.WSConnectionManager.openChannel(WSConnectionManager.java:124)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.setupClientTransport(TCPTransportPipe.java:244)
at com.sun.xml.ws.transport.tcp.client.TCPTransportPipe.process(TCPTransportPipe.java:136)
... 12 more
Java Result: 1

As the document show:I add the follow Policy to my Service EndPoint:<wsp:Policy wsu:Id="AddNumbersPortBindingPolicy"><wsp:ExactlyOne><wsp:All><tcp:OptimizedTCPTransport enabled="true"/></wsp:All></wsp:ExactlyOne></wsp:Policy>
and in order to tell my client to use Tcp to transport SOAP,I add follow Policy to my client :

<wsp:Policy wsu:Id="AddNumbersPortBindingPolicy"><wsp:ExactlyOne><wsp:All><tcp:AutomaticallySelectOptimalTransport/></wsp:All></wsp:ExactlyOne></wsp:Policy>

when I delete the policy from my client,my client can communicate with my service by http .But when I add the policy,my client become very slow and finally give me the exception.

I should modify the configuration on Glassfish?