Tag: axis2

从WSDL生成代码会导致exception

我正在使用Axis2 1.5.1(wsdl2java)从给定的WSDL文件生成代码(客户端存根)。 Web服务由外部应用程序提供。 … RemoteApplication0.xsd的内容如下: 命令行: wsdl2java -ss -g -d adb -or -p com.sampleapp.ws.generated.client -uri SampleRemoteProcess.wsdl 生成过程会导致exception。 堆栈跟踪: Using AXIS2_HOME: C:\develop\axis2-1.5.1-bin\axis2-1.5.1\ Using JAVA_HOME: C:\Program Files\Java\jdk1.6.0_21 Retrieving document at ‘C:\temp\SampleRemoteProcess.wsdl’. Retrieving schema at ‘SampleApp.App.ApplicationManager.RemoteApplication0.xsd’, relative to ‘file:/C:/temp/SampleRemoteProcess.wsdl’. Retrieving schema at ‘SampleApp.App.ApplicationManager.RemoteApplication1.xsd’, relative to ‘file:/C:/temp/SampleRemoteProcess.wsdl’. Retrieving schema at ‘SampleApp.App.ApplicationManager.RemoteApplication2.xsd’, relative to ‘file:/C:/temp/SampleRemoteProcess.wsdl’. Retrieving schema at ‘SampleApp.App.ApplicationManager.RemoteApplication3.xsd’, relative […]

如何使用Axis2 ADB客户端进行基本身份validation?

我正在尝试弄清楚如何使用ADB Axis2 1.5版客户端进行基本身份validation。 我正在尝试以下方法: HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator(); basicAuth.setUsername(username); basicAuth.setPassword(password); final Options clientOptions = serviceStub._getServiceClient().getOptions(); clientOptions.setProperty(HTTPConstants.AUTHENTICATE, basicAuth); 但是这不起作用,并且未添加消息头中所需的行。

使用AXIS2将用户/密码添加到SOAPHeader以进行WebService客户端调用

请帮助:我试图从SOAPUI调用WebService,我注意到该服务需要用户名和密码,我通过请求参数提供。 我注意到原始XML包含添加到SOAPHeader的用户/密码片段。 摘录如下: testusertestpassword&RYadQak91mr7dB+5hyt8yw==2011-10-24T20:13:43.039Z 现在我想通过添加用户/密码详细信息来实现同样的目的,如下面的代码所示:代码片段是: org.tempuri.myService.MyServiceStub stub = new org.tempuri.myService.MyServiceStub(); ServiceClient sc = stub._getServiceClient(); HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername(“testuser”); auth.setPassword(“password$”); sc.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,auth); org.tempuri.myService.MyServiceDocument myService4 = (org.tempuri.myService.MyServiceDocument)getTestObject(org.tempuri.myService.MyServiceDocument.class); MyService lval = MyService4.addNewMyService(); MyServiceParameters lvParams = lval.addNewParameters(); lvParams.setA(“24”); lvParams.setB(“10”); lval.setParameters(lvParams); myService4.setMyService(lval); 但我得到了Axis故障exception,需要帮助我在上面的代码中做错了。 轴故障exception详细信息: org.apache.axis2.AxisFault: Exception occurred while executing service ‘MyService’. 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) […]

如何从Web服务返回XML

这可能是疯狂/愚蠢/愚蠢/冗长的问题之一,因为我是网络服务的新手。 我想写一个Web服务,它将以XML格式返回答案(我正在使用我的服务进行YUI自动完成)。 我正在使用Eclipse和Axis2并关注http://www.softwareagility.gr/index.php?q=node/21我希望以下列格式回复 code元素的数量可能因响应而异。 直到现在我尝试了以下方法 1)使用String缓冲区创建XML并返回字符串。 (我提供部分代码以避免混淆) public String myService () { // Some other stuff StringBuffer outputXML = new StringBuffer(); outputXML.append(“”); outputXML.append(“”); while(SOME_CONDITION) { // Some business logic outputXML.append(“”+””); } outputXML.append(“”); return (outputXML.toString()); } 它使用不需要的和元素提供以下响应。 但它没有使用YUI自动完成(可能是因为它需要上面提到的格式的响应) 2)使用DocumentBuilderFactory : 喜欢 public Element myService () { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); Document doc […]

