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>

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

Axis2与WAS jar包冲突,急急!

1. 问题描述:调用webservice服务时,后台报如下错误: com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0100E: 应用程序 mcesys_war 中的 servlet AxisServlet 创建了未捕获到的 init() 异常:java.lang.NoClassDefFoundError: org.apache.woden.resolver.URIResolver; 2. 使用webservice框架:Axis2,was版本7.0 3. 问题处理过程 引起异常的原因: 1).缺少JAR包 2).Axis2的JAR包和WAS自身JAR冲突 通过网上查询可以排除可以排除第一种可能,第二种原因网上解决办法: a.在控制台的“管理模块”中改变was的类加载顺序,但是更改为父类最后加载后,工程中的Struts2有出问题 b.新建共享库,将Axis2的JAR放到共享库中,应用程序引用共享库。创建共享库并引用后,整个工程都起不来了,报“更改未保存”错误 正在项目实施中,急急!跪求大神指点

axis2 WebService的客户端无法调用?

![![![图片说明](https://img-ask.csdn.net/upload/201610/09/1476007052_450717.png)图片说明](https://img-ask.csdn.net/upload/201610/09/1476007012_66118.png)![图片说明](https://img-ask.csdn.net/upload/201610/09/1476007072_382240.png) 正常来说aa可以调用setA()、setB()方法传参数,但是根本不存在这两个方法,是怎么回事?

axis2发布的webservice可以正常访问,但是控制台会报错

如题,使用axis2框架发布的webservice,第一次访问的时候控制台会报错,不影响使用。 13:43:38.801 [http-bio-8080-exec-2] ERROR org.apache.axis2.deployment.ModuleDeployer - The axis2-jaxws-mar-1.6.2.mar module, which is not valid, caused org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher org.apache.axis2.AxisFault: org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) ~[axis2-1.6.2.jar:na] at org.apache.axis2.deployment.util.Utils.getHandlerClass(Utils.java:412) ~[axis2-1.6.2.jar:na] at org.apache.axis2.deployment.util.Utils.addFlowHandlers(Utils.java:92) ~[axis2-1.6.2.jar:na] at org.apache.axis2.deployment.DeploymentEngine.addNewModule(DeploymentEngine.java:549) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:80) ~[axis2-1.6.2.jar:na] at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:813) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:69) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:64) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:158) [axis2-1.6.2.jar:na] at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:228) [axis2-1.6.2.jar:na] at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) [axis2-1.6.2.jar:na] at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:584) [axis2-transport-http-1.6.2.jar:na] at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:454) [axis2-transport-http-1.6.2.jar:na] at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1282) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1195) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:866) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.69] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [catalina.jar:7.0.69] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.69] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) [catalina.jar:7.0.69] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.69] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) [catalina.jar:7.0.69] at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) [tomcat-coyote.jar:7.0.69] at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) [tomcat-coyote.jar:7.0.69] at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote.jar:7.0.69] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_80] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_80] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.69] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_80] Caused by: java.lang.ClassNotFoundException: org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1858) ~[catalina.jar:7.0.69] at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1701) ~[catalina.jar:7.0.69] at java.lang.Class.forName0(Native Method) ~[na:1.7.0_80] at java.lang.Class.forName(Class.java:195) ~[na:1.7.0_80] at org.apache.axis2.util.Loader.loadClass(Loader.java:261) ~[axis2-1.6.2.jar:na] at org.apache.axis2.util.Loader.loadClass(Loader.java:229) ~[axis2-1.6.2.jar:na] at org.apache.axis2.deployment.util.Utils.getHandlerClass(Utils.java:410) ~[axis2-1.6.2.jar:na] ... 31 common frames omitted Could not identify the Annotation.... Could not identify the Annotation.... Could not identify the Annotation.... 求大神帮看下是什么原因

****client call webservice error(have ws-policy)

问题是这样的: 怎样编写client端代码调用一个webservice, 这个WS是deploy在weblogic上的,重点是做了ws-policy配置(需要用户名,密码认证),他们只提供给了我们WSDL。 我做了下面这些,可还是调用失败,并且错误信息不明确,哪为高手指点下小女子。不知到是否还需要别的配置, rampart ? 1. 新建了一个java项目,导入Axis2 (1.6.2) jar包。 2. 用WSDL2Java生成客户端代码(基于wsdl文件) 网上说WSDL2Java会自动把wsdl里的policy文件自动添加到生成的java文件里,参考:https://axis.apache.org/axis2/java/core/docs/WS_policy.html#client xxxStub xxxCallbackHandler 3. Client代码 // Create stub xxxStub stub = new xxxStub(); // Set userName, password HttpTransportProperties.Authenticator basicAuthentication = new HttpTransportProperties.Authenticator(); basicAuthentication.setUsername("***"); basicAuthentication.setPassword("***"); stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication); // Prepare input parameters ... // Set parameters ... // Invoke Services GetReportResponse response = stub.getReport(parameters); // Get result ... = response.getGetReportResult(); 4. 错误信息: org.apache.axis2.AxisFault: Unknown exception, internal system processing error. at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) at ....xxxStub.getReportMetaData(xxxStub.java:200)

