标签: axis2

如何让jcifs与apache轴很好地配合使用

我需要将Apache Axis 1.4连接到使用NTLM身份验证来限制对其操作的访问的Web服务.我期待使用Samba Jcifs来处理NTLM握手.

我发现

http://hc.apache.org/httpcomponents-client/ntlm.html

这为我提供了如何使用jcifs连接HttpClient 4.0的绝佳方向.

麻烦的是,Axis希望使用Http Client 3.0并且两个apis看起来非常不同.

我可以看到两种可能性

  1. 为Axis写一个对象,让它插入HttpClient 4.
  2. 弄清楚如何使用Samba Jcifs连接HttpClient 3.0.

数字1.看起来不平凡,但可能是2号.我在网上找不到任何令人鼓舞的消息,描述如何做到这一点.

我的问题是:有没有人成功连接samba jcifs与HttpClient 3.0?有没有人已经创建了一个与HttpClient 4一起使用的Axis HttpSender对象?

还有一些我没有考虑过的更好的选择吗?

java axis2 ntlm

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

WEBService调用的HTTP基本身份验证

我试图调用一个具有基本HTTP身份验证的Web服务.我使用AXIS的WSDL2JAVA工具生成了客户端代码.

但是我无法为webservice调用设置用户名和密码.

我试着把它们放在端点url中

HTTP://用户名:密码@ somwserver/WSDL

但是我收到了未经授权的错误.我试图找到一种方法来将此设置用于Java代码中的调用....

注意:我可以通过soapUI调用相同的服务并获得结果.我在请求的"自动"选项卡中提供了用户名和密码.

以下是我的Stub的一些代码片段,如果这对您有用

       _serviceClient = new org.apache.axis2.client.ServiceClient(configurationContext,_service);


    _serviceClient.getOptions().setTo(new org.apache.axis2.addressing.EndpointReference(
            targetEndpoint));
    _serviceClient.getOptions().setUseSeparateListener(useSeparateListener);

        //adding SOAP soap_headers
     _serviceClient.addHeadersToEnvelope(env);
    // set the message context with that soap envelope
    _messageContext.setEnvelope(env);

    // add the message contxt to the operation client
    _operationClient.addMessageContext(_messageContext);

    //execute the operation client
    _operationClient.execute(true);
Run Code Online (Sandbox Code Playgroud)

任何投入将不胜感激!!

java axis2 webservice-client basic-authentication

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

如何创建Axis2 Web服务?

我正在尝试学习如何构建Web服务.我正在努力做最简单的直接服务,在浪费了我的时间之后,我几乎不知道该怎么做.

我已正确安装了Eclipse Indigo(32位)和Tomcat 6.0.在服务器选项卡中,我可以根据需要运行/停止服务器.我还安装了Axis2 1.6.0引擎.

这是我的步骤:

1)新Web动态项目
2)完成后,单击Project Properties> Project Facets并检查Axis2 Web Services
3)Eclipse会将所有文件添加到我的项目中.一切似乎都没问题.
4)我将简单的Convert.java文件添加到Java Resources/src(这将是我的Web服务)

package wtp;
public class Convert {
      public float celsiusToFarenheit ( float celsius )
      {
        return (celsius * 9 / 5) + 32;
      }  
      public float farenheitToCelsius ( float farenheit )
      {
        return (farenheit - 32) * 5 / 9;
      }
}
Run Code Online (Sandbox Code Playgroud)

5)右键单击Convert.java文件> Web服务>创建Web服务.我会在顶部的滑块上选择Start Service并单击NEXT
6)Next Window将向我展示我的两个方法celsiusToFarenheit和farenheitToCelsius.他们都被检查.我将单击下一步
7)消息将显示它正在尝试将服务发布到Tomcat并且将显示错误:
IWAB0489E将Web服务部署到Axis运行时轴时出错 - 管理员失败{http://schemas.xmlsoap.org/soap/envelope /}客户端无法找到端点引用(EPR)的服务http:// localhost:8080/MyService/services/AdminService

我的问题:

1)我该如何解决这个问题?我究竟做错了什么?或者可以在这几个步骤中做错什么?试图在Axis2网站上寻求帮助,但在那里找不到任何有用的东西.

