Description :
server :
spring, hibernate ...
web server : glassfish, using , axis2 deployment service.xml file using client PRC, AXIOM are not connected ( the program is connected with the PRC ) . But I can . Net and in the browser via the above address access , and return the correct message.
http:// domain / dataService / services / DataexchangeService / checkLoginuserCode = admin & password = admin
clients:
java swing, spring ...
exception as follows :
java.lang.RuntimeException: [was class java.net.SocketException] Connection reset
at com.ctc.wstx.util.ExceptionUtil.throwRuntimeException (ExceptionUtil.java: 18)
at com.ctc.wstx.sr.StreamScanner.throwLazyError (StreamScanner.java: 731)
at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3657)
at com.ctc.wstx.sr.BasicStreamReader.getText (BasicStreamReader.java: 809)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getText (XMLStreamReaderWrapper.java: 164)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 289)
at org.apache.axiom.om.impl.builder.StAXBuilder.createOMText (StAXBuilder.java: 250)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next (StAXOMBuilder.java: 252)
at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling (OMElementImpl.java: 337)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.findNextElementWithQName (OMChildrenQNameIterator.java: 96)
at org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.hasNext (OMChildrenQNameIterator.java: 76)
at org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName (OMElementImpl.java: 274)
at org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getRole (SOAP11FaultImpl.java: 136)
at org.apache.axis2.AxisFault.initializeValues (AxisFault.java: 202)
at org.apache.axis2.AxisFault
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext (Utils.java: 446)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse (OutInAxisOperation.java: 371)
at org.apache.axis2.description.OutInAxisOperationClient.send (OutInAxisOperation.java: 417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl (OutInAxisOperation.java: 229)
at org.apache.axis2.client.OperationClient.execute (OperationClient.java: 165)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 540)
at org.apache.axis2.client.ServiceClient.sendReceive (ServiceClient.java: 521)
at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking (RPCServiceClient.java: 102)
at RPCClient.checkLogin (RPCClient.java: 48)
at RPCClient.main (RPCClient.java: 60)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read (SocketInputStream.java: 168)
at java.io.BufferedInputStream.read1 (BufferedInputStream.java: 256)
at java.io.BufferedInputStream.read (BufferedInputStream.java: 317)
at org.apache.commons.httpclient.ChunkedInputStream.read (ChunkedInputStream.java: 182)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at org.apache.commons.httpclient.AutoCloseInputStream.read (AutoCloseInputStream.java: 108)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at org.apache.axiom.om.util.DetachableInputStream.read (DetachableInputStream.java: 147)
at java.io.FilterInputStream.read (FilterInputStream.java: 116)
at java.io.PushbackInputStream.read (PushbackInputStream.java: 169)
at java.io.FilterInputStream.read (FilterInputStream.java: 90)
at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365)
at com.ctc.wstx.io.UTF8Reader.read (UTF8Reader.java: 110)
at com.ctc.wstx.io.MergedReader.read (MergedReader.java: 101)
at com.ctc.wstx.io.ReaderSource.readInto (ReaderSource.java: 84)
at com.ctc.wstx.io.BranchingReaderSource.readInto (BranchingReaderSource.java: 57)
at com.ctc.wstx.sr.StreamScanner.loadMore (StreamScanner.java: 992)
at com.ctc.wstx.sr.BasicStreamReader.readTextSecondary (BasicStreamReader.java: 4628)
at com.ctc.wstx.sr.BasicStreamReader.readCoalescedText (BasicStreamReader.java: 4126)
at com.ctc.wstx.sr.BasicStreamReader.finishToken (BasicStreamReader.java: 3701)
at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken (BasicStreamReader.java: 3649)
... 23 more
PRC connection
private final String srcTargetNameSpaces = "http://impl.webservice.dataexchange.jst.com";
private final String srcSrvcUrl = "http://域名/dataService/services/DataexchangeService";
//RPC
public String checkLogin(String userCode, String password)
throws Exception {
QName qname = new QName(srcTargetNameSpaces, "checkLogin");
Object param[] = new Object[] { userCode, password };
Object[] response = null;
try {
RPCServiceClient client = new RPCServiceClient();
Options options = client.getOptions();
options.setTo(new EndpointReference(srcSrvcUrl));
Class[] returnTypes = new Class[] { String.class };
response = client.invokeBlocking(qname, param, returnTypes);
client.cleanupTransport();
} catch (AxisFault e) {
logger.error(e);
throw new Exception(e);
}
return (String) response[0];
}
AXIOM
private static EndpointReference targetEPR =
new EndpointReference("http://域名/dataService/services/DataexchangeService");
public static OMElement checkLogin(String symbol, String price) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://impl.webservice.dataexchange.jst.com", "tns");
OMElement method = fac.createOMElement("checkLogin", omNs);
OMElement value1 = fac.createOMElement("userCode", omNs);
value1.addChild(fac.createOMText(value1, symbol));
method.addChild(value1);
OMElement value2 = fac.createOMElement("password", omNs);
value2.addChild(fac.createOMText(value2,price));
method.addChild(value2);
return method;
}
public static void main(String[] args) {
try {
// OMElement getPricePayload = getPricePayload("WSO");
OMElement updatePayload = checkLogin("admin", "admin");
Options options = new Options();
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
ServiceClient sender = new ServiceClient();
sender.setOptions(options);
OMElement result = sender.sendReceive(updatePayload);
System.err.println("price updated");
// OMElement result = sender.sendReceive(getPricePayload);
String response = result.getFirstElement().getText();
System.err.println("Current price of WSO: " + response);
} catch (Exception e) {
e.printStackTrace();
}
}
service.xml
<serviceGroup>
<service name="DataexchangeService" scope="application" targetNamespace="http://acl.common.jst.com">
<description>
POJO: AddressBook Service
</description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</messageReceivers>
<parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
</parameter>
<parameter name="SpringBeanName">jst_dataExchangeService</parameter>
<!--
<operation name="getUser">
<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
-->
</service>
</serviceGroup>
Saturday , Sunday engage in two days , including the configuration environment , resolve the error . . . . . Really egg pain.
two connections should be no problem . . . This problem was impatient . . . We help about
------ Solution ------------------------------------ --------
I came to see you loose points
------ Solution -------------------- ------------------------
at com.ctc.wstx.io.UTF8Reader.loadMore (UTF8Reader.java: 365)
here to do what ?
side of the socket closed.
------ For reference only -------------------------------------- -
their first top one
------ For reference only ------------------------------ ---------
------ For reference only ---------------------------------- -----
------ For reference only ---------------------------------- -----
to one of
------ For reference only --------------------------- ------------
above problem is caused by inconsistent standard http protocol . The check items removed ok. Then I would knot posted .
------ For reference only -------------------------------------- -
access points to the
------ For reference only ------------------------------ ---------
landlord problem solved? I encountered a problem and ask you exactly ah ... next is how to solve ah ! ! ! Urgent ! ! ! Thank
------ For reference only --------------------------------- ------
encountered the same problem, tangle a day yet to be resolved -
------ For reference only --------------- ------------------------
what caused the problem ?
没有评论:
发表评论