1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.vci.ubcs.code.webService;/*
package com.vci.ubcs.webservice;
 
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.soap.SOAP11Constants;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;
import org.apache.commons.lang3.StringUtils;
 
public class WsClientUtil {
 
    */
/**
     * axis2调用客户端
     *
     * @param url                   请求服务地址
     * @param nameSpace             命名空间
     * @param soapAction soapAction
     * @param method                方法名
     * @param paramName                参数名称
     * @param sendData                请求报文
     * @param timeOutInMilliSeconds 超时时间
     * @return String 类型的响应报文
     *//*
 
    public static String sendMsg(String url, String nameSpace,String soapAction, String method, String paramName, String sendData, long timeOutInMilliSeconds) throws Exception {
        ServiceClient serviceClient = new ServiceClient();
        Options option = new Options();
        option.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        option.setTransportInProtocol(Constants.TRANSPORT_HTTP);
 
        // 值为targetNamespace+methodName
        if(StringUtils.isEmpty(soapAction)){
            soapAction = nameSpace+method;
        }
        option.setAction(soapAction);
 
        EndpointReference epfs = new EndpointReference(url);
        option.setTo(epfs);
        serviceClient.setOptions(option);
 
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespace namespaceOM = fac.createOMNamespace(nameSpace, "");
        OMElement element = fac.createOMElement(method, namespaceOM);
        OMElement theCityCode = fac.createOMElement(paramName, namespaceOM);
        theCityCode.setText(sendData);
        element.addChild(theCityCode);
 
 
        OMElement resultOM = serviceClient.sendReceive(element);
 
        String result = resultOM.getFirstElement().getText();
        return result;
    }
}
*/