当前位置: 首页 > 知识库问答 >
问题:

Java-WSA寻址中的SOAP客户端

高兴贤
2023-03-14
/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.9-b130926.1035
 * Generated source version: 2.2
 * 
 */
@Addressing(required=true) // ADDED TO TRY TO FIX WS-ADDRESSING
@WebServiceClient(name = "MYService", targetNamespace = "http://tempuri.org/", wsdlLocation = "http://mybasicvanilla.com/MYService.svc?wsdl")
public class MYService
    extends Service
{

    private final static URL MYSERVICE_WSDL_LOCATION;
    private final static WebServiceException MYSERVICE_EXCEPTION;
    private final static QName MYSERVICE_QNAME = new QName("http://tempuri.org/", "MYService");

    static {
        URL url = null;
        WebServiceException e = null;
        try {
            url = new URL("http://mybasicvanilla.com/MYService.svc?wsdl");
        } catch (MalformedURLException ex) {
            e = new WebServiceException(ex);
        }
        MYSERVICE_WSDL_LOCATION = url;
        MYSERVICE_EXCEPTION = e;
    }



    @WebEndpoint(name = "WSHttpBinding_IMYService")
    public IMYService getWSHttpBindingIMYService() {
        return super.getPort(new QName("http://tempuri.org/", "WSHttpBinding_IMYService"), IMYService.class,new javax.xml.ws.soap.AddressingFeature(true,true) );
    }

    @WebEndpoint(name = "WSHttpBinding_IMYService")
    public IMYService getWSHttpBindingIMYService(WebServiceFeature... features) {
        return super.getPort(new QName("http://tempuri.org/", "WSHttpBinding_IMYService"), IMYService.class, new javax.xml.ws.soap.AddressingFeature(true,true));
    }

    private static URL __getWsdlLocation() {
        if (MYSERVICE_EXCEPTION!= null) {
            throw MYSERVICE_EXCEPTION;
        }
        return MYSERVICE_WSDL_LOCATION;
    }

}
 Dec 22, 2017 9:04:05 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
WARNING: WSP0075: Policy assertion "{http://www.w3.org/2006/05/addressing/wsdl}UsingAddressing" was evaluated as "UNKNOWN".
Dec 22, 2017 9:04:05 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
@Addressing(required=true)
javax.xml.ws.soap.AddressingFeature(true,true)

在这两个webendpoint上-但是错误仍然存在。如果WS-Addressing没有设置为true,那么SOAPUI也会失败。

共有1个答案

夏令秋
2023-03-14

在内部,我似乎有一个类型,实际上得到了一个异常

Exception in thread "Thread-2" javax.xml.ws.soap.SOAPFaultException: MustUnderstand headers:[{http://www.w3.org/2005/08/addressing}Action] are not understood

我正确地补充道:

new javax.xml.ws.soap.AddressingFeature(true,true)

正如ACV指出的,其他信息是警告。

 类似资料:
  • 我是Soap寻址的新手,我必须在Apache cxf camel中使用wsa寻址。 这是apache cxf从wsdl创建的服务endpoint 服务请求时出现问题,在soap请求中,这是soap2:Header中wsa的命名空间值 我面临的问题是,传入请求中的ReplyTo标头的值低于 然后,cxf侦听器尝试回调上述地址,但由于“405 Method not allowed”而失败,我的功能无法

  • 问题内容: 我正在寻找Java的SOAP客户端。 Apache Axis在我看来非常肿。我不明白为什么Java必须如此复杂。例如,在PHP中,我要做的就是: 我的$ response对象保存了我需要的所有信息。 有人可以建议我如何在Java中实现类似这样的事情而不会太麻烦呢? 提前谢谢了, 〜编辑1〜 @jarnbjo: 这对我非常有用。我遇到的困难是,需要哪些导入才能使代码运行? 我运行了以下命

  • 3)我已经研究了SAAJ和JAX-WS,但我发现它们太复杂了,而且我也不知道如何在请求中执行自定义HTTP头。 看来我又在设计Loadrunner了。所以我的问题是什么可以是实现上述要求的步骤。 我有一个wsdl文件、证书、URL和一些自定义HTTP头要包含在请求中。

  • 问题内容: 我试图在JAVA中找到一个简单的(ha)带有工作服务的SOAP示例,但我似乎找不到的任何例子。 我已经试过这一个,从这个例子,但它只是不工作,它要求我把一个斜杠的,但它在那里并没有什么发生。 那么,有谁知道任何SOAP示例链接,我可以下载/请求并使用它吗? 谢谢你的帮助。 问题答案: 要用Java实现简单的SOAP客户端,可以使用SAAJ框架(JSE 1.6及更高版本附带): 带有Ja

  • 问题内容: 有没有一种方法可以将angularJS用作SOAP客户端或开发ng SOAP客户端服务? 问题答案: 当然。您所需要做的就是在JavaScript上实现SOAP调用。

  • 我正在尝试使用第三方组织提供的web服务。 服务的URL如下 有几个帖子带有相同的错误消息。我在这里阅读了这篇文章,并通过向客户端添加这些设置来尝试它: 之后,服务器根本没有响应! 所以,我有点被困在这里了。有人能把我推到正确的方向吗?