2)点击创建新服务时实际发生了什么?

3)我来自.NET世界,您可以在其中编写方法,将其声明为Web服务,并在服务器上上传文件.....并且您已完成.是否有可能在Java中发布类似的Web服务?我真的很讨厌在Eclipse中使用任何类型的向导,因为大多数时候它们都不起作用.永远缺少的东西,我最终失去了几个小时谷歌搜索....

谢谢,

任何帮助表示赞赏.

java axis2

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

Axis Bottom-up Webservice IWAB0489E错误

我正在浏览Eclipse中自下而上的Webservice.这是我的环境:

Eclipse Helios Java 1.6.0_29 Apache Axis2 Tomcat 6.x

我创建动态Web项目并创建一个简单的服务类.然后我尝试为类创建Webservice,我遇到了一些错误,如下所示:

IWAB0489E将Web服务部署到Axis运行时axis-admin失败时出现{http://schemas.xmlsoap.org/soap/envelope/}Client无法找到端点引用(EPR)的服务http:// localhost:8080/myws /服务/ AdminService

搜索网络,我还没有任何明确的答案.请帮我.

提前致谢.

axis2 web-services

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

WSDL:没有为消息定义元素类型

我正在使用Eclipse BPEL Designer插件创建服务编排,并且我自动生成的WSDL文件存在问题.

这是WSDL:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
   <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.invocation.import" xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:wsdl="http://services.lolsystem.it" name="ImportOrchestration" targetNamespace="http://ws.invocation.import">

   <plnk:partnerLinkType name="ImportType">
      <plnk:role name="ImportRole" portType="wsdl:ImportServicePortType"/>
   </plnk:partnerLinkType>
   <import location="ImportModule.wsdl" namespace="http://services.italsystem.it"/>
<types>
   <schema xmlns="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.invocation.import">

     <element name="ImportOrchestrationRequest" type="tns:ImportOrchestrationReqType">
           </element>

   <element name="singleEntry">
            <complexType>
                <sequence>
                    <element minOccurs="0" name="name" nillable="true" type="string"/>
                    <element minOccurs="0" name="content" nillable="true" type="base64Binary"/>
                </sequence>
            </complexType>
        </element>

              <element name="ImportOrchestrationResponse">
            <complexType>
                <sequence>
                    <element name="result" type="string"/>
                </sequence>
            </complexType>
        </element>

        <complexType name="ImportOrchestrationReqType">
            <sequence minOccurs="1" maxOccurs="unbounded">
                <element name="file" type="tns:SingleFile"></element>
            </sequence>
        </complexType>

        <complexType name="SingleFile">
            <sequence>
                <element name="name" type="string"></element>
                <element …
Run Code Online (Sandbox Code Playgroud)

wsdl axis2 web-services bpel apache-ode

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

在axis2 Web服务中返回列表

嗨,我想从Web服务返回一个列表.我的代码是

public class WebListTest {
    public List serviceFunction(String arg1,String arg2)
    {
    List list=new ArrayList();
        list.add(arg1);
        list.add(arg2);
            return list;    

        }
}
Run Code Online (Sandbox Code Playgroud)

但在wsdl创作中我发现了

<xs:element minOccurs="0" name="return" nillable="true" type="xs:anyType"/>
Run Code Online (Sandbox Code Playgroud)

当从客户端调用此Web服务时,我得到了异常

org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Any type element type has not been given
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at webservice1.WebListTestStub.fromOM(WebListTestStub.java:1622)
    at webservice1.WebListTestStub.serviceFunction(WebListTestStub.java:191)
    at webservice1.ServiceTest.main(ServiceTest.java:24)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Any type element type has not been given
    at webservice1.WebListTestStub$ServiceFunctionResponse$Factory.parse(WebListTestStub.java:917)
    at webservice1.WebListTestStub.fromOM(WebListTestStub.java:1616)
    ... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Any type element type has not been given
    at org.apache.axis2.databinding.utils.ConverterUtil.getAnyTypeObject(ConverterUtil.java:1612)
    at webservice1.WebListTestStub$ServiceFunctionResponse$Factory.parse(WebListTestStub.java:895)
    ... …
Run Code Online (Sandbox Code Playgroud)

soap axis2 web-services

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

wsimport不被识别为内部或外部命令

我试图使用wsimport生成文件,我收到上述错误.我已完成以下步骤:

1) JAVA_HOME -set到C:\ Program Files\Java\jre7 2) c:\ Desktop\Temp> wsimport http://www.w3schools.com/webservices/tempconvert.asmx?WSDL-extension-keep运行上面的命令导致错误.

