antgan / wx-tools Goto Github PK
View Code? Open in Web Editor NEWWx-tools是基于微信公众平台API的轻量级框架。 基于Wx-tools你可以开速开发一个订阅号/服务号的web应用后台。
Wx-tools是基于微信公众平台API的轻量级框架。 基于Wx-tools你可以开速开发一个订阅号/服务号的web应用后台。
能不能把代码加上注释?这样读起来会方便好多哦。
消息:
WxXmlMessage [toUserName=gh_3e1cb3821704, fromUserName=otOgp0S8Kr36_CjxpqVE05AjVy88, createTime=1502460972, msgType=text, content=解决了, msgId=6453020738670604822, picUrl=null, mediaId=null, format=null, thumbMediaId=null, locationX=null, locationY=null, scale=null, label=null, title=null, description=null, url=null, event=null, eventKey=null, ticket=null, latitude=null, longitude=null, precision=null, recognition=null, expiredTime=null, failTime=null, failReason=null, status=null, totalCount=null, filterCount=null, sentCount=null, errorCount=null, scanCodeInfo=null, sendPicsInfo=null, sendLocationInfo=null]
com.soecode.wxtools.exception.WxErrorException: 根目录找不到文件
at com.soecode.wxtools.api.WxConfig.(WxConfig.java:41)
at com.soecode.wxtools.api.WxConfig.getInstance(WxConfig.java:77)
at com.soecode.wxtools.api.WxService.getAccessToken(WxService.java:113)
at com.soecode.wxtools.api.WxService.getAccessToken(WxService.java:105)
at com.soecode.wxtools.servlet.DemoServlet.doPost(DemoServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Unknown Source)
at java.util.Properties.load0(Unknown Source)
at java.util.Properties.load(Unknown Source)
at com.soecode.wxtools.api.WxConfig.(WxConfig.java:47)
at com.soecode.wxtools.api.WxConfig.getInstance(WxConfig.java:77)
at com.soecode.wxtools.api.WxService.getAccessToken(WxService.java:113)
at com.soecode.wxtools.api.WxService.getAccessToken(WxService.java:105)
at com.soecode.wxtools.servlet.DemoServlet.doPost(DemoServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
群发接口中返回值转对象可能有BUG,可能没法正确从JSON转对象。
近期会修复。
如果其他接口没有得到预想的返回值,麻烦提出以下~谢谢~~
这里设置type的时候必须小写 大写报错 errcode=65318
btn2.setName("跳转授权页面");
btn2.setType("view");
btn2.setUrl("http://www.baidu.com");
xfshxzs 这个项目导入wx-tools
正在修复……
`// 微信服务器推送过来的是XML格式。
WxXmlMessage wx=XStreamTransformer.fromXml(WxXmlMessage.class,request.getInputStream());
System.out.println(wx.getContent());
Log.info("消息:\n " + wx.toString());`
我打印request.getInputStream()是内容的,你这个 WxXmlMessage wx怎么没有内容??
感谢群成员:空指针 指出问题。
问题描述:outxmlbuilder里的MusicBuilder的泛型写错,写成VideoBuilder,应该为MusicBuilder。
问题状态:在2.1.2版本已修复。
做网页授权时,参考微信文档获取到授权URL后,用户点击URL,进入redirect_uri,调用了wx-tools api的iService.oauth2ToGetAccessToken("code");报错
WxXmlOutNewsMessage
NewsBuilder newsBuilder = WxXmlOutMessage.NEWS();
定义多条item 在微信中只显示一条数据!
按钮设置似乎没有设置utf-8,报错了
RT
XStream xstream = new XStream(new XppDriver()
初始化的地方用XppDriver会报错Cannot create XmlPullParser
应该用XStream xstream = new XStream(new DomDriver())
我注意到每次调用一下wx-tools里面的方法就会update一下里面的accessToken,但是微信是有调用限制的,怎么解决呢?
我的想法是通过redis来缓存accessToken,redis可以设置该值的过期时间,如果redis里面的被销毁了,那就获取新的accessToken,然后存储到redis中并使用
当前遇到的问题:
多appid 使用时,获取的token仍然不同 如何修改动态设置wxConfig 里面的属性,并且让其生效
/**
* 临时二维码
*/
public static final String QR_CODE_LIMIT_SCENE = "QR_STR_SCENE";
WxError [errcode=40008, errmsg=invalid message type hint: [dfADbHnre-FAulHa] rid: 5f262df9-570cfb10-583bdc4f]
1)WxService.unifiedOrder @deprecated过期函数的替代方案是什么?
2)微信支付的DEMO啥时候出?这个比音乐爬虫受众多多了。
调试发现是XStreamTransformer.CLASS_2_XSTREAM_INSTANCE 中未包含此类导致
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.