axis 调用webservice接口报错 10C

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)

2个回答

看一下需要传的参数是不是都传了,传的有没有问题,地址等等

这个错误应该是调用方法的时候回调错误,at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
MustUnderstandChecker.java:62看一下,这个一行。
还有个思路,直接http调用就可以了,没必要webservice了,现在都流行直接http调用就可以。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
jboss5环境下,cxf和axis调用webservice客户端都是不报错,不返回结果
有谁碰到过这种问题,cxf和axis调用webservice没问题,部署到jboss5里面就有问题, 不报错,不返回结果
基于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
用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) ```
基于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报错
有两个虚拟机,称为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的服务就报以上错误,如果一直报错也说的过去,只是在很偶然的情况下会调成功那么一次,本人折腾了两天了实在是没招了,有谁碰到过类似的问题希望可以给予帮助 ``` ```
axis2 webservice访问报错,下标越界
使用axis2做webservice。服务可以正常发布,在使用一个类调用服务时服务端报数组下标越界,谁可以帮忙解答一下。 服务端:public String createContract(String json){ return "aa"; } 客户端: try { call = (Call) service.createCall(); call.setTargetEndpointAddress(url); call.setOperationName(new QName(schema,"createContract")); call.addParameter("json", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); call.setUseSOAPAction(true); Object[] obj = new Object[1]; obj[0]="zhangsan"; call.invoke(obj); } catch (ServiceException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } ![图片说明](https://img-ask.csdn.net/upload/201605/24/1464073511_868786.png)
调用webservice接口,call.setOperationName的参数问题
本人刚开始用webservice,很多不懂,还望大神赐教啊,拜谢 我用Java调用webservice接口,用的是org.apache.axis包的类,关键代码如下: Call call = null; try { call = (Call)service.createCall(); call.setTargetEndpointAddress(new URL("http://localhost:8081/UserService?wsdl")); call.setProperty("axis.connection.timeout", new Integer(3600000)); call.setTimeout(new Integer(3600000)); //call.setOperationName(new javax.xml.namespace.QName("http://webservice.web.demo.com/", "queryUsers")); //用这句可以正常调用 call.setOperationName("queryUsers");//用这句就报错说找不到匹配的方法 Object res=call.invoke(new Object[]{}); PrintWriter out = response.getWriter(); out.println(res); }catch (Exception e) { e.printStackTrace(); } 其中,call.setOperationName的时候如果指定QName的namespaceURL和方法名就可以正常调用,如果不指定namespaceURL只写方法名就报错说找不到匹配的方法。我就想知道指定namespace和不指定有什么区别啊?什么时候可以不指定namespaceURL?我查了网上的代码,很多都直接写方法名没指定namespace呀。实在困惑,摆脱摆脱了
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)
eclipse的webservice时报文提示,请求的函数不合法
用axis调用webservice时,地址一开始我加了?wsdl提示bad envelop tag,后来我去掉了?wsdl,再访问报错:请求的函数不合法
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
webService接口调用失败
我是这样调用客户提供的接口的 ``` public List<Task> getOperationSystemData(Long userId) { String url = AppContext.getSystemProperty("anhui.webService.url"); Object[] response = null; try{ EndpointReference targetEPR = new EndpointReference(url); RPCServiceClient serviceClient = new RPCServiceClient(); GetNewTasks parm = new GetNewTasks(); parm.setUserID(String.valueOf(userId)); Object[] opAddArgs = new Object[]{parm.getUserID()}; Options options = serviceClient.getOptions(); options.setTo(targetEPR); QName opAdd =new QName("http://www.ustcsoft.com","getNewTasks"); Class[] returnTypes = new Class[] {Root.class}; response = serviceClient.invokeBlocking(opAdd,opAddArgs,returnTypes); }catch(Exception e){ log.info("获取业务系统待办异常", e); } ``` 但一直报错: ``` org.apache.axis2.AxisFault: Unmarshalling Error: unexpected element (uri:"", local:"arg0"). Expected elements are <{}UserID> at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531) ``` google后给的答案是在方法参数中加@webParam(name="",targetNamespace="http://www.ustcsoft.com"),这样做了,还是没用,求大神指点
在oracle 11g 中使用utl_dbws包调用webservice报错,跪求大神帮忙!
webservice的wsdl文件内容如下 ``` <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://e3.org/projectws/soapws" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://e3.org/projectws/soapws"> <wsdl:documentation>projectws</wsdl:documentation> <wsdl:types> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://e3.org/projectws/soapws"> <xs:element name="login"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="loginName" nillable="true" type="xs:string"/> <xs:element minOccurs="0" name="password" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="loginResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="unimethod"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="sessionId" nillable="true" type="xs:string"/> <xs:element minOccurs="0" name="funccode" nillable="true" type="xs:string"/> <xs:element minOccurs="0" name="args" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="unimethodResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </wsdl:types> <wsdl:message name="unimethodRequest"> <wsdl:part name="parameters" element="ns:unimethod"/> </wsdl:message> <wsdl:message name="unimethodResponse"> <wsdl:part name="parameters" element="ns:unimethodResponse"/> </wsdl:message> <wsdl:message name="loginRequest"> <wsdl:part name="parameters" element="ns:login"/> </wsdl:message> <wsdl:message name="loginResponse"> <wsdl:part name="parameters" element="ns:loginResponse"/> </wsdl:message> <wsdl:portType name="projectwsPortType"> <wsdl:operation name="unimethod"> <wsdl:input message="ns:unimethodRequest" wsaw:Action="urn:unimethod"/> <wsdl:output message="ns:unimethodResponse" wsaw:Action="urn:unimethodResponse"/> </wsdl:operation> <wsdl:operation name="login"> <wsdl:input message="ns:loginRequest" wsaw:Action="urn:login"/> <wsdl:output message="ns:loginResponse" wsaw:Action="urn:loginResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="projectwsSoap11Binding" type="ns:projectwsPortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="unimethod"> <soap:operation soapAction="urn:unimethod" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="login"> <soap:operation soapAction="urn:login" 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="projectwsSoap12Binding" type="ns:projectwsPortType"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="unimethod"> <soap12:operation soapAction="urn:unimethod" style="document"/> <wsdl:input> <soap12:body use="literal"/> </wsdl:input> <wsdl:output> <soap12:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="login"> <soap12:operation soapAction="urn:login" style="document"/> <wsdl:input> <soap12:body use="literal"/> </wsdl:input> <wsdl:output> <soap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="projectwsHttpBinding" type="ns:projectwsPortType"> <http:binding verb="POST"/> <wsdl:operation name="unimethod"> <http:operation location="unimethod"/> <wsdl:input> <mime:content type="application/xml" part="parameters"/> </wsdl:input> <wsdl:output> <mime:content type="application/xml" part="parameters"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="login"> <http:operation location="login"/> <wsdl:input> <mime:content type="application/xml" part="parameters"/> </wsdl:input> <wsdl:output> <mime:content type="application/xml" part="parameters"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="projectws"> <wsdl:port name="projectwsHttpSoap11Endpoint" binding="ns:projectwsSoap11Binding"> <soap:address location="http://192.168.68.32:8080/projectws/services/projectws.projectwsHttpSoap11Endpoint/"/> </wsdl:port> <wsdl:port name="projectwsHttpSoap12Endpoint" binding="ns:projectwsSoap12Binding"> <soap12:address location="http://192.168.68.32:8080/projectws/services/projectws.projectwsHttpSoap12Endpoint/"/> </wsdl:port> <wsdl:port name="projectwsHttpEndpoint" binding="ns:projectwsHttpBinding"> <http:address location="http://192.168.68.32:8080/projectws/services/projectws.projectwsHttpEndpoint/"/> </wsdl:port> </wsdl:service> </wsdl:definitions> ``` oracle的函数内容如下: ``` CREATE OR REPLACE FUNCTION get_session (loginName IN VARCHAR2, loginPassword IN VARCHAR2) RETURN VARCHAR2 AS l_service UTL_DBWS.service; l_call UTL_DBWS.call; l_wsdl_url VARCHAR2(32767); l_namespace VARCHAR2(32767); l_service_qname UTL_DBWS.qname; l_port_qname UTL_DBWS.qname; l_operation_qname UTL_DBWS.qname; l_xmltype_in SYS.XMLTYPE; l_xmltype_out SYS.XMLTYPE; l_return VARCHAR2(32767); l_loginName UTL_DBWS.qname; l_loginPassword UTL_DBWS.qname; BEGIN l_wsdl_url := 'http://192.168.68.32:8080/projectws/services/projectws?wsdl'; l_namespace := 'http://e3.org/projectws/soapws'; l_service_qname := UTL_DBWS.to_qname(l_namespace, 'projectws'); l_port_qname := UTL_DBWS.to_qname(l_namespace, 'projectwsHttpSoap12Endpoint'); l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'login'); l_service := UTL_DBWS.create_service ( wsdl_document_location => HttpUriType(l_wsdl_url), service_name => l_service_qname); l_call := UTL_DBWS.create_call ( service_handle => l_service, port_name => l_port_qname, operation_name => l_operation_qname); UTL_DBWS.set_property(l_call, 'SOAPACTION_USE', 'TRUE'); UTL_DBWS.set_property(l_call, 'SOAPACTION_URI', 'login'); UTL_DBWS.set_property(l_call, 'ENCODINGSTYLE_URI','http://schemas.xmlsoap.org/soap/encoding/'); UTL_DBWS.set_property(l_call, 'OPERATION_STYLE', 'document'); l_loginName := UTL_DBWS.to_qname(l_namespace, loginName); l_loginPassword := UTL_DBWS.to_qname(l_namespace, loginPassword); UTL_DBWS.add_parameter(l_call, 'loginName', l_loginName, 'ParameterMode.IN'); UTL_DBWS.add_parameter(l_call, 'password', l_loginPassword, 'ParameterMode.IN'); UTL_DBWS.set_return_type(l_call, l_loginName); l_xmltype_in := SYS.XMLType('<?xml version="1.0" encoding="utf-8"?>' || '<login xmlns="' || l_namespace || '">' || '<loginName>wstest</loginName>' || '<password>123456</password>' || '</login>'); l_xmltype_out := UTL_DBWS.invoke(l_call,l_xmltype_in); UTL_DBWS.release_call (l_call); UTL_DBWS.release_service (l_service); l_return := l_xmltype_out.getStringVal(); RETURN l_return; --EXCEPTION --WHEN OTHERS THEN -- return sqlerrm;-- 返回错误信息 END; ``` 执行结果如下,报错: ![图片说明](https://img-ask.csdn.net/upload/201703/08/1488964201_377630.png) 用官网的例子在本地跑是可以调用成功的,调用公司项目的web service接口时报错。网上资料比较少,这个问题已经搞了两三天了,要哭,跪求大神帮忙!感激不尽
java调用webservice payload方式,求大佬哪个大佬看看
java调用webservice代码片段 ``` StreamSource xmlSource = new StreamSource(new StringReader(soapBody)); URL wsdlURL = new URL(wsdlUrl); QName serviceQName = new QName(targetNamespace, serviceName); Service service = Service.create(wsdlURL, serviceQName); //创建port端口及 Dispatch<Source>对像 QName portQName = new QName(targetNamespace, portName); Dispatch<Source> dispatch = service.createDispatch(portQName, Source.class, Service.Mode.PAYLOAD); Source orderSource = dispatch.invoke(xmlSource); ``` 走到这一步 Source orderSource = dispatch.invoke(xmlSource); 报错: javax.xml.ws.WebServiceException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,57] Message: http://www.w3.org/TR/1999/REC-xml-names-19990114#ElementPrefixUnbound?soapenv&soapenv:Envelope at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70) at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128) at org.apache.axis2.jaxws.message.impl.MessageImpl.getAsSOAPMessage(MessageImpl.java:328) at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.getBodyElementQNameFromDispatchMessage(BaseDispatch.java:403) at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.getOperationDescriptionForDispatch(BaseDispatch.java:266) at org.apache.axis2.jaxws.client.dispatch.BaseDispatch.invoke(BaseDispatch.java:189) at cn.linkey.rulelib.S017.R_S017_B001.run(R_S017_B001.java:67) at cn.linkey.rule.ExecuteEngine.run(ExecuteEngine.java:34) at cn.linkey.rule.ExecuteEngine.run(ExecuteEngine.java:49) at cn.linkey.servlet.Action.run(Action.java:165) at cn.linkey.servlet.Action.doGet(Action.java:23) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) 不知道什么原因,用TEST跑这段代码没问题
java调用远程webservice服务报错,需要忽略证书认证,急,求各位大神帮帮忙!
//调用方法 public String callServiceEsbGFY(BsServiceDict bsdVo, String custIdValue, Map<String, Object> servParam) throws SysException, AppException { System.out.println("servParam"+servParam.toString()); String retMsg = null; String soapActionURI = "http://tempuri.org/selectVIN"; //处理入参 String str="<?xml version=\"1.0\" encoding=\"gb2312\"?><rows><row "; Set<String> keys = servParam.keySet(); if(keys != null) { Iterator<String> iterator = keys.iterator(); while(iterator.hasNext()) { String key =iterator.next(); str=str+"\""+key+"\""+"="+"\""+servParam.get(key)+"\""+" "; } str=str+"></row></rows>"; } String endpoint =bsdVo.getServiceAddress(); String methodStr = bsdVo.getMethodName(); String input = bsdVo.getInParam(); try { input=input.replace(Constants.STRING_CHARACTER_GFY, str); System.out.println(input); //System.out.println("trustAllHttpsCertificates"); /*trustAllHttpsCertificates(); HttpsURLConnection.setDefaultHostnameVerifier(hv);*/ //trustAllHosts(); AxisProperties.setProperty("axis.socketSecureFactory","com.bbcare.comm.MySocketFactory");//注意包名 System.out.println("测试中"); org.apache.axis.client.Service service = new org.apache.axis.client.Service(); Call call = (Call) service.createCall(); String endpoint1 ="https://esbouter.ipmch.com/ESBOuterService.asmx"; call.setOperationName(new QName( endpoint1 , methodStr)); call.setUseSOAPAction(true); call.setSOAPActionURI(soapActionURI); //call.addParameter("username", XMLType.XSD_STRING, ParameterMode.IN); //URL realUrl =new java.net.URL(endpoint); call.setTargetEndpointAddress (new java.net.URL(endpoint)); retMsg = (String) call.invoke(new Object[] {input} ); } catch (Exception e) { retMsg = "10000"; e.printStackTrace(); throw new SysException("","XmlException:OrderReceive.buildOrderReceiveXML():"+e.getMessage(),e); } return retMsg; }
axis 开发webservice问题
<p>最近研究axis的webservice 有个位搞不定 ,卡啦一天发出来请大家帮忙解决下! <br>是这样,service端我都配好了,deploy.wsdd的文件如下:</p> <pre name="code" class="java"></pre> <p> </p> <pre name="code" class="java">&lt;deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"&gt; &lt;service name="HelloWord" provider="java:RPC"&gt; &lt;parameter name="className" value="resunly.service.HelloWord" /&gt; &lt;parameter name="allowedMethods" value="*" /&gt; &lt;/service&gt; &lt;/deployment&gt; </pre> <p> </p> <p>在cmd 下也生成啦 相应的 server-config.wsdd 文件,然后写类:HelloWrod 代码如下:</p> <pre name="code" class="java">package resunly.service; public class HelloWrod { public HelloWrod(){ } public String hello(String name){ return "hello"+name; } public int getNum(int num,int end){ return num+end; } } </pre> <p> </p> <p> </p> <p>并将此类生成的class文件放到了E:\Program\tomcat\apache-tomcat-6.0.18\webapps\axis\WEB-INF\classes\resunly\service 下,客户端的的调用代码如下:</p> <pre name="code" class="java">package resunly.client; import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class TestWebService { /** * @param args */ public static void main(String[] args) { String SeverAdd = "http://localhost:8080/axis/resunly/service/HelloWord"; Service service = new Service(); try { Call call = (Call) service.createCall(); call.setTargetEndpointAddress(new URL(SeverAdd)); // call.setOperationName(new QName(SeverAdd,"hello")); // String result = (String)call.invoke(new Object[]{"resunly"}); // System.out.println(result); call.setOperationName(new QName(SeverAdd,"getNum")); Integer res = (Integer)call.invoke(new Object[]{new Integer(1),new Integer(3)}); System.out.println(res); } catch (ServiceException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } } } </pre> <p> </p> <p>然后,run 就报错!报错内容如下:</p> <pre name="code" class="java">AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (404)Not Found faultActor: faultNode: faultDetail: {}:return code: 404 &amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Apache Tomcat/6.0.18 - Error report&amp;lt;/title&amp;gt;&amp;lt;style&amp;gt;&amp;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;}--&amp;gt;&amp;lt;/style&amp;gt; &amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 404 - /axis/resunly/service/HelloWord&amp;lt;/h1&amp;gt;&amp;lt;HR size=&amp;quot;1&amp;quot; noshade=&amp;quot;noshade&amp;quot;&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;type&amp;lt;/b&amp;gt; Status report&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;message&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;/axis/resunly/service/HelloWord&amp;lt;/u&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;description&amp;lt;/b&amp;gt; &amp;lt;u&amp;gt;The requested resource (/axis/resunly/service/HelloWord) is not available.&amp;lt;/u&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;HR size=&amp;quot;1&amp;quot; noshade=&amp;quot;noshade&amp;quot;&amp;gt;&amp;lt;h3&amp;gt;Apache Tomcat/6.0.18&amp;lt;/h3&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;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 resunly.client.TestWebService.main(TestWebService.java:29)</pre> <p> 提示是在   Integer res = (Integer)call.invoke(new Object[]{new Integer(1),new Integer(3)});<br>这里报的错 ,上面注释的也是在这里报的错,不知道为什么 ,卡啦半天搞不定啦 ,求指点 ,感激不尽!</p> <p> </p>
调用webservice,出现了java.net.NoRouteToHostException异常
http://ip地址:8000/xfire_service_zongzhan/services/intendance?wsdl 已经把webservice放到了外网上的服务器了。上面这个路径我是可以直接访问到的,浏览器可以看到xml文件的。 然后我根据这个url生成了客户端类,用来调用webservice的。如下: D:\generateAxisClient>Java -Djava.ext.dirs=lib org.apache.axis.wsdl.WSDL2Java http://211.147.247.85:8000/xfire_service_zongzhan/services/intendance?wsdl 我是在cmd上执行的,使用了[color=#FF0000]axis[/color]的WSDL2Java来生成webservice的客户端的。 现在我用生成的客户端去调用webservice,但是报错了。 如下: java.net.NoRouteToHostException: No route to host: connect 这样的话,就无法把数据从本地传到服务器上了。 出现了这种情况后,我首先是ping一下放有webservice的服务器,是ping不通的,原因是 公司是通过代理的方式上网的,所以我直接ping不通了。 而之前的uri可以访问是因为浏览器使用了代理,所以可以访问到服务器。 想要问的问题是: 生成webservice的客户端有几种方式,我目前这种使用命令形式的生成的客户端中有 XfireServiceHttpBindingStub这样一个类。似乎是静态的方式调用webservice。 是不是应该换成动态代理方式或者其他方式呢? 要是客户那边是使用代理的方式上网的,应该如何写客户端,才可以把数据传到服务器上呢? 请指导一下。
eclipse 生产webservice客户端代码 调用报错 求解答
报错内容: AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (0)null faultActor: faultNode: faultDetail: {}:return code: 0 {http://xml.apache.org/axis/}HttpErrorCode:0 (0)null 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.power.prophase.webservice.impl.QueryDemanplanServiceImplPortBindingStub.queryDemanplanInfo(QueryDemanplanServiceImplPortBindingStub.java:107) at com.dlc.webserviceTestClient.Client.main(Client.java:36)
java调用wsdl接口报空指针
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: java.lang.NullPointerException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace: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 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.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 nc.itf.tjitfrec.itfreceive.pub.IDataReceive.IDataReceiveSOAP11BindingStub.billReceive(IDataReceiveSOAP11BindingStub.java:156) at nc.itf.tjitfrec.itfreceive.pub.IDataReceive.IDataReceivePortTypeProxy.billReceive(IDataReceivePortTypeProxy.java:52) at choice.service.nc63webservice.Nc63webservice.nc63webservice(Nc63webservice.java:15) at choice.service.bohnc63.BohNc63DbIn.supplyacctdbin(BohNc63DbIn.java:152) at choice.service.bohnc63.BohNc63DbIn.&lt;init&gt;(BohNc63DbIn.java:45) at choice.timing.bohnc63.AutoBohNc63.abn63(AutoBohNc63.java:46) at choice.timing.general.GeneralServlet$3.run(GeneralServlet.java:115) {http://xml.apache.org/axis/}hostname:MaZhen 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 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.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 nc.itf.tjitfrec.itfreceive.pub.IDataReceive.IDataReceiveSOAP11BindingStub.billReceive(IDataReceiveSOAP11BindingStub.java:156) at nc.itf.tjitfrec.itfreceive.pub.IDataReceive.IDataReceivePortTypeProxy.billReceive(IDataReceivePortTypeProxy.java:52) at choice.service.nc63webservice.Nc63webservice.nc63webservice(Nc63webservice.java:15) at choice.service.bohnc63.BohNc63DbIn.supplyacctdbin(BohNc63DbIn.java:152) at choice.service.bohnc63.BohNc63DbIn.<init>(BohNc63DbIn.java:45) at choice.timing.bohnc63.AutoBohNc63.abn63(AutoBohNc63.java:46) at choice.timing.general.GeneralServlet$3.run(GeneralServlet.java:115) 调用时报这个错,哪位大神指导一下啊?
springCloud项目使用jws开发webservice接口出错的问题,请求大神帮忙
# test类 ``` @WebService @Service public class test{ @Autowired InfDictionaryService infDictionaryService ; @WebMethod(action="execute") public String execute(@WebParam(name = "xmlStr")String xmlStr) { String result = ""; try { result = infDictionaryService.synSalesMsg(xmlStr); } catch (Exception e) { e.printStackTrace(); } System.out.println("返回报文:"+result); return result; } } ``` # 发布服务的类 ``` @Configuration public class BeforeStartUp implements ApplicationListener<ContextRefreshedEvent>{ @Autowired private test testService; private static String address = "http://127.0.0.1:80/ttt"; private static int num =0; @Override public void onApplicationEvent(ContextRefreshedEvent event) { if(num == 0){ Endpoint.publish(address,testService); num ++; } } } ``` # 另一个项目调用webService接口报错,代码如下: ``` public class test { public static void main(String[] args) throws ServiceException{ String wsdl = "http://127.0.0.1:80/ttt?wsdl"; String synSalesMsgXml = "测试数据!"; Service service = new Service(); Call call = (Call) service.createCall(); try { call.setTargetEndpointAddress(wsdl); call.setOperationName("execute"); call.addParameter("xmlStr", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); Object[] paramValues = new Object[] {synSalesMsgXml}; String result = (String) call.invoke(paramValues); System.out.println("result is " + result); } catch (Exception e) { e.printStackTrace(); } } } ``` # 报错信息如下 AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: 找不到{http://127.0.0.1:80/ttt?wsdl}execute的分派方法 faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:找不到{http://127.0.0.1:80/ttt?wsdl}execute的分派方法 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 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1783) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970) 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:118) 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:643) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) 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 test.main(test.java:67) {http://xml.apache.org/axis/}hostname:MACHENI-S6PC008 找不到{http://127.0.0.1:80/ttt?wsdl}execute的分派方法 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 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1783) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970) 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:118) 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:643) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) 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 test.main(test.java:67)
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
【图解经典算法题】如何用一行代码解决约瑟夫环问题
约瑟夫环问题算是很经典的题了,估计大家都听说过,然后我就在一次笔试中遇到了,下面我就用 3 种方法来详细讲解一下这道题,最后一种方法学了之后保证让你可以让你装逼。 问题描述:编号为 1-N 的 N 个士兵围坐在一起形成一个圆圈,从编号为 1 的士兵开始依次报数(1,2,3…这样依次报),数到 m 的 士兵会被杀死出列,之后的士兵再从 1 开始报数。直到最后剩下一士兵,求这个士兵的编号。 1、方...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
GitHub标星近1万:只需5秒音源,这个网络就能实时“克隆”你的声音
作者 | Google团队 译者 | 凯隐 编辑 | Jane 出品 | AI科技大本营(ID:rgznai100) 本文中,Google 团队提出了一种文本语音合成(text to speech)神经系统,能通过少量样本学习到多个不同说话者(speaker)的语音特征,并合成他们的讲话音频。此外,对于训练时网络没有接触过的说话者,也能在不重新训练的情况下,仅通过未知...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC...
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下...
【管理系统课程设计】美少女手把手教你后台管理
【文章后台管理系统】URL设计与建模分析+项目源码+运行界面 栏目管理、文章列表、用户管理、角色管理、权限管理模块(文章最后附有源码) 1. 这是一个什么系统? 1.1 学习后台管理系统的原因 随着时代的变迁,现如今各大云服务平台横空出世,市面上有许多如学生信息系统、图书阅读系统、停车场管理系统等的管理系统,而本人家里就有人在用烟草销售系统,直接在网上完成挑选、购买与提交收货点,方便又快捷。 试想,若没有烟草销售系统,本人家人想要购买烟草,还要独自前往药...
4G EPS 第四代移动通信系统
目录 文章目录目录4G 与 LTE/EPCLTE/EPC 的架构E-UTRANE-UTRAN 协议栈eNodeBEPCMMES-GWP-GWHSSLTE/EPC 协议栈概览 4G 与 LTE/EPC 4G,即第四代移动通信系统,提供了 3G 不能满足的无线网络宽带化,主要提供数据(上网)业务。而 LTE(Long Term Evolution,长期演进技术)是电信领域用于手机及数据终端的高速无线通...
相关热词 c# clr dll c# 如何orm c# 固定大小的字符数组 c#框架设计 c# 删除数据库 c# 中文文字 图片转 c# 成员属性 接口 c#如何将程序封装 16进制负数转换 c# c#练手项目
立即提问