我也尝试将/ bin附加到JAVA_HOME,但它不会删除错误.

axis soap axis2 web-services jaxb

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

Axis 2:使用Tomcat 8"URI不能为空"

我安装了Axis2/Java(1.6.2)作为Tomcat(8.0.5)Webapp.

我开发了两个服务(HelloWorld和简单的计算器),它们工作正常.

现在,我尝试使用一种从外部XML读取信息的方法来开发服务.

该文件位于以下目录中:"$ CATALINA_HOME/webapps/axis2/myService /".

我使用Ant编译.aar存档.

当我通过url调用此方法时

http://127.0.0.1:8080/axis2/services/InventoryCheck/doCheck?args0=12&args1=9
Run Code Online (Sandbox Code Playgroud)

我收到:

<soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Text xml:lang="en-US">URI cannot be null</soapenv:Text>
</soapenv:Reason>
Run Code Online (Sandbox Code Playgroud)

我尝试与Tomcat 7相同的服务,它工作正常.

我怎么解决?

谢谢


这是服务java类:

public class InventoryCheckService {

private String path = "myService/products.xml";

public boolean doCheck(String sku, int quantity){

    MessageContext msgContext = MessageContext.getCurrentMessageContext();
    ServletContext servletContext = (ServletContext) msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT);
    String realPath = servletContext.getRealPath(path);

    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
    factory.setNamespaceAware(true);

    Document doc = null;
    try {
        DocumentBuilder builder = factory.newDocumentBuilder();
        doc = builder.parse(realPath);
    } catch (SAXException e) {
        // TODO Auto-generated catch block
        e.printStackTrace(); …
Run Code Online (Sandbox Code Playgroud)

xml ant axis2 tomcat7 tomcat8

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

装有ESB 4.9.0的AXIS2Server在4.8.0正常工作时无法启动

装有ESB 4.9.0的AXIS2Server无法正常运行4.8.0 .. ..任何帮助

嗨,我在Win 7 OS 64上运行ESB 4.9.0.假设我的esb在以下位置可用D:\ wso2esb\samples\axis2Server根据运行示例的说明,我能够使用ant成功构建示例应用程序,但是axis2服务器根本无法启动.当我执行axis2server.bat时,它在CMD上打印.我错过了什么吗?

================================================== =======

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\kashif.kazi>d:

D:\>cd wso2esb\samples\axis2Server\

D:\wso2esb\samples\axis2Server>axis2server.bat
"Starting Sample Axis2 Server ..."
Using AXIS2_HOME:        D:\wso2esb\samples\AXIS2S~1\
Using JAVA_HOME:       C:\Program Files\Java\jdk1.7.0_65
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -server …
Run Code Online (Sandbox Code Playgroud)

axis2 wso2 wso2esb

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

ServiceClass对象未以下列形式实现所需的方法:OMElement add(OMElement e)

我无法弄清楚错误发生的位置.我检查了我的Axis2.xml,我安装了最新的Axis2 API.我目前正在使用Apache Tomcat 8和JDK 1.8进行开发.

Exception in thread "main" org.apache.axis2.AxisFault: The ServiceClass object does not implement the required method in the following form: OMElement add(OMElement e)
    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 com.test.axis2.AddOperatorStub.add(AddOperatorStub.java:181)
    at com.test.axis2.client.AddClientApp.main(AddClientApp.java:29)
Run Code Online (Sandbox Code Playgroud)

java axis2 web-services

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