用spring+axis调用自己写的一个测试webservice接口报错,代码如下

接口代码 ```public interface TestWebService { public String getWgceaUrl(String jsonString)throws Exception; } 实现代码 ``` public class TestWebServiceImpl implements TestWebService{ @Override public String getWgceaUrl(String jsonString) throws Exception { System.out.print("测试"); return "1111111"; } } ```整合类 /** * 用于axis1与Spring进行整合 */ public class IntegrationService extends ServletEndpointSupport { private ApplicationContext applicationContext; private TestWebService testWebService; @Override protected void onInit() throws ServiceException { // 初始化Spirng 配置 applicationContext = super.getApplicationContext(); testWebService = (TestWebService) applicationContext.getBean("testWebService"); } /** * * @Description: 接口 * @param * @return * @throws Exception */ public String getWgceaUrl(String jsonString) throws Exception { return String.valueOf(testWebService.getWgceaUrl(jsonString)); } ```package cn.dreamit.p1001.webservice; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import javax.xml.namespace.QName; import java.net.URL; 测试类如下 public class test { private String nameSpaceUri = "http://192.168.0.18:8080/DreamWeb/services/testWebService"; //private String nameSpaceUri = "http://www.ntrl.gov.cn/services/WebService"; private String wsdlUrl = nameSpaceUri + "?wsdl"; private Service service=null; private Call call=null; public final void init() throws Exception { // 创建调用对象 service = new Service(); call = (Call) service.createCall(); // 调用 远程方法 call.setOperationName(new QName(nameSpaceUri, "getWgceaUrl")); // 设置URL call.setTargetEndpointAddress(new URL(wsdlUrl)); } public final void testGet() throws Exception { // 执行远程调用,同时获得返回值 String r = (String) call.invoke(new Object[] {"11"}); System.out.println("jsonStrings=" + r); } public static void main(String[] args) { test test = new test(); try { test.init(); test.testGet(); } catch (Exception e) { e.printStackTrace(); } } } wsdl配置如下 ``` <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration> <parameter name="adminPassword" value="admin" /> <parameter name="sendXsiTypes" value="true" /> <parameter name="sendMultiRefs" value="true" /> <parameter name="sendXMLDeclaration" value="true" /> <parameter name="axis.sendMinimizedElements" value="true" /> <requestFlow> <handler type="java:org.apache.axis.handlers.JWSHandler"> <parameter name="scope" value="session" /> </handler> <handler type="java:org.apache.axis.handlers.JWSHandler"> <parameter name="scope" value="request" /> <parameter name="extension" value=".jwr" /> </handler> </requestFlow> </globalConfiguration> <handler name="Authenticate" type="java:org.apache.axis.handlers.SimpleAuthenticationHandler" /> <handler name="LocalResponder" type="java:org.apache.axis.transport.local.LocalResponder" /> <handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper" /> <service name="AdminService" provider="java:MSG"> <parameter name="allowedMethods" value="AdminService" /> <parameter name="enableRemoteAdmin" value="false" /> <parameter name="className" value="org.apache.axis.utils.Admin" /> <namespace>http://xml.apache.org/axis/wsdd/</namespace> </service> <service name="Version" provider="java:RPC"> <parameter name="allowedMethods" value="getVersion" /> <parameter name="className" value="org.apache.axis.Version" /> </service> <transport name="http"> <requestFlow> <handler type="URLMapper" /> <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler" /> </requestFlow> </transport> <transport name="local"> <responseFlow> <handler type="LocalResponder" /> </responseFlow> </transport> <!-- 自定义服务 --> <service name="testWebService" provider="java:RPC"> <parameter name="className" value="cn.dreamit.p1001.webservice.service.TestWebService" /> </service> </deployment> ``` springcontext.xml配置如下 ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <context:annotation-config /> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="209715200"></property> <property name="defaultEncoding" value="UTF-8"></property> </bean> <bean id="testWebService" class="cn.dreamit.p1001.webservice.service.impl.TestWebServiceImpl" /> </beans> ``` 报错异常如下 ``` faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.InstantiationException: cn.dreamit.p1001.webservice.service.TestWebService faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:VDN91YQHSK5EG2L java.lang.InstantiationException: cn.dreamit.p1001.webservice.service.TestWebService 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.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796) 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 cn.dreamit.p1001.webservice.test.testGet(test.java:37) at cn.dreamit.p1001.webservice.test.main(test.java:50) ```

webservice 调用 报NoClassDefFoundError错误

一段调用webservice的代码,用main方法能够正常调用。但是在web程序中报包缺失: java.lang.NoClassDefFoundError:org/apache/axis/description/FieldDesc web程序框架是:springmvc+ spring+hibernate的。实在想不通啊。 反编译jar包,那个类也是有的啊

调用webservice,本地调试没问题,放到服务器上就不可以,求解答。急

我是本地生成java代码方式然后放在项目中调用,再本地调试没问题了。 放到服务器上,报这个![图片说明](https://img-ask.csdn.net/upload/201903/20/1553092990_771583.jpg)![图片说明](https://img-ask.csdn.net/upload/201903/20/1553092995_795608.jpg) 然后。代码是这样的![图片说明](https://img-ask.csdn.net/upload/201903/20/1553093133_656050.jpg) 本地和服务器 都可以打印出来 System.out.println(WorkflowServicePortTypeProxy); 但是 服务器下面的信息就 不打印了 没下文了。 求解答 大概是 什么原因。 本地环境和服务器一样啊。

axist2调用webservice服务异常

org.apache.axis2.AxisFault:CX_ST_MATCH_ELEMENT:XSLT exception.System expecte 'Input',使用soapui工具测试XML正常返回,使用RPC客户端调用出现上面的异常,请高手帮忙解决,不甚感激。

关于CXF 客户端的问题,客户端无法获取数据,报错为 前言不允许包含有内容

接到个项目,是要调取另一个公司的接口,接口发过来了,我使用CXF调用接口,返回为前言不允许包含有内容。 询问那边公司,把公司说![图片说明](https://img-ask.csdn.net/upload/201609/29/1475143447_458009.png) IOS调用该接口不能加上这段xml,所以给我的接口都是没有这段xml的,他给了我个有这段xml的接口就是没有问题的,获取数据正常。 请问下 客户端能处理不,能不用这段xml读取数据吗?![图片说明](https://img-ask.csdn.net/upload/201609/29/1475143826_70244.png)

本地运行jar包没问题,但在服务器上运行报数据库连接异常错误

最近在处理公司出差对商旅接口的事,将程序打成JAR包后,在本地运行无误,但是上传到服务器以后报数据库异常错误。 项目使用axis2调用webservice。在cmd里巡行bat文件具体错误如下图:![图片说明](https://img-ask.csdn.net/upload/201608/19/1471573598_962149.jpg) 本地运行图片: ![图片说明](https://img-ask.csdn.net/upload/201608/19/1471573648_955442.jpg) 请问一下有那些情况原因可能造成这种情况(比如防火墙等)。

SpringBoot整合WebService时启动项目报错

Caused by: java.lang.ClassNotFoundException: org.springframework.xml.transform.TransformerObjectSupport at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 73 more 但是在依赖包里能找到这个类: ![图片说明](https://img-ask.csdn.net/upload/201711/27/1511770183_332202.png) 有没有大神教我一下。

axis2的temp目录下有大量的临时文件产生

产生文件夹:axis2-tmp-160947198394530901.tmp 文件夹里面都是axis2的jar文件. 防止时间久了磁盘被沾满, 除了定时删除这些jar文件,还有有其他方法吗?比如修改代码配置文件啥的

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

但是 用 SoapUI 可以正常返回 ,使用Storm 也是返回 设备未就绪.很迷茫 ![图片说明](https://img-ask.csdn.net/upload/201908/04/1564903528_136500.png) ![图片说明](https://img-ask.csdn.net/upload/201908/04/1564903542_573585.png) 然后使用Call.invoke 可以返回了 ,但是缺返回 -3 ,接口对接人说 是一个传入参数值不对 ,然而那个值是一个固定值 ,怎么会不对.

AxisFault 错误 java.lang.NullPointerException

报错行是UserInfo userinfo = (UserInfo) call.invoke(new Object[] {sid,sysno,ip }); ``` AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.NullPointerException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}hostname:xiaoming-PC java.lang.NullPointerException 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 javax.xml.parsers.SAXParser.parse(SAXParser.java:395) 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.asidel.web.webservice.Axis_Client_GetAuths.getAuths(Axis_Client_GetAuths.java:35) at com.asidel.web.controller.IndexController.login(IndexController.java:100) 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.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:100) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:604) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:565) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 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:76) 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:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703) at java.lang.Thread.run(Thread.java:619) ```

org.apache.axis2.AxisFault: 服务器无法处理请求。 ---> 未将对象引用设置到对象的实例。

使用axis2远程访问webservice报错org.apache.axis2.AxisFault: 服务器无法处理请求。 ---> 未将对象引用设置到对象的实例。 wsdl的地址是:http://ws.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl 代码如下: ``` package aixs; 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 TestClient { public static void main(String[] args) throws Exception { System.out.println(testWebService()); } public static String testWebService() throws Exception { String result = null; String srvcUrl = "http://ws.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl"; QName qname = new QName("http://WebXml.com.cn/","getCountryCityByIp"); Object[] param= new Object[] {"42.20.56.23"}; try { RPCServiceClient client = new RPCServiceClient(); Options options = new Options(); options.setTo(new EndpointReference(srvcUrl)); options.setAction("http://WebXml.com.cn/getCountryCityByIp"); client.setOptions(options); Class[] returnTypes = new Class[] { String.class }; // 调用方法并输出该方法的返回值 Object[] response = client.invokeBlocking(qname, param, returnTypes); result=(String) response[0]; } catch (AxisFault e) { e.printStackTrace(); } return result; } } ```

https接口添加信任证书问题

调用别人接口时报错。证书已经添加到jdk cacerts中,jdk1.7,网上说的替换local_policy两个jar也替换过了。还是javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure这个错误。求大神解答,积极急急急,在线等![图片说明](https://img-ask.csdn.net/upload/201708/21/1503291495_860765.png)

求大神解答.。。。。。。。

由于前台要调用后台的jar,我把后台调用webservice打成了jar拱前台使用,后台使用xfire。 集成到前台后,前台有axis2的架包,还有xfire的架包,一调用我那个后台的服务,就报如下的错误,求大神解答: [com.teamsun.interceptor.ExceptionInterceptor] - <[uri=ifront/paymentDoc/payment.do]Exception to intercept the log[id=1592]> org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/axis2/jaxws/description/DescriptionFactory

调用webservices异常处理:org.xml.sax.SAXException:

org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. 可能是我代码的问题,2个参数,最后要取两张数据表,应该怎么获取 现在有一个项目,调用sap发布到webservice的接口:<s:element name="Get_HR_RYKQ"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="inper" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="psw" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="dt_rykq"> <s:complexType> <s:sequence> <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/> <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/> </s:sequence> </s:complexType> </s:element> <s:element minOccurs="0" maxOccurs="1" name="dt_ygcg"> <s:complexType> <s:sequence> <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/> <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> <s:element name="Get_HR_RYKQResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Get_HR_RYKQResult" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="dt_rykq"> <s:complexType> <s:sequence> <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/> <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/> </s:sequence> </s:complexType> </s:element> <s:element minOccurs="0" maxOccurs="1" name="dt_ygcg"> <s:complexType> <s:sequence> <s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/> <s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax"/> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element> </s:schema> </wsdl:types> 自己写的代码: private String url="";//提供接口的地址 private String soapaction=""; //域名,这是在server定义的 public HRPInfo() { String getDate=""; String psw = ""; Service service=new Service(); try{ Call call=(Call)service.createCall(); call.setTargetEndpointAddress(url); call.setOperationName(new QName(soapaction,"Get_HR_RYKQ")); //设置要调用哪个方法 call.setEncodingStyle( null ); call.setProperty( org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE ); call.setProperty( org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE ); call.setSOAPVersion( org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS ); call.addParameter(new QName(soapaction,"inper"), //设置要传递的参数 org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.addParameter(new QName(soapaction,"psw"), //设置要传递的参数 org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.setReturnType(new QName(soapaction,"Get_HR_RYKQ","T_RYKQ"),Vector.class); //要返回的数据类型(自定义类型) call.setUseSOAPAction(true); call.setSOAPActionURI(soapaction + "Get_HR_RYKQ"); Vector v=(Vector)call.invoke(new Object[]{getDate,psw});//调用方法并传递参数 for(int i=0;i<v.size();i++) { System.out.println(v.get(i)); } }catch(Exception ex) { ex.printStackTrace(); } }

为什么 Service service= new Service();

package com.util; import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class WebServiceClient { public static String test(String key,String jsonMsg,String endpoint,String orgid,String type) throws ServiceException, MalformedURLException, RemoteException { try { Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new URL(endpoint)); call.setOperationName("revInsuranceData"); call.setUseSOAPAction(true); String res = (String) call.invoke(new Object[] { id1,type }); decryptStr = eu.getDecryptStr(key, res); System.out.println(decryptStr); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } return decryptStr; } public static void main(String[] args) throws Exception { test( key, jsonMsg, endpoint, orgid, type); } } 使用main测试的时候是没有问题的,当放在tomact下,通过方法调用,就会在Service service = new Service()处卡主,使用try/catch捕获异常,会看到java.lang.reflect.InvocationTargetException,但在控制台并不输出这个错误,各个jar包均已经导入,很迷茫呢。等待着大神。

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c#树形选择 c#中类图的使用方法 c# 传参 调用exe c# 怎么定义方法 c# 修改本地时间 c#前台怎么读取资源文件 c# xml转list c#实现框选截图 m*m乘法表c# c# 乘法99表
立即提问