Please login or register to access secure site features.

Note: By continuing to use DevConnect Program Services you agree to our latest Registered Member Terms.

Sign in using DevConnect ID

Forgot password?

Trouble logging in?

Submit a ticket for Registration Support.

I have an SSO ID

?
sign in

Don't have a DevConnect or SSO ID ?

Create a DevConnect account or join the program.

register now
^
New DevConnect members must have forum permissions in order to post messages.
If the Reply and New Post buttons are not available to you, please request access using a General Support request ticket.
Forum Index » Web Services » Cannot call VPAppIntfService on java   XML
 
Author Message
onurcan.oz



Joined: 11/07/2019 11:42:00
Messages: 4
Offline

url: https://ip/axis2/services/VPAppIntfService

I want to call this ws console app. but i got this err. But i reach this web service via soapui

Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How can i fix this problem?

        try
        {
            String content = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:voic=\"http://xml.avaya.com/ws/VPAppIntf/VoicePortal\" xmlns:xsd=\"http://services.vp.avaya.com/xsd\">" +
                    "   <soapenv:Header/>" +
                    "   <soapenv:Body>" +
                    "      <voic:queryResources>" +
                    "         <!--Optional:-->" +
                    "         <voic:parameters>" +
                    "            <!--Optional:-->" +
                    "            <xsd:queryResourcesRequestUnused></xsd:queryResourcesRequestUnused>" +
                    "            <!--Optional:-->" +
                    "            <xsd:zone></xsd:zone>" +
                    "         </voic:parameters>" +
                    "      </voic:queryResources>" +
                    "   </soapenv:Body>" +
                    "</soapenv:Envelope>";

            URL obj = new URL(url);
            String userpass = username + ":" + password;
            String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userpass.getBytes());
            HttpURLConnection conn = (HttpURLConnection) obj.openConnection();
            conn.setRequestProperty("Authorization", basicAuth);
            conn.setConnectTimeout(10000);
            conn.setReadTimeout(10000);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type","text/xml;charset=UTF-8");
            conn.setDoOutput(true);
            DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
            wr.writeBytes(content);
            wr.flush();
            wr.close();
            String responseStatus = conn.getResponseMessage();
            if (conn != null && conn.getErrorStream() != null) {
                BufferedReader error = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
            }
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String inputLine;
            StringBuffer response = new StringBuffer();
            while((inputLine = in.readLine()) != null) {
                response.append(response.toString());
            }
            in.close();
            System.out.println(response.toString());
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
kslirini



Joined: 21/11/2021 11:12:43
Messages: 1
Offline

onurcan.oz wrote:url: https://ip/axis2/services/VPAppIntfService

I want to call this ws console app. but i got this err. But i reach this web service via soapui

Error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

How can i fix this problem applinked?

        try
        {
            String content = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:voic=\"http://xml.avaya.com/ws/VPAppIntf/VoicePortal\" xmlns:xsd=\"http://services.vp.avaya.com/xsd\">" +
                    "   <soapenv:Header/>" +
                    "   <soapenv:Body>" +
                    "      <voic:queryResources>" +
                    "         <!--Optional:-->" +
                    "         <voic:parameters>" +
                    "            <!--Optional:-->" +
                    "            <xsd:queryResourcesRequestUnused></xsd:queryResourcesRequestUnused>" +
                    "            <!--Optional:-->" +
                    "            <xsd:zone></xsd:zone>" +
                    "         </voic:parameters>" +
                    "      </voic:queryResources>" +
                    "   </soapenv:Body>" +
                    "</soapenv:Envelope>";

            URL obj = new URL(url);
            String userpass = username + ":" + password;
            String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userpass.getBytes());
            HttpURLConnection conn = (HttpURLConnection) obj.openConnection();
            conn.setRequestProperty("Authorization", basicAuth);
            conn.setConnectTimeout(10000);
            conn.setReadTimeout(10000);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type","text/xml;charset=UTF-8");
            conn.setDoOutput(true);
            DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
            wr.writeBytes(content);
            wr.flush();
            wr.close();
            String responseStatus = conn.getResponseMessage();
            if (conn != null && conn.getErrorStream() != null) {
                BufferedReader error = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
            }
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String inputLine;
            StringBuffer response = new StringBuffer();
            while((inputLine = in.readLine()) != null) {
                response.append(response.toString());
            }
            in.close();
            System.out.println(response.toString());
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }

Same problem here. I cant figure it out.

This message was edited 1 time. Last update was at 22/11/2021 10:01:15

 
 
Go to: