Axis ,CXF 调用webservice返回 : 设备未就绪 , IOException

但是 用 SoapUI 可以正常返回 ,使用Storm 也是返回 设备未就绪.很迷茫
图片说明
图片说明

然后使用Call.invoke 可以返回了 ,但是缺返回 -3 ,接口对接人说 是一个传入参数值不对 ,然而那个值是一个固定值 ,怎么会不对.

1个回答

可能代码处理有问题值没有传过去,可以跟接口人沟通下,他们那边接收的参数具体什么。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
基于AXIS调用webservice报错:Connection refused: connect

我的调用方法: public static void main(String[] args) throws Exception { String client_id = "HeYiApp"; String orderNum = "2"; List numberList = new ArrayList(); numberList.add("120719"); numberList.add("120746"); numberList.add("113095"); String webUrl = "https://10.218.132.26/api/openapi/employee/getBatchEmpInfoList.json";// 服务端url地址 String webMethod = "getBatchEmpInfoList";// 调用方法名称 Service service = new Service(); // 建服务 Call call; try { call = (Call) service.createCall(); try { call.setTargetEndpointAddress(new URL(webUrl)); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); }// 设置访问地址 call.setOperationName(webMethod);// 设置访问方法 call.addParameter("arg0", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg1", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.addParameter("arg2", XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);// 定义参数 call.setReturnType(XMLType.XSD_STRING);// 定义返回值格式 //List<Map<String, Object>> workersInfo= (List<Map<String, Object>>) call.invoke(new Object[] { client_id, numberList, orderNum }); //for(Map m:workersInfo){ // System.out.println(m.get("name")); //} JSONArray jsonObject = (JSONArray) call.invoke(new Object[] { client_id, numberList, orderNum }); System.out.println(jsonObject.toString()); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 建对话 } 报错: Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.ConnectException: Connection refused: connect faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) {http://xml.apache.org/axis/}hostname:zhangxl java.net.ConnectException: Connection refused: connect at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at webservice.Test.main(Test.java:52) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:427) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) ... 10 more

axis调用webservice:返回值不正确

本人对webservice的调用不熟悉,求助各位大侠!多谢! WSDL的XML文件中定义的参数如下 name="zone" type="xsd:string" default="CM-ACCTSPID" name="Id" type="xsd:string" name="rowCount" type="xsd:decimal" name="accountId" type="xsd:string" accountID是返回值 我自己写的调用程序是 Service service = new Service(); // 创建一个call对象 Call call = (Call) service.createCall(); // 设置目标地址,即webservice路径 call.setTargetEndpointAddress(endpoint); // 设置操作名称,即方法名称 call.setSOAPActionURI("http://ouaf.oracle.com/spl/XAIXapp/xaiserver/CM-ACCTSPID"); call.setOperationName("CM-ACCTID");// 调用的方法名 call.setUseSOAPAction(true); Object [] c={"CM-ACCTID","5706648717",1,""}; Object a=call.invoke(c); 但是上述打印出a是CM-ACCTID,这不是webservice的正确返回信息。求解答! 用soapUI测试webservice,输入参数CM-ACCTID、5706648717、1,就有输出参数 0614668080。

axis调用webservice出错!!!

我用eclipse中的webservice client解析wsdl地址生成客户端代码。在调用客户端代码时总是出错! ``` AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Invalid element in mocha.framework.mpms.webservice.service.ProjectInfo - lastUpdateTime faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Invalid element in mocha.framework.mpms.webservice.service.ProjectInfo - lastUpdateTime at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at mocha.framework.mpms.webservice.service.impl.QueryServiceImplServiceSoapBindingStub.inquireProjectInfo(QueryServiceImplServiceSoapBindingStub.java:414) at com.zzp.Test.main(Test.java:38) ``` ``` ``` ``` ```

axis客户端调用webservice报错

有两个虚拟机,称为A和B,虚拟机A中部署着webservice服务端提供WSDL地址, 虚拟机B是客户端调用虚拟机A中的服务,调用时出现了一个奇怪的现象,报错如下: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.endEntity(XMLDocumentFragmentScannerImpl.java:663) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:556) at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1779) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1758) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanContent(XMLEntityScanner.java:694) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanContent(XMLDocumentFragmentScannerImpl.java:1051) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1649) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.test.Test.main(Test.java:28) 单纯报错没什么奇怪的,奇怪的是我在物理机上调用虚拟机A中的服务是正常的,用的客户端代码跟虚拟机B中是一样的,然后在虚拟机B中调用物理机里边的部署的和虚拟机A一样的服务也是可以正常的,虚拟机B通过浏览器访问虚拟机A的wsdl地址也是可以正常访问到的,虚拟机B中的客户端代码通过junit测试也是可以正常测试通过的。种种迹像表明,虚拟机A的webservice服务是没有问题的,虚拟机B中的客户端代码也是没有问题的,虚拟机A和虚拟机B是可以互相访问的,但只要通过虚拟机B调A的服务就报以上错误,如果一直报错也说的过去,只是在很偶然的情况下会调成功那么一次,本人折腾了两天了实在是没招了,有谁碰到过类似的问题希望可以给予帮助 ``` ```