WstxUnexpectedCharException:DOCTYPE声明中出现意外的字符’“’(代码34);预期公共标识符和系统标识符之间的空格

我试图在最近几天解决以下问题,但仍然无法解决它。 我搜索了很多论坛,但都是徒劳的。 * 一点点历史:我的代码在devp env中运行良好但是为了访问生产服务器,我在成功将证书包含在新的信任库文件中后收到了新的URL和三个新证书。我正面临下面的问题。 请帮忙。 2013-11-25 11:32:30,373 INFO[BuilderUtil] OMException in getSOAPBuilder org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character ‘”‘ (code 34) in DOCTYPE declaration; expected a space between public and system identifiers at [row,col {unknown-source}]:[1,46] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:198) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:154) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:140) at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686) at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) […]

轴2是否自动创建(并保存)wsdl文件?

我有一个使用eclipse / tomcat / axis2运行的Web服务。 我想让它链接到一个bpel进程,所以我需要wsdl文件。 我可以通过启动服务器显示wsdl并转到 http://localhost:8080/axis2/services/MyService?wsdl 但是,如果我搜索项目的目录结构,我找不到wsdl文件。 我当然可以从浏览器中复制并粘贴wsdl并将其保存为文本文件,然后将bpel指向该wsdl。 但似乎轴2会为我生成(并保存)一个wsdl文件,对吧?

运行axis2客户端版本1.5

所以我试图让客户端连接到我正在通过axis2运行的SOAP服务。 我尝试了两种方法,一种是使用wsdl2java来构建存根和关联的客户端类,然后编写一个Client类来构建请求消息并通过Stub发送它们。 另一种方法是使用ServiceClient连接.. 两者都以自己的方式失败了.. 选项#1,每次通过存根发送消息时我都会回复: org.apache.axis2.AxisFault: The input stream for an incoming message is null. at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:87) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) 选项#2,每次我运行它我得到这个例外: org.apache.axis2.deployment.DeploymentException: org.apache.axis2.transport.local.LocalTransportSender 选项#2来源: import javax.xml.stream.XMLStreamException; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.Constants; import org.apache.axis2.client.ServiceClient; public class loyaltyClient { private static […]

常见的日志jar与apache axis soap客户端冲突

我在尝试使用axis调用SOAP webservice时遇到此exception。 基本上我写了一个轴客户端。 org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4JLogFactory does not implement org.apache.commons.logging.LogFactory. 当我删除所有常见的日志记录jar时,我可以删除这些错误,但这些jar子来自其他api,我没有控制它们。 有没有办法克服这个问题?

Axis2 – 日期格式

脚本 由Axis2作为对Web服务客户端的响应输出的日期格式格式为“2009-08-28 + 01:00”。 我想将此更改为仅显示没有时区信息的日期(例如:“2009-08-28”) 组态 图书馆 轴2 1.4.1 WSDL ; 题 是否可以更改Axis 2用于写入日期信息的输出格式? 你能看到.NET客户重新转换这种日期格式有什么问题吗? 约束 遗憾的是,无法将“StartDate”元素更改为xsd:string或xsd:token 问题改进 因为我正在使用定义为的xsd:date XML数据类型 [-]CCYY-MM-DD[Z|(+|-)hh:mm] 因此,如果我设置 Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone(“UTC”); … 然后输出看起来像这样 2009-01-28Z 您可以将“UTC”替换为“GMT”或“”。 我可以摆脱“Z”吗?

Axis2的wsdl2java在RPC /编码样式的Web服务上失败

Axis2还有其他选择吗? 或者让它工作的方式(例如,不同的数据绑定)? Retrieving document at ‘…’. Exception in thread “main” org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271) at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53) at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224) … 2 more Caused by: java.lang.reflect.InvocationTargetException 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.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50) … 3 more Caused by: org.apache.axis2.schema.SchemaCompilationException: can not find type {http://schemas.xmlsoap.org/soap/encoding/}Array […]