com.sun.xml.internal.ws.fault.ServerSOAPFaultException:客户端从服务器收到SOAP Fault

时间:2017-11-20 23:25:56

标签: java web-services soap

我去servicex.com查看我的肥皂网服务技巧,我收到了这个错误。有没有人可以帮助我?

由于 这是我使用服务的主要课程。

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());
        }



}

1 个答案:

答案 0 :(得分:0)

它对我有用。

Use built-in generate webservice client of ECLIPSE, 并编写以下代码。

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