简体   繁体   中英

com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server

I went to servicex.com to review my soap webservice skills and I'm getting this error. Is there anyone who can help me?

Thanks Here is my main class where I consume the service.

import java.util.Scanner;

import net.webservicex.ArrayOfAddress;
import net.webservicex.USAddressVerification;
import net.webservicex.USAddressVerificationSoap;
import net.webservicex.VerifyAddressResponse; 


public class AddressValidation {


    public static void  main(String [] arg) {

        @SuppressWarnings("resource")
        Scanner in = new Scanner (System.in);
        System.out.println("enter the city ");
            String city = in.nextLine();
            System.out.println("enter the state ");
            String state = in.nextLine();
            System.out.println("enter the zip ");
            String zip = in.nextLine();

            // service end point interface 
            USAddressVerification addressVerification= new USAddressVerification ();
            USAddressVerificationSoap addressVerificationSoap = addressVerification.getUSAddressVerificationSoap();
            ArrayOfAddress USAddress = addressVerificationSoap.verifyAddress(city, state, zip);
            VerifyAddressResponse reponse = new VerifyAddressResponse();
    reponse.setVerifyAddressResult(USAddress);

            System.out.println("The Address is:" + reponse.getVerifyAddressResult());
        }



}

It works for me.

Use built-in generate webservice client of ECLIPSE , and write the following code.

   USAddressVerificationSoap addressVerificationSoap= new USAddressVerificationSoapProxy ();
   Address[] USAddress = addressVerificationSoap.verifyAddress(city, state, zip);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM