标签: axis2

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

是通过Axis2 1.5.4线程安全的WSDL2JAVA(使用XMLBeans绑定选项)生成的存根吗?

实际上我已经为一个Web服务创建了一个Stub,我通过多个线程调用它.我已经配置了自己的MultiThreadedHttpConnectionmanager设置,HTTPConstants.REUSE_HTTP_CLIENT但我看到一些NullPointerExceptions 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()
                .getOptions()
                .setProperty(HTTPConstants.CONNECTION_TIMEOUT,
                        (int) (this.timeOut));
        service._getServiceClient().getServiceContext().getConfigurationContext()
                .setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
Run Code Online (Sandbox Code Playgroud)

同时在生成的存根中,我注意到已经调用了cleanUp:

   finally {
            _messageContext.getTransportOut().getSender().cleanup(_messageContext);
        }
Run Code Online (Sandbox Code Playgroud)

任何建议都会有很大帮助.谢谢.

java axis2 code-generation wsdl2java thread-safety

4
推荐指数
1
解决办法
6321
查看次数

JAX-WS到Axis2

我有一个由jax-ws生成的wsdl文件.是否有可能将它与"Axis2 wsdl-to-java"生成的java代码一起使用?

因为我得到了这个例外;

java.lang.InstantiationError: org.apache.axis2.databinding.ADBDataSource
        at tr.com.turkcell.radius.IPToDataWithPortServiceStub$TSO_DATA.getOMElement(IPToDataWithPortServiceStub.java:5751)
        at tr.com.turkcell.radius.IPToDataWithPortServiceStub.toEnvelope(IPToDataWithPortServiceStub.java:7826)
        at tr.com.turkcell.radius.IPToDataWithPortServiceStub.process(IPToDataWithPortServiceStub.java:167)
        at com.ericsson.enk.mtv.authentication.radius.RadiusService.callRadiusWS(RadiusService.java:100)
        at com.ericsson.enk.mtv.authentication.radius.RadiusService.authenticate(RadiusService.java:62)
        at com.ericsson.enk.mtv.plugin.authentication.RadiusAuthenticationPlugin.processDefaultAuthenticationRequest(RadiusAuthenticationPlugin.java:137)
        at com.ericsson.enk.mtv.plugin.authentication.RadiusAuthenticationPlugin.authenticate(RadiusAuthenticationPlugin.java:96)
        at com.ericsson.mtv.bric.bl.AuthenticationBusinessDelegateImpl.authenticate(AuthenticationBusinessDelegateImpl.java:244)
        at com.ericsson.mtv.bric.bl.AuthenticationBusinessDelegateImpl.authenticate(AuthenticationBusinessDelegateImpl.java:88)
        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:585)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
        at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at org.jboss.ejb3.service.ServiceContainer.dynamicInvoke(ServiceContainer.java:376)
        at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:81)
        at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) …
Run Code Online (Sandbox Code Playgroud)

axis2 jax-ws

4
推荐指数
1
解决办法
5591
查看次数

创建Web服务客户端时出错

我已经创建了一个用于访问database.it工作正常的web服务.但是当我尝试使用它的WSDL创建客户端时它会给出错误

    "The Apache Axis2 Web service runtime does not support the client project"
Run Code Online (Sandbox Code Playgroud)

我正在使用tomcat 6.0和Axis2.创建客户端我创建了java项目,然后尝试创建客户端.SO我不知道为什么会出现这个错误.对于axis2,客户端项目是动态Web项目吗?

java axis2 web-services webservice-client

4
推荐指数
1
解决办法
9701
查看次数

为什么wsimport生成的类需要JAXBElement <ClassName>参数?

我有一个来自Axis2 Web服务的WSDL文件.当我使用wsimport给定WSDL文件生成客户端存根时,生成的类需要JAXBElement参数.为什么会那样?

来自其中一个生成类的示例方法:

JAXBElement<DataBean> value;

public void setValue(JAXBElement<DataBean> value)
{
    this.value = ((JAXBElement<DataBean>) value);
}
Run Code Online (Sandbox Code Playgroud)

我希望它看起来像这样(没有JAXBElement):

DataBean value;

public void setValue(DataBean value)
{
    this.value= (DataBean) value;
}
Run Code Online (Sandbox Code Playgroud)

我在网上看到的教程没有将类设置为JAXBElement.可能是什么问题呢?请注意,服务器是Axis2 Web服务,WSDL文件由Axis2自动生成.假设是我无法控制服务器.

如何以wsimport不将参数转换为JAXBElements 的方式创建它?

以下是WSDL文件的摘录:(我忽略了一些标签只包含必要的标签)

<xs:element name="getData">
    <xs:complexType>
        <xs:sequence>
            <xs:element minOccurs="0" name="getData" nillable="true" type="ax220:getData"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>

<xs:complexType name="getData">
    <xs:sequence>
        <xs:element minOccurs="0" name="value" nillable="true" type="ax219:DataBean"/>
    </xs:sequence>
</xs:complexType>

<wsdl:message name="getDataRequest">
    <wsdl:part name="parameters" element="ns:getData"/>
</wsdl:message>

<wsdl:message name="getDataResponse">
    <wsdl:part name="parameters" element="ns:getDataResponse"/>
</wsdl:message>

<wsdl:operation name="getData">
    <wsdl:input message="ns:getDataRequest" wsaw:Action="urn:getData"/>
    <wsdl:output message="ns:getDataResponse" wsaw:Action="urn:getDataResponse"/> …
Run Code Online (Sandbox Code Playgroud)

java wsdl axis2 jax-ws wsimport

4
推荐指数
2
解决办法
5673
查看次数

来自 Java 的 SOAP Webservice 调用给出“未将对象引用设置为对象的实例”

我有一个要求,我使用 Eclipse 中的 Axis2 从 Java 调用基于 SOAP 的 Web 服务。Web 服务代码使用 C# 编写,扩展名为BasicHttpBinding.

但是当我从客户端存根调用该方法时,我收到此错误。

org.apache.axis2.AxisFault:未将对象引用设置为对象的实例。

谁能帮我弄清楚这个?这是在服务端还是在客户端?以前我收到“内部服务器错误”,然后他们必须添加一些内容,以便我可以在日志中看到此错误。

soap axis2 web-services

4
推荐指数
1
解决办法
2万
查看次数

使用log4j和axis2时出现问题

我在axis2上创建了一个web服务,我使用log4j进行日志记录.每次请求进入此WS时,我都会收到以下错误:

log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [org.apache.catalina.loader.StandardClassLoader@7f342545] whereas object of type 
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [WebappClassLoader
  delegate: false
  repositories:
    /WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@7f342545
].
log4j:ERROR Could not instantiate appender named "CONSOLE".
[ERROR] java.lang.NullPointerException
Run Code Online (Sandbox Code Playgroud)

我的log4j.properties如下:

log4j.rootCategory=INFO, CONSOLE
#log4j.rootCategory=INFO, CONSOLE, LOGFILE

# Set the enterprise logger priority to FATAL
log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL
log4j.logger.httpclient.wire.header=FATAL
log4j.logger.org.apache.commons.httpclient=FATAL

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout …
Run Code Online (Sandbox Code Playgroud)

axis2 log4j

3
推荐指数
1
解决办法
1万
查看次数

为什么我要使用除WCF之外的任何东西?

在用WCF完成几个小项目之后,我对它的功能非常满意.

但是,花了很短的时间研究替代方案,我很难找到使用基于Java的Web服务(如AXIS2或Metro)时会遇到的确切优势/缺点?

显然开源可能是其中之一,也脱离了Windows Server/IIS,但我看不到更多?

wcf axis2 web-services java-metro-framework

3
推荐指数
1
解决办法
235
查看次数

Axis2:禁用MustUnderstand标头检查

我正在使用Axis2框架编写Web服务.该服务将充当DMZ中的代理.它实际上只是我们本地局域网中真实服务的中继.

该服务使用设置了mustUnderstand标志的标头.但由于代理服务相当简单,它无法理解这些头文件,它只是将请求中继到我们的局域网中,可以处理所有头文件.

问题是,Axis2检查标头并引发故障,因为通常读取和理解标头的模块不存在.

有没有办法配置Axis2,它确实忽略了mustUnderstand标志?

或者,从代码处理它的方法也是一种方法.

java soap axis2 web-services header

3
推荐指数
2
解决办法
3551
查看次数

从WSDL文件创建Web服务(而不是Web服务客户端)

我有一个要求,根据该要求,我必须基于wsdl文件创建Axis2 Web服务.我已经有了wsdl文件.我之前一直在使用wsdl2java来创建Web服务客户端,但我不知道如何使用给定的wsdl文件创建Web服务.有人可以帮我提供正确的命令或选项.

另外,我需要在WAS 6.1和JBoss 5.1.0 GA上发布它,应该为此做些什么.

publish wsdl axis2 web-services wsdl2java

3
推荐指数
1
解决办法
6516
查看次数

使用JRE 5/6运行Axis2 v.1.6.2生成客户端需要哪些jar?

运行生成的WebService客户端需要Axis2发行版(版本1.6.2)中的哪些jar ?

二进制分发的库文件夹中有几个jar,但没有通知,哪些是必需的,以及在哪种情况下?答案Axis2客户端的最小类路径是什么?已过时 - 它是关于版本1.5,问题本身是关于版本1.4.

那么来自1.6.2发行版的罐子是:

  • Java 1.6及以上版本要求?
  • 另外还需要Java 1.5
  • 可选,仅在使用特定功能时?

java axis2 jar

3
推荐指数
1
解决办法
8612
查看次数