Client c = new Client(new URL("http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx?wsdl"));
Object[] results = c.invoke("getVersionTime", new Object[0]);

解决方案 »

  1.   

    org.codehaus.xfire.fault.XFireFault: An error was discovered processing the <wsse:Security> header
    报此异常,c.setProperty(CommonsHttpMessageSender.HTTP_PROXY_USER, "aaa");  c.setProperty(CommonsHttpMessageSender.HTTP_PROXY_PASS, "bbb"); 
      

  2.   

    xfire清楚,下面是AXIS2的写法,针对wss4j usertoken用户名和密码验证 String path = axis2.xml路径
    QName name1 = new QName(命名空间, 方法名);
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(path, "");
    RPCServiceClient serviceClient = new RPCServiceClient(configContext,null);
    SOAP11Factory factory = new SOAP11Factory();
    OMNamespace SecurityElementNamespace = factory.createOMNamespace("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","wsse");
    OMElement usernameTokenEl = factory.createOMElement("UsernameToken",SecurityElementNamespace);
    OMElement usernameEl = factory.createOMElement("Username",SecurityElementNamespace);
    OMElement passwordEl = factory.createOMElement("Password",SecurityElementNamespace);
    OMElement actionEl = factory.createOMElement("Action",SecurityElementNamespace);
    passwordEl.addAttribute(factory.createOMAttribute("Type",null,
    "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"));
    usernameEl.setText(用户名);
    passwordEl.setText(密码);
    usernameTokenEl.addChild(usernameEl);
    usernameTokenEl.addChild(passwordEl);
    usernameTokenEl.addChild(actionEl);
    SOAPHeaderBlockImpl block = new SOAP11HeaderBlockImpl("Security",SecurityElementNamespace, factory);
    block.addChild(usernameTokenEl);
    serviceClient.addHeader(block);
      

  3.   

    http://www.myexception.cn/web/679163.html
    希望可以帮到你