0

This is the code I wrote,I am sure there is no problem with the address and request parameters set here. The request parameters are of XML type

      String result = "";
        try {
            String encodingStyle = "utf-8";
            //WSDL的地址
            String endpoint = emrClientConfig.getWsdlUrl();
            System.out.println(endpoint);
            //命名空间,在WSDL中对应的标签是:参见说明第3条
            String targetNamespace = "http://www.kedauis.com";
            //具体方法的调用URI,在WSDL中对应的标签是:参见说明第4条
            String soapActionURI = targetNamespace + "/call";
            //具体调用的方法名,在WSDL中对应的标签是:参见说明第5条
            String method = "call";
            //调用接口的参数的名字
            String[] paramNames = {"header","content"};
            //调用接口的参数的值
            StringBuffer headerTemp = new StringBuffer();


            Service service = new Service();
            Call call = (Call) service.createCall();
            //设置超时时间
            call.setTimeout(new Integer(60000));
            call.setSOAPActionURI(soapActionURI);
            //设置目标接口的地址
            call.setTargetEndpointAddress(new URL(endpoint));
            //设置传入服务端的字符集格式如utf-8等
            call.setEncodingStyle(encodingStyle);
            //具体方法名
            call.setOperationName(new QName(targetNamespace,method));
            call.setUseSOAPAction(true);
            call.addParameter(new QName(targetNamespace,paramNames[0]),
                    XMLType.XSD_STRING,
                    ParameterMode.IN);
            call.addParameter(new QName(targetNamespace,paramNames[1]),
                    XMLType.XSD_STRING,
                    ParameterMode.IN);
            call.setReturnType(XMLType.XSD_STRING);
            //设置协议版本
            call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
            String header = WebServiceUtil.form

However, the error result is as follows. This issue has been bothering me for a long time, and I can't be sure if the boss wants to fire me anymore

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.net.SocketTimeoutException: Read timed out
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:265)

I tried to set the timeout and protocol type, but none of them were possible

2
  • Please remove non-technical details from the question. If you have a read timeout you need to investigate why the server is not sending the client information or if the timeout is set too low for whatever the server needs to do. We do not know what the server does. Commented Nov 13, 2023 at 11:46
  • Thank you, it was resolved later. Finally, I asked the other party to check the log information and found that the request had already been sent to the opposite party, which was only caused by parameter format errors. The key issue this time was that I never thought of solving it by checking the error message in the log. Commented Nov 14, 2023 at 2:30

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.