Tag: wsdl2java

注释CXF(wsdl2java)生成的包

我需要添加包级别注释(XmlJavaTypeAdapters类型适配器)。 问题是,当我运行wsdl2java时,它会为该包生成package-info.java文件。 当我尝试添加自己的package-info.java时,我收到错误:“类型package-ingo已经定义”。 有没有办法将我的注释注入package-info.java? 也许还有其他想法吗? 谢谢

创建Web服务客户端时,没有主题备用名称存在exception

我想使用wsdl2java实用程序创建一个Web服务客户端。 我必须通过SSL连接到此服务器 这个wsdl看起来像这样: https://xxx.xx.xx.xx:8443/api/wsdl/xxxxxxx.wsdl 我使用以下方法生成证书: openssl s_client -connect xxx.xx.xx.x:8443 abcCertificate.pem 并使用以下命令将其添加到密钥库: keytool -import -noprompt -trustcacerts -alias testcert -file abcCertificate.pem -keystore /usr/java/jdk1.7.0_06/jre/lib/security/cacerts -ext san=ip:xxx.xx.xx.xx 当我尝试使用wsdl2java创建Web服务客户端时,它会抛出exception : javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present 我使用此链接中的这些信息。

如何使用WSDL2Java生成的文件?

我使用在axis2-1.5中找到的wsdl2java生成了.java文件。 现在它生成了这个文件夹结构中的文件:src / net / mycompany / www / services / services文件夹中的文件是:SessionIntegrationStub和SessionIntegrationCallbackHandler。 我现在想要使用web服务。 我将net文件夹添加到CLASSPATH环境变量中。 我的java文件现在使用以下方法导入webservice: import net.mycompany.www.services; public class test { public static void main(String[] args) { SessionIntegrationStub stub = new SessionIntegrationStub(); System.out.println(stub.getSessionIntegration(“test”)); } } 现在当我尝试使用以下方法编译时: javac test.java 我得到:包net.mycompany.www不存在。 任何想法?

从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 […]

Axis Marshaller

我有一组使用wsdl2java(Axis 1.4)创建的类,我正在寻找一种方法来解组和编组来自/到String和Object的数据。 我编写了一个JAXB unmarshaller,它适用于我们的一些较新的内部对象,因为我们使用xjc来创建类但没有时间转换旧的轴类,需要为代码找到一个marshal / unmarshal解决方案。 。 请有人指点我的方向。 谢谢!

如何在pom.xml中为wsdl2java指定前端?

我找到了关于将-fe jaxws21添加到wsdl2java命令以使其生成jaxws 2.1兼容代码而不是2.2的重要提示,但Maven的pom.xml似乎不喜欢这样的添加: wsdl2java -fe jaxws21 为pom.xml中使用的wsdl2java指定前端的正确方法是什么?

在会话中存储Axis原始XML请求/响应(将在JSP中使用)

如果可能,如何获取Axis在我的应用程序中调用/检索的原始XML请求/响应? 我正在使用Axis附带的WSDL2Java来生成Java存根。 编辑: 我目前拥有的是一个使用Axis处理远程API调用的应用程序。 其中一个要求是在会话中“存储”来自这些调用的所有XML请求/响应,以便它在JSP中可用(用于调试目的)。 我怎样才能做到这一点? 我尝试编写一个extends BasicHandler的自定义处理程序,但在该处理程序中,我仍然无法从MessageContext获取HttpServletRequest / HttpServletResponse对

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 […]

将自定义Soap标头添加到Webservice请求

我已经使用apache axis2为webserivce生成了存根,我想在请求中添加自定义soap标头我希望soap header看起来像这样 myusermypass 我正在写这段代码 org.apache.axiom.soap.SOAPEnvelope env = null; org.apache.axiom.om.OMFactory omFactory = org.apache.axiom.om.OMAbstractFactory.getOMFactory(); org.apache.axiom.om.OMElement omElement = omFactory.createOMElement(new javax.xml.namespace.QName(“urn:oasis:names:core”, “soapHeader”, “ns1”)); org.apache.axiom.om.OMElement omElement1 = omFactory.createOMElement(new javax.xml.namespace.QName(“urn:oasis:names:core”, “Username”, “ns1”)); org.apache.axiom.om.OMElement omElement2 = omFactory.createOMElement(new javax.xml.namespace.QName(“urn:oasis:names:core”, “Password”, “ns1”)); omElement.addChild(omElement1); omElement.addChild(omElement2); omElement1.setText(“myuser”); omElement2.setText(“mypass”); addHeader(omElement,env); 但我没有得到必需的肥皂头,这是我得到的 myuser 因为你可以看到密码丢失,我想知道我做错了什么

Axis2生成的Stub是线程安全的吗?

是通过Axis2 1.5.4线程安全的WSDL2JAVA(使用XMLBeans绑定选项)生成的存根吗? 实际上我已经为我通过多个线程调用的Web服务创建了一个Stub。 我已经配置了我自己的MultiThreadedHttpConnectionmanager并设置了HTTPConstants.REUSE_HTTP_CLIENT ,但我在stub._getServiceClient().cleanupTransport看到了一些NullPointerExceptions stub._getServiceClient().cleanupTransport每次调用后调用的stub._getServiceClient().cleanupTransport 。 有时线程也会挂起。 同时我注意到在Web Service操作方法中生成的Stub中,在finally块中已经调用了cleanup()。 我不应该之后调用stub._getServiceClient().cleanupTransport吗? 我的代码: httpConnMgr = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams params = httpConnMgr.getParams(); if (params == null) { params = new HttpConnectionManagerParams(); } params.setDefaultMaxConnectionsPerHost(numberOfThreads); httpConnMgr.setParams(params); HttpClient httpClient = new HttpClient(httpConnMgr); service = new Service1Stub(this.endPointAddress); service._getServiceClient().getOptions() .setTimeOutInMilliSeconds(this.timeOut); service._getServiceClient().getOptions() .setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE); service._getServiceClient().getOptions() .setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION, Boolean.FALSE); service._getServiceClient() .getOptions() .setProperty(HTTPConstants.SO_TIMEOUT, (int) (this.timeOut)); service._getServiceClient() […]