基于AXIS调用webservice报错:SOAP request failed ....

异常如图所示:![图片说明](https://img-ask.csdn.net/upload/201701/16/1484556304_982303.png) 我的客户端代码如图: ![图片说明](https://img-ask.csdn.net/upload/201701/16/1484556357_449165.png)

axis 调用webservice接口报错

AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: Fault occurred while processing. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Fault occurred while processing. at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.skyon.webframe.auth.util.SvcPermissonUtil.getInfoByWSNew(SvcPermissonUtil.java:123) at com.skyon.webframe.auth.util.SvcPermissonUtil.main(SvcPermissonUtil.java:330)

axis1.4调用webservice 传递自定义对象参数出错

调用客户端后出现: org.xml.sax.SAXException: Invalid element in cn.services.QueryEquipmentRequest - queryEquipmentRequest 客户端代码(其中queryEquipmentRequest,QueryEquipmentResponse是我自定义的对象): call.addParameter(new QName(nameSpace, "queryEquipmentRequest"), new QName(nameSpace, "queryEquipmentRequest"), ParameterMode.IN); // // @@需修改成对应的输出参数名 call.setReturnType(new QName(nameSpace, "queryEquipmentResponse"), QueryEquipmentResponse.class); // // // 需要根据xsd生成的bean,对输入输出的XSD文件定义的类型进行注册映射关系 //// // @@如本服务输入输出XSD文件中有四个自定义类型 queryEquipmentRequest、queryEquipmentResponse、deviceItem、deviceItemList,配置如下 QName queryEquipmentRequest = new QName(nameSpace, "queryEquipmentRequest"); call.registerTypeMapping(QueryEquipmentRequest.class, queryEquipmentRequest, new BeanSerializerFactory(QueryEquipmentRequest.class, queryEquipmentRequest), new BeanDeserializerFactory( QueryEquipmentRequest.class, queryEquipmentRequest)); // QName queryEquipmentResponse = new QName(nameSpace, "queryEquipmentResponse"); call.registerTypeMapping(QueryEquipmentResponse.class, queryEquipmentResponse, new BeanSerializerFactory(QueryEquipmentResponse.class, queryEquipmentResponse), new BeanDeserializerFactory( QueryEquipmentResponse.class, queryEquipmentResponse)); 服务端的wsdl文件为: <wsdl:definitions targetNamespace="http://gd.soa.csg.com"><!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)--><wsdl:types><schema elementFormDefault="qualified" targetNamespace="http://gd.soa.csg.com"><complexType name="queryEquipmentRequest"><sequence><element maxOccurs="1" minOccurs="0" name="id" type="xsd:string"/></sequence></complexType><element name="queryEquipmentRequest" type="impl:queryEquipmentRequest"/><complexType name="queryEquipmentResponse"><sequence><element name="replyCode" type="xsd:string"/></sequence></complexType><element name="queryEquipmentResponse" type="impl:queryEquipmentResponse"/></schema></wsdl:types><wsdl:message name="queryEquipmentResponse"><wsdl:part element="impl:queryEquipmentResponse" name="queryEquipmentResponse"/></wsdl:message><wsdl:message name="queryEquipmentRequest"><wsdl:part element="impl:queryEquipmentRequest" name="queryEquipmentRequest"/></wsdl:message><wsdl:portType name="QueryEquipment"><wsdl:operation name="queryEquipment" parameterOrder="queryEquipmentRequest"><wsdl:input message="impl:queryEquipmentRequest" name="queryEquipmentRequest"/><wsdl:output message="impl:queryEquipmentResponse" name="queryEquipmentResponse"/></wsdl:operation></wsdl:portType><wsdl:binding name="QueryEquipmentSoapBinding" type="impl:QueryEquipment"><wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="queryEquipment"><wsdlsoap:operation soapAction="http://gd.soa.csg.com/queryEquipment"/><wsdl:input name="queryEquipmentRequest"><wsdlsoap:body use="literal"/></wsdl:input><wsdl:output name="queryEquipmentResponse"><wsdlsoap:body use="literal"/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="QueryEquipment"><wsdl:port binding="impl:QueryEquipmentSoapBinding" name="QueryEquipment"><wsdlsoap:address location="http://127.0.0.1:8400/webServiceTest/services/QueryEquipment"/></wsdl:port></wsdl:service></wsdl:definitions>

jboss5环境下,cxf和axis调用webservice客户端都是不报错,不返回结果

有谁碰到过这种问题,cxf和axis调用webservice没问题,部署到jboss5里面就有问题, 不报错,不返回结果

java客户端使用axis1.4jar包调用webService传递复杂参数

有如下一段WSDL,请问使用axis1.4jar包应该如何传递参数,谢谢。 ``` <xsd:complexType name="function"> <xsd:sequece> <xsd:element name="Head"> <xsd:sequece> <xsd:element name="e1"> <xsd:simpleType> ... </xsd:simpleType> </xsd:element> <xsd:element name="e2"> <xsd:simpleType> ... </xsd:simpleType> </xsd:element> </xsd:sequece> <xsd:element> </xsd:sequece> </xsd:complexType> ```

java调用webservice时报 faultString: (404)Not Found

******* request ******* <?xml version="1.0" encoding="GBK"?> <request version="1.0"> <system> <sysid>ESS</sysid> <uid>ESS0025</uid> <servicename>AEGON_WS_ESS_USER_LOGIN</servicename> </system> <queryinfo> <filed name="STATUS"/> <filed name="ERRORMASSAGE"/> <filed name="RESULTTYPE"></filed> <filed name="PATH"></filed> <filed name="RESULTCOUNT">0</filed> <filed name="TIME">2014-05-13 13:57:01</filed> </queryinfo> <query> <filed name="sNumber" type="String">1926099983</filed> <filed name="password" type="String">abcde</filed> </query> </request> Exception in thread "main" AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (404)Not Found faultActor: faultNode: faultDetail: {}:return code: 404 &lt;html&gt;&lt;head&gt;&lt;title&gt;Apache Tomcat/6.0.18 - Error report&lt;/title&gt;&lt;style&gt;&lt;!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--&gt;&lt;/style&gt; &lt;/head&gt;&lt;body&gt;&lt;h1&gt;HTTP Status 404 - /ESS_DEV/services/EssQueryServer&lt;/h1&gt;&lt;HR size=&quot;1&quot; noshade=&quot;noshade&quot;&gt;&lt;p&gt;&lt;b&gt;type&lt;/b&gt; Status report&lt;/p&gt;&lt;p&gt;&lt;b&gt;message&lt;/b&gt; &lt;u&gt;/ESS_DEV/services/EssQueryServer&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;description&lt;/b&gt; &lt;u&gt;The requested resource (/ESS_DEV/services/EssQueryServer) is not available.&lt;/u&gt;&lt;/p&gt;&lt;HR size=&quot;1&quot; noshade=&quot;noshade&quot;&gt;&lt;h3&gt;Apache Tomcat/6.0.18&lt;/h3&gt;&lt;/body&gt;&lt;/html&gt; {http://xml.apache.org/axis/}HttpErrorCode:404 (404)Not Found at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.aegon_cnooc.ess.WebService.client.EssQueryServerSoapBindingStub.communicationChange(EssQueryServerSoapBindingStub.java:676) at com.aegon_cnooc.ess.WebService.ServiceClientTest.testEssQueryServer(ServiceClientTest.java:96) at com.aegon_cnooc.ess.WebService.ServiceClientTest.main(ServiceClientTest.java:29) java测试: public static void testEssQueryServer() throws Exception { String encode = "GBK"; System.out.println("******* request *******"); String request = readFile(requestXMLFile, encode); // 调用WebService EssQueryServerServiceLocator services = new EssQueryServerServiceLocator(); EssQueryServerSoapBindingStub client = (EssQueryServerSoapBindingStub) services .getEssQueryServer(); String response = client.communicationChange(request); System.out.println("******* response *******"); writeXML(response, responseXMLFile, encode); } webservice 代码: public java.lang.String communicationChange(java.lang.String reqestXML) throws java.rmi.RemoteException { if (super.cachedEndpoint == null) { throw new org.apache.axis.NoEndPointException(); } org.apache.axis.client.Call _call = createCall(); _call.setOperation(_operations[11]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("http://server.WebService.ess.aegon_cnooc.com", "communicationChange")); setRequestHeaders(_call); setAttachments(_call); try { ** java.lang.Object _resp = _call.invoke(new java.lang.Object[] {reqestXML});**这一行报错 if (_resp instanceof java.rmi.RemoteException) { throw (java.rmi.RemoteException)_resp; } else { extractAttachments(_call); try { return (java.lang.String) _resp; } catch (java.lang.Exception _exception) { return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class); } } } catch (org.apache.axis.AxisFault axisFaultException) { throw axisFaultException; } }

axis调用webservice报参数为空的问题

axis调用无参数的接口可以,但是一但有参数就出错 错误信息大致是:参数为空,但是我传的值打印出来是有值的。下面附上代码,大佬帮忙看看!谢谢 PS:大致的错误我明白了,这个链接需要两个参数一个data 一个GUID 但是wsdl文件里只有一个data参数!!所以这个GUID只能拼接上去,axis可以拼接吗?在哪个地方拼接 public static String MethodsGeneral(String url,String methods, Map<String, Object> params,String str) { String GUID="7b33dd14-b183-4d1e-8c96-04baf421498f"; String result=""; try{ String namespace ="http://tempuri.org/"; String soapActionUI = "http://tempuri.org/"+methods; String endpoint = url; Service service = new Service(); Call call = (Call)service.createCall(); call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setUseSOAPAction(true); call.setSOAPActionURI(soapActionUI); call.setOperationName(new QName(namespace,methods)); call.addParameter(new QName(namespace,"data"),org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN); call.addParameter(new QName(namespace,"GUID"),org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.XSD_STRING); JSONObject jsonObject = new JSONObject(params); HashMap<String, String> allParam = new HashMap(); String beforeEnc = jsonObject.toString(); String cipherInfo = null; try { cipherInfo = AESUtil.encrypt(beforeEnc); } catch (Exception e) { e.printStackTrace(); } // 把加密后的字符串转化为16进制 String temp = StringUtil.str2HexStr(cipherInfo); //访问的方法名 System.out.println(temp); System.out.println(GUID); result = (String)call.invoke(new Object[]{temp,GUID}); }catch(Exception e){ e.printStackTrace(); System.out.println("调用webservice失败!"); } //將result字符串解析成要用的字符串 return result; } 以下是错误信息:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 ---&gt; System.NullReferenceException: 未将对象引用设置到对象的实例。 在 Fuli.WebService.BaseWebService.AESEncrypt(String toEncrypt) 位置 D:\花汇购项目\Backend\Fuli.WebService\BaseWebService.cs:行号 426 在 Fuli.WebService.BaseWebService.GetExceptionReturnInfo(String exMessage) 位置 D:\花汇购项目\Backend\Fuli.WebService\BaseWebService.cs:行号 311 在 Fuli.WebService.UserWebService.GetAddresslistByUsername(String data) 位置 D:\花汇购项目\Backend\Fuli.WebService\UserWebService.asmx.cs:行号 689 --- 内部异常堆栈跟踪的结尾 --- faultActor: faultNode: faultDetail:

axis调用cxf开发的接口,Unexpected wrapper element found.

错误代码如下:AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: Unexpected wrapper element requestHgInfoRespond found. Expected {http://warehouse.cxf.kcb.com/}requestHgInfoRespond. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Unexpected wrapper element requestHgInfoRespond found. Expected {http://warehouse.cxf.kcb.com/}requestHgInfoRespond. at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at HgTest.invokeRemoteFuc(HgTest.java:208) at HgTest.main(HgTest.java:36) 调用方法: call = (Call) service.createCall(); call.setTargetEndpointAddress(endpoint); String parametersName = "arg0"; // 参数名 call.setOperationName(methodName);// 调用的方法名 call.addParameter(new QName(namespace, parametersName), XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); // 返回值类型:String result = (String) call.invoke(new Object[] { message });// 远程调用

webservice客户端怎么调用服务端CXF

用的cxf客户端服务端都是wsdl反向生成的 服务端服务已经发布 客户端怎么调用?

动态调用webservice问题

本地tomcat7+jdk7动态访问webservice可以运行没有问题。 但是放到服务器上后,同样的环境,服务器就报错。确定webservice是可以用的 ![图片说明](https://img-ask.csdn.net/upload/201702/22/1487744905_556650.png)

axis2 webservice 客户端调用时报错

代码部分如下: RPCServiceClient serviceClient = new RPCServiceClient(); EndpointReference targetEPR = new EndpointReference(wsurl); Options options = serviceClient.getOptions(); options.setTo(targetEPR); HttpTransportProperties.Authenticator basicauth = new HttpTransportProperties.Authenticator(); basicauth.setUsername("ECInsurance"); //服务器访问用户名 basicauth.setPassword("YGBXECInsurance"); //服务器访问密码 options.setProperty(HTTPConstants.AUTHENTICATE, basicauth); options.setAction("idNoCheck"); QName qname = new QName("http://slis-uat.sinosig.com/services/IdNoCheck", "idNoCheck"); // 指定IdNoCheck方法的参数值 Object[] parameters = new Object[1]; //PackReg方法是组装xml的,报文经过接口测试没问题 parameters[0]=PackReg(order); System.out.println(parameters[0]); // 指定IdNoCheck方法返回值的数据类型的Class对象 Class[] returnTypes = new Class[] {String.class}; System.out.println(serviceClient.invokeBlocking(qname,parameters, returnTypes)[0].toString()); } catch (AxisFault e) { e.printStackTrace(); } 错误信息如下: org.apache.axis2.AxisFault: Server Error at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508) at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:101) at com.sinosig.lifewebsite.util.idCheck.idCheckIdNo(idCheck.java:65) at com.sinosig.lifewebsite.controller.jkseb.JksebController.idCheckNo(JksebController.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:439) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:427) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:915) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:811) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:796) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.sinosig.ec.sso.filter.SSOClientFilter.doFilter(SSOClientFilter.java:86) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) 接口那边说没有问题的

Axis调用ws报错:Bad envelope tag: html,请问怎么解决,谢谢

AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Bad envelope tag: html faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad envelope tag: html at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:605) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3138) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.chinacreator.webservice.client.AxisTest.main(AxisTest.java:29) {http://xml.apache.org/axis/}hostname:MLXEVY6GCNXW6HQ org.xml.sax.SAXException: Bad envelope tag: html at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.chinacreator.webservice.client.AxisTest.main(AxisTest.java:29) Caused by: org.xml.sax.SAXException: Bad envelope tag: html at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:379) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:605) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3138) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) ... 9 more

axis客户端调用.net时报:未能加载文件或程序集或它的某一个依赖项。系统找不到指定的文件。

我用的是axis,不是axis2,调用一个由.net发布的Webservice接口。可程序报“未能加载文件或程序集或它的某一个依赖项。系统找不到指定的文件。”的错误,一时查不到资料,请各位tx帮忙解决。 Init方法返回的是boolean型,ValidEncryptPassword返回的是String型的xml内容。 代码在后面,先把报错贴出来 报错如下: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: 服务器无法处理请求。 ---&gt; 未能加载文件或程序集“Interop.MSXML2, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。 faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:服务器无法处理请求。 ---&gt; 未能加载文件或程序集“Interop.MSXML2, Version=6.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) .... 调用代码如下: [code="java"] Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new java.net.URL(this.urlPoint)); call.setUseSOAPAction(true); call.setSOAPActionURI("WebService/ValidEncryptPassword"); call.setOperationName(new QName("WebService", "ValidEncryptPassword")); call.addParameter(new QName("WebService", "CardNo"), XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(new QName("WebService", "EncryptPassword"), XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); String ret = (String) call.invoke(new Object[] { cardNo, encryptPassword }); [/code] wsdl文件如下 [code="java"] <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="WebService" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="WebService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="WebService"> <s:element name="Init"> <s:complexType /> </s:element> <s:element name="InitResponse"> <s:complexType> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="InitResult" type="s:boolean" /> </s:sequence> </s:complexType> </s:element> <s:element name="ValidEncryptPassword"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="CardNo" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="EncryptPassword" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="ValidEncryptPasswordResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="ValidEncryptPasswordResult" type="s:string" /> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> <wsdl:message name="InitSoapIn"> <wsdl:part name="parameters" element="tns:Init" /> </wsdl:message> <wsdl:message name="InitSoapOut"> <wsdl:part name="parameters" element="tns:InitResponse" /> </wsdl:message> <wsdl:message name="ValidEncryptPasswordSoapIn"> <wsdl:part name="parameters" element="tns:ValidEncryptPassword" /> </wsdl:message> <wsdl:message name="ValidEncryptPasswordSoapOut"> <wsdl:part name="parameters" element="tns:ValidEncryptPasswordResponse" /> </wsdl:message> <wsdl:portType name="ServiceSoap"> <wsdl:operation name="Init"> <wsdl:input message="tns:InitSoapIn" /> <wsdl:output message="tns:InitSoapOut" /> </wsdl:operation> <wsdl:operation name="ValidEncryptPassword"> <wsdl:input message="tns:ValidEncryptPasswordSoapIn" /> <wsdl:output message="tns:ValidEncryptPasswordSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ServiceSoap" type="tns:ServiceSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Init"> <soap:operation soapAction="WebService/Init" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="ValidEncryptPassword"> <soap:operation soapAction="WebService/ValidEncryptPassword" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="Init"> <soap12:operation soapAction="WebService/Init" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="ValidEncryptPassword"> <soap12:operation soapAction="WebService/ValidEncryptPassword" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Service"> <wsdl:port name="ServiceSoap" binding="tns:ServiceSoap"> <soap:address location="http://192.1.1.2/Service.asmx" /> </wsdl:port> <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12"> <soap12:address location="http://192.1.1.2/Service.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions> [/code] [b]问题补充:[/b] 我看了其他公司的调用,是用xfire作的,也是直接有wsdl文件生成的,可以返回结果啊,我的程序是不是写的有问题呢?

AXIS1环境下调用AXIS2服务端问题

我的项目现在是用的AXIS1的环境但是想调用AXIS2的服务端.我用的RPC的方式.每次调用都会报出org.apache.axis2.AxisFault: String index out of range: -12的错误.在纯AXIS2的环境下是可以的.我的代码如下 import javax.xml.namespace.QName; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.rpc.client.RPCServiceClient; public class test { /** * RPC调用AXIS2 webservice * @param endpoint 服务地址 如:http://192.168.212.192:8090/jyedi/services/ediService?wsdl * @param localPart 方法名 如sendMessageLD2WMS * @param opArgs 方法参数 如Object[] opArgs = new Object[] { param }; * @param namespaceURI 命名空间 如 :targetNamespace="http://impl.services.service.server.edi.vtradex.com"> * @param opReturnType 返回类型 如字符串:Class[] opReturnType = new Class[] { String[].class }; * @throws org.apache.axis2.AxisFault */ public static String axis2RPCInvoke(String endpoint,String localPart,Object[] opArgs,String namespaceURI,Class[] opReturnType) throws org.apache.axis2.AxisFault, AxisFault { Object[] ret = null; try { RPCServiceClient serviceClient = new RPCServiceClient(); Options options = serviceClient.getOptions(); EndpointReference targetEPR = new EndpointReference(endpoint); options.setTo(targetEPR); QName opQName = new QName(namespaceURI, localPart); ret = serviceClient.invokeBlocking(opQName, opArgs, opReturnType); System.out.println(((String[]) ret[0])[0]); } catch (AxisFault e) { e.printStackTrace(); } return ((String[]) ret[0])[0]; } }

axis2客户端调用时报错

axis2在调用的时候报这个错,本地环境没问题,发布到linux时就出问题了 Exception in thread "main" org.apache.axis2.AxisFault: Dangling meta character '?' near index 0 ? ^ at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:508) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:368) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:533) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:509) at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:75) at sinosoft.core.service.coretogpi.webservice.SingleTransactionParse.main(SingleTransactionParse.java:104)

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

springboot+jwt实现token登陆权限认证

一 前言 此篇文章的内容也是学习不久,终于到周末有时间码一篇文章分享知识追寻者的粉丝们,学完本篇文章,读者将对token类的登陆认证流程有个全面的了解,可以动态搭建自己的登陆认证过程;对小项目而已是个轻量级的认证机制,符合开发需求;更多精彩原创内容关注公主号知识追寻者,读者的肯定,就是对作者的创作的最大支持; 二 jwt实现登陆认证流程 用户使用账号和面发出post请求 服务器接受到请求后使用私...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

早上躺尸,晚上干活:硅谷科技公司这么流行迟到?

硅谷科技公司上班时间OPEN早已不是什么新鲜事,早九晚五是常态,但有很多企业由于不打卡,员工们10点、11点才“姗姗来迟”的情况也屡见不鲜。 这种灵活的考勤制度为人羡慕,甚至近年来,国内某些互联网企业也纷纷效仿。不过,硅谷普遍弹性的上班制度是怎么由来的呢?这种“流行性迟到”真的有那么轻松、悠哉吗? 《动态规划专题班》 课程试听内容: 动态规划的解题要领 动态规划三大类 求最值/计数/可行性 常...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