Erro ao Testar retorno do web service

9 respostas
farzac

Ola pessoal

Estou testando o web service USAddressVerificationSoap que ja vem com netbeans instalado

Porem estou com o seguinte erro :

Invalid user identification format. com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:187) com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:10 com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:254) com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224) com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117) $Proxy94.verifyAddressUSA(Unknown Source) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.netbeans.modules.websvc.manager.ui.ReflectionHelper.callMethodWithParams(ReflectionHelper.java:731) org.netbeans.modules.websvc.manager.ui.TestWebServiceMethodDlg$MethodTask.run(TestWebServiceMethodDlg.java:722) java.lang.Thread.run(Thread.java:619)

Alguem sabe a solucao para este erro.

Desde ja, muito obrigado.

9 Respostas

victor.godinho

O meu querido, poe o wsdl.

farzac

Segue o wsdl abaixo:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http=“<a href="http://schemas.xmlsoap.org/wsdl/http/">http://schemas.xmlsoap.org/wsdl/http/</a> xmlns:soap=“<a href="http://schemas.xmlsoap.org/wsdl/soap/">http://schemas.xmlsoap.org/wsdl/soap/</a> xmlns:s=“<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a> xmlns:si=“<a href="http://www.strikeiron.com">http://www.strikeiron.com</a> xmlns:soapenc=“<a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a> xmlns:tm=“<a href="http://microsoft.com/wsdl/mime/textMatching/">http://microsoft.com/wsdl/mime/textMatching/</a> xmlns:mime=“<a href="http://schemas.xmlsoap.org/wsdl/mime/">http://schemas.xmlsoap.org/wsdl/mime/</a> targetNamespace=“<a href="http://www.strikeiron.com">http://www.strikeiron.com</a> xmlns:wsdl=“<a href="http://schemas.xmlsoap.org/wsdl/">http://schemas.xmlsoap.org/wsdl/</a>”>

<a>wsdl:types</a>

<s:schema elementFormDefault=“qualified” targetNamespace=“<a href="http://www.strikeiron.com">http://www.strikeiron.com</a>”>

<s:element name=“VerifyAddressUSA”>

<s:complexType>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“UnregisteredUserEmail” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“UserID” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Password” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“addressLine1” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“addressLine2” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“city_state_zip” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“firm” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“urbanization” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” default=“Upper” name=“casing” type=“si:casingEnum” />

</s:sequence>

</s:complexType>

</s:element>

<s:simpleType name=“casingEnum”>

<s:restriction base=“s:string”>

<s:enumeration value=“Upper” />

<s:enumeration value=“Lower” />

<s:enumeration value=“Proper” />

</s:restriction>

</s:simpleType>

<s:element name=“VerifyAddressUSAResponse”>

<s:complexType>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“VerifyAddressUSAResult” type=“si:USAddress” />

<s:element name=“SISubscriptionInfo” type=“si:SISubscriptionInfo” />

</s:sequence>

</s:complexType>

</s:element>

<s:complexType name=“USAddress”>

<s:complexContent mixed=“false”>

<s:extension base=“si:Address”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“State” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Urbanization” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“ZipPlus4” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Zip” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“ZipAddOn” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“CarrierRoute” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“PMB” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“PMBDesignator” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“DeliveryPoint” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“DPCheckDigit” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“LACS” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“CMRA” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“DPV” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“DPVFootnote” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“RDI” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“RecordType” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“CongressDistrict” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“County” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“CountyNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“StateNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“GeoCode” type=“si:USGeoCode” />

</s:sequence>

</s:extension>

</s:complexContent>

</s:complexType>

<s:complexType name=“Address” abstract=“true”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“AddressLine1” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“AddressLine2” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“StreetNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Firm” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“PreDirection” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“StreetName” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“StreetType” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“PostDirection” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Extension” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“ExtensionNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Village” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“City” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“AddressStatus” type=“s:string” />

<s:element minOccurs=“1” maxOccurs=“1” name=“AddressErrorNumber” type=“s:int” />

<s:element minOccurs=“0” maxOccurs=“1” name=“AddressErrorMessage” type=“s:string” />

</s:sequence>

</s:complexType>

<s:complexType name=“USGeoCode”>

<s:complexContent mixed=“false”>

<s:extension base=“si:GeoCode”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“CensusTract” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“StateNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“CountyNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“BlockNumber” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“BlockGroup” type=“s:string” />

</s:sequence>

</s:extension>

</s:complexContent>

</s:complexType>

<s:complexType name=“GeoCode”>

<s:sequence>

<s:element minOccurs=“1” maxOccurs=“1” name=“Latitude” type=“s:double” />

<s:element minOccurs=“1” maxOccurs=“1” name=“Longitude” type=“s:double” />

</s:sequence>

</s:complexType>

<s:element name=“ResponseInfo” type=“si:ResponseInfo” />

<s:complexType name=“ResponseInfo”>

<s:sequence>

<s:element minOccurs=“1” maxOccurs=“1” name=“ResponseCode” type=“s:int” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Response” type=“s:string” />

</s:sequence>

</s:complexType>

<s:element name=“VerifyAddressUSABatch”>

<s:complexType>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“UnregisteredUserEmail” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“UserID” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Password” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“address” type=“si:ArrayOfUSBatchAddress” />

<s:element minOccurs=“0” maxOccurs=“1” default=“Upper” name=“casing” type=“si:casingEnum” />

</s:sequence>

</s:complexType>

</s:element>

<s:complexType name=“ArrayOfUSBatchAddress”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“unbounded” name=“USBatchAddress” nillable=“true” type=“si:USBatchAddress” />

</s:sequence>

</s:complexType>

<s:complexType name=“USBatchAddress”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“addressLine1” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“addressLine2” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“city_state_zip” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“firm” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“urbanization” type=“s:string” />

</s:sequence>

</s:complexType>

<s:element name=“VerifyAddressUSABatchResponse”>

<s:complexType>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“VerifyAddressUSABatchResult” type=“si:ArrayOfUSAddress” />

<s:element name=“SISubscriptionInfo” type=“si:SISubscriptionInfo” />

</s:sequence>

</s:complexType>

</s:element>

<s:complexType name=“ArrayOfUSAddress”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“unbounded” name=“USAddress” nillable=“true” type=“si:USAddress” />

</s:sequence>

</s:complexType>

<s:complexType name=“SILicenseInfo”>

<s:sequence>

<s:element minOccurs=“0” maxOccurs=“1” name=“UnregisteredUserEmail” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“UserID” type=“s:string” />

<s:element minOccurs=“0” maxOccurs=“1” name=“Password” type=“s:string” />

</s:sequence>

</s:complexType>

<s:element name=“SILicenseInfo” type=“si:SILicenseInfo” />

<s:complexType name=“SISubscriptionInfo”>

<s:sequence>

<s:element name=“LicenseStatusCode” type=“s:int” />

<s:element minOccurs=“0” name=“LicenseStatus” type=“s:string” />

<s:element name=“LicenseActionCode” type=“s:int” />

<s:element minOccurs=“0” name=“LicenseAction” type=“s:string” />

<s:element name=“RemainingHits” type=“s:int” />

<s:element name=“Amount” type=“s:decimal” />

</s:sequence>

</s:complexType>

<s:element name=“SISubscriptionInfo” type=“si:SISubscriptionInfo” />

</s:schema>

</wsdl:types>

<wsdl:message name=“VerifyAddressUSASoapIn”>

<wsdl:part name=“parameters” element=“si:VerifyAddressUSA” />

</wsdl:message>

<wsdl:message name=“VerifyAddressUSASoapOut”>

<wsdl:part name=“parameters” element=“si:VerifyAddressUSAResponse” />

</wsdl:message>

<wsdl:message name=“VerifyAddressUSAResponseInfo”>

<wsdl:part name=“ResponseInfo” element=“si:ResponseInfo” />

</wsdl:message>

<wsdl:message name=“VerifyAddressUSABatchSoapIn”>

<wsdl:part name=“parameters” element=“si:VerifyAddressUSABatch” />

</wsdl:message>

<wsdl:message name=“VerifyAddressUSABatchSoapOut”>

<wsdl:part name=“parameters” element=“si:VerifyAddressUSABatchResponse” />

</wsdl:message>

<wsdl:message name=“VerifyAddressUSABatchResponseInfo”>

<wsdl:part name=“ResponseInfo” element=“si:ResponseInfo” />

</wsdl:message>

<wsdl:message name=“GetRemainingHitsSoapIn”>

<wsdl:part name=“parameters” element=“si:SILicenseInfo” />

</wsdl:message>

<wsdl:message name=“GetRemainingHitsSoapOut”>

<wsdl:part name=“parameters” element=“si:SISubscriptionInfo” />

</wsdl:message>

<wsdl:portType name=“USAddressVerificationSoap”>

<wsdl:operation name=“VerifyAddressUSA”>

<wsdl:input message=“si:VerifyAddressUSASoapIn” />

<wsdl:output message=“si:VerifyAddressUSASoapOut” />

</wsdl:operation>

<wsdl:operation name=“VerifyAddressUSABatch”>

<wsdl:input message=“si:VerifyAddressUSABatchSoapIn” />

<wsdl:output message=“si:VerifyAddressUSABatchSoapOut” />

</wsdl:operation>

<wsdl:operation name=“GetRemainingHits”>

<wsdl:input message=“si:GetRemainingHitsSoapIn” />

<wsdl:output message=“si:GetRemainingHitsSoapOut” />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name=“USAddressVerificationSoap” type=“si:USAddressVerificationSoap”>

<soap:binding transport=“<a href="http://schemas.xmlsoap.org/soap/http">http://schemas.xmlsoap.org/soap/http</a> style=“document” />

<wsdl:operation name=“VerifyAddressUSA”>

<soap:operation soapAction=“<a href="http://www.strikeiron.com/VerifyAddressUSA">http://www.strikeiron.com/VerifyAddressUSA</a> style=“document” />

<a>wsdl:input</a>

<soap:body use=“literal” />

</wsdl:input>

<a>wsdl:output</a>

<soap:body use=“literal” />

<soap:header message=“si:VerifyAddressUSAResponseInfo” part=“ResponseInfo” use=“literal” />

</wsdl:output>

</wsdl:operation>

<wsdl:operation name=“VerifyAddressUSABatch”>

<soap:operation soapAction=“<a href="http://www.strikeiron.com/VerifyAddressUSABatch">http://www.strikeiron.com/VerifyAddressUSABatch</a> style=“document” />

<a>wsdl:input</a>

<soap:body use=“literal” />

</wsdl:input>

<a>wsdl:output</a>

<soap:body use=“literal” />

<soap:header message=“si:VerifyAddressUSABatchResponseInfo” part=“ResponseInfo” use=“literal” />

</wsdl:output>

</wsdl:operation>

<wsdl:operation name=“GetRemainingHits”>

<soap:operation soapAction=“<a href="http://wsparam.strikeiron.com/StrikeIron/USAddressVerification4_0/USAddressVerification/GetRemainingHits">http://wsparam.strikeiron.com/StrikeIron/USAddressVerification4_0/USAddressVerification/GetRemainingHits</a> />

<a>wsdl:input</a>

<soap:body use=“literal” />

</wsdl:input>

<a>wsdl:output</a>

<soap:body use=“literal” />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name=“USAddressVerification”>

<wsdl:port name=“USAddressVerificationSoap” binding=“si:USAddressVerificationSoap”>

<soap:address location=“<a href="http://wsparam.strikeiron.com/StrikeIron/USAddressVerification4_0/USAddressVerification">http://wsparam.strikeiron.com/StrikeIron/USAddressVerification4_0/USAddressVerification</a> />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

Segue a classe que criei :

package adressverify;

import com.strikeiron.USAddressVerificationSoapClient;

import com.strikeiron.USAddressVerificationSoapVerifyAddressUSA;

import com.sun.rave.web.ui.appbase.AbstractPageBean;

import com.sun.webui.jsf.component.Body;

import com.sun.webui.jsf.component.Button;

import com.sun.webui.jsf.component.Form;

import com.sun.webui.jsf.component.Head;

import com.sun.webui.jsf.component.Html;

import com.sun.webui.jsf.component.Label;

import com.sun.webui.jsf.component.Link;

import com.sun.webui.jsf.component.Page;

import com.sun.webui.jsf.component.StaticText;

import com.sun.webui.jsf.component.TextField;

import javax.faces.FacesException;

/**

  • Page bean that corresponds to a similarly named JSP page. This

  • class contains component definitions (and initialization code) for

  • all components that you have defined on this page, as well as

  • lifecycle methods and event handlers where you may add behavior

  • to respond to incoming events.

  • @author zaccantte
    */
    public class Page1 extends AbstractPageBean {
    //

    /**

    • Automatically managed component initialization. WARNING:

    • This method is automatically generated, so any user-specified code inserted
    • here is subject to being replaced.
      */

    private Page page1 = new Page();

    public Page getPage1() {
    
    return page1;
    
    }
    
    public void setPage1(Page p) {
    
    this.page1 = p;
    
    }
    

    private Html html1 = new Html();

    public Html getHtml1() {
    
    return html1;
    
    }
    
    public void setHtml1(Html h) {
    
    this.html1 = h;
    
    }
    

    private Head head1 = new Head();

    public Head getHead1() {
    
    return head1;
    
    }
    
    public void setHead1(Head h) {
    
    this.head1 = h;
    
    }
    

    private Link link1 = new Link();

    public Link getLink1() {
    
    return link1;
    
    }
    
    public void setLink1(Link l) {
    
    this.link1 = l;
    
    }
    

    private Body body1 = new Body();

    public Body getBody1() {
    
    return body1;
    
    }
    
    public void setBody1(Body b) {
    
    this.body1 = b;
    
    }
    

    private Form form1 = new Form();

    public Form getForm1() {
    
    return form1;
    
    }
    
    public void setForm1(Form f) {
    
    this.form1 = f;
    
    }
    
    private TextField textField1 = new TextField();
    
    public TextField getTextField1() {
    
    return textField1;
    
    }
    
    public void setTextField1(TextField tf) {
    
    this.textField1 = tf;
    
    }
    
    private TextField textField2 = new TextField();
    
    public TextField getTextField2() {
    
    return textField2;
    
    }
    
    public void setTextField2(TextField tf) {
    
    this.textField2 = tf;
    
    }
    
    private TextField textField3 = new TextField();
    
    public TextField getTextField3() {
    
    return textField3;
    
    }
    
    public void setTextField3(TextField tf) {
    
    this.textField3 = tf;
    
    }
    
    private Label label1 = new Label();
    
    public Label getLabel1() {
    
    return label1;
    
    }
    
    public void setLabel1(Label l) {
    
    this.label1 = l;
    
    }
    
    private Label label2 = new Label();
    
    public Label getLabel2() {
    
    return label2;
    
    }
    
    public void setLabel2(Label l) {
    
    this.label2 = l;
    
    }
    
    private Label label3 = new Label();
    
    public Label getLabel3() {
    
    return label3;
    
    }
    
    public void setLabel3(Label l) {
    
    this.label3 = l;
    
    }
    
    private Button button1 = new Button();
    
    public Button getButton1() {
    
    return button1;
    
    }
    
    public void setButton1(Button b) {
    
    this.button1 = b;
    
    }
    
    private Label label4 = new Label();
    
    public Label getLabel4() {
    
    return label4;
    
    }
    
    public void setLabel4(Label l) {
    
    this.label4 = l;
    
    }
    
    private StaticText staticText1 = new StaticText();
    
    public StaticText getStaticText1() {
    
    return staticText1;
    
    }
    
    public void setStaticText1(StaticText st) {
    
    this.staticText1 = st;
    
    }
    
    private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA4 = new USAddressVerificationSoapVerifyAddressUSA();
    
    public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA4() {
    
    return USAddressVerificationSoapVerifyAddressUSA4;
    
    }
    
    public void setUSAddressVerificationSoapVerifyAddressUSA4(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
    
    this.USAddressVerificationSoapVerifyAddressUSA4 = usavsvausa;
    
    }
    
    private USAddressVerificationSoapClient USAddressVerificationSoapClient3 = new USAddressVerificationSoapClient();
    
    public USAddressVerificationSoapClient getUSAddressVerificationSoapClient3() {
    
    return USAddressVerificationSoapClient3;
    
    }
    
    public void setUSAddressVerificationSoapClient3(USAddressVerificationSoapClient usavsc) {
    
    this.USAddressVerificationSoapClient3 = usavsc;
    
    }
    
    private USAddressVerificationSoapClient USAddressVerificationSoapClient4 = new USAddressVerificationSoapClient();
    
    public USAddressVerificationSoapClient getUSAddressVerificationSoapClient4() {
    
    return USAddressVerificationSoapClient4;
    
    }
    
    public void setUSAddressVerificationSoapClient4(USAddressVerificationSoapClient usavsc) {
    
    this.USAddressVerificationSoapClient4 = usavsc;
    
    }
    
    private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA5 = new USAddressVerificationSoapVerifyAddressUSA();
    
    public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA5() {
    
    return USAddressVerificationSoapVerifyAddressUSA5;
    
    }
    
    public void setUSAddressVerificationSoapVerifyAddressUSA5(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
    
    this.USAddressVerificationSoapVerifyAddressUSA5 = usavsvausa;
    
    }
    
    private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA6 = new USAddressVerificationSoapVerifyAddressUSA();
    
    public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA6() {
    
    return USAddressVerificationSoapVerifyAddressUSA6;
    
    }
    
    public void setUSAddressVerificationSoapVerifyAddressUSA6(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
    
    this.USAddressVerificationSoapVerifyAddressUSA6 = usavsvausa;
    
    }
    

    //

    /**

    • Construct a new Page bean instance.

    */
    
    public Page1() {
    
    }
    

    /**

    • Callback method that is called whenever a page is navigated to,

    • either directly via a URL, or indirectly via page navigation.
    • Customize this method to acquire resources that will be needed
    • for event handlers and lifecycle methods, whether or not this
    • page is performing post back processing.
    • Note that, if the current request is a postback, the property

    • values of the components do not represent any
    • values submitted with this request. Instead, they represent the
    • property values that were saved for this view when it was rendered.
      */
      @Override
      public void init() {
      // Desempenha inicializações herdadas de nossa superclasse
      // Perform initializations inherited from our superclass
      super.init();
      // Desempenha inicialização de aplicativo que deve ser completada
      // antes de componentes gerenciados serem inicializados
      // TODO - adicione aqui seu próprio código de inicialização
// 

// Inicialize automaticamente componentes gerenciados

// <em>Observação</em> - esta lógica NÃO deve ser modificada

try {

_init();

} catch (Exception e) {

log(“Page1 Initialization Failure”, e);

throw e instanceof FacesException ? (FacesException) e : new FacesException(e);

}

// Perform application initialization that must complete

// <em>before</em> managed components are initialized

// TODO - add your own initialiation code here
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
    // Initialize automatically managed components
    // *Note* - this logic should NOT be modified
   
    
    // </editor-fold>
    // Perform application initialization that must complete
    // *after* managed components are initialized
    // TODO - add your own initialization code here
}

/**
 * <p>Callback method that is called after the component tree has been
 * restored, but before any event processing takes place.  This method
 * will <strong>only</strong> be called on a postback request that
 * is processing a form submit.  Customize this method to allocate
 * resources that will be required in your event handlers.</p>
 */
@Override
public void preprocess() {
}

/**
 * <p>Callback method that is called just before rendering takes place.
 * This method will <strong>only</strong> be called for the page that
 * will actually be rendered (and not, for example, on a page that
 * handled a postback and then navigated to a different page).  Customize
 * this method to allocate resources that will be required for rendering
 * this page.</p>
 */
@Override
public void prerender() {
}

/**
 * <p>Callback method that is called after rendering is completed for
 * this request, if <code>init()</code> was called (regardless of whether
 * or not this was the page that was actually rendered).  Customize this
 * method to release resources acquired in the <code>init()</code>,
 * <code>preprocess()</code>, or <code>prerender()</code> methods (or
 * acquired during execution of an event handler).</p>
 */
@Override
public void destroy() {
}

/**
 * <p>Return a reference to the scoped data bean.</p>
 *
 * @return reference to the scoped data bean
 */
protected SessionBean1 getSessionBean1() {
    return (SessionBean1) getBean("SessionBean1");
}

/**
 * <p>Return a reference to the scoped data bean.</p>
 *
 * @return reference to the scoped data bean
 */
protected RequestBean1 getRequestBean1() {
    return (RequestBean1) getBean("RequestBean1");
}

/**
 * <p>Return a reference to the scoped data bean.</p>
 *
 * @return reference to the scoped data bean
 */
protected ApplicationBean1 getApplicationBean1() {
    return (ApplicationBean1) getBean("ApplicationBean1");
}

public String button1_action() {
    // TODO: Processe a ação. O valor de retorno é um nome de caso
    // de navegação em que nulo fará retornar para a mesma página.
    USAddressVerificationSoapVerifyAddressUSA bean = 
            this.getUSAddressVerificationSoapVerifyAddressUSA4();
    bean.setUserID("zaccantte");
    bean.setPassword("zaccantte");
    bean.setAddressLine1((String) getTextField1().getText()); 
    bean.setAddressLine2((String) getTextField2().getText());
    bean.setCityStateZip((String) getTextField3().getText());
    
   getStaticText1().setText(bean.invokeMethod().getAddressStatus());
    
//    getStaticText1().setText(bean.invokeMethod().getAddressStatus());
    return null;
}

/**
 * <p>Inicialização de componente gerenciada automaticamente.  <strong>AVISO:</strong>
 * Esse método é gerado automaticamente, de forma que qualquer código especificado pelo usuário
 * inserido aqui estará sujeito a ser substituído.</p>
 */
private void _init() {
    USAddressVerificationSoapVerifyAddressUSA4.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
    USAddressVerificationSoapVerifyAddressUSA5.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
    USAddressVerificationSoapVerifyAddressUSA6.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
}

}

victor.godinho

Kacildis…

Bem, o problema está no element VerifyAddressUSA (Ó novidade, eu sei…), como foi gerado esse wsdl? Pelo tamanho acho que deve ter sido por alguma IDE né? Mas de qualquer modo, pegue o element VerifyAddressUSA, e verifique se está de acordo com a classe dele.

<s:element name="VerifyAddressUSA"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="UnregisteredUserEmail" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="UserID" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="addressLine1" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="addressLine2" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="city_state_zip" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="firm" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="urbanization" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" default="Upper" name="casing" type="si:casingEnum" /> </s:sequence> </s:complexType> </s:element>

ps.: Da próxima vez coloque o código entre as tags “Code” ;-).

Falows kara

farzac

Ola Victor

Como assim verificar se está de acordo com a classe dele?

victor.godinho

Opa, é só ver se existe mesmo os atributos, se os nomes e tipos estão corretos. Se quiser põe o código dessa sua classe. ( A VerifyAddressUSA )

farzac

Ola Victor

Segue o codigo abaixo:

package adressverify;

import com.strikeiron.USAddressVerificationSoapClient;
import com.strikeiron.USAddressVerificationSoapVerifyAddressUSA;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Label;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.TextField;
import javax.faces.FacesException;

/**
*

Page bean that corresponds to a similarly named JSP page. This
* class contains component definitions (and initialization code) for
* all components that you have defined on this page, as well as
* lifecycle methods and event handlers where you may add behavior
* to respond to incoming events.


*
* @author zaccantte
*/
public class Page1 extends AbstractPageBean {
//
[code]
/**
*

Automatically managed component initialization. WARNING:
* This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.


*/

private Page page1 = new Page();

public Page getPage1() {
return page1;
}

public void setPage1(Page p) {
this.page1 = p;
}

private Html html1 = new Html();

public Html getHtml1() {
return html1;
}

public void setHtml1(Html h) {
this.html1 = h;
}

private Head head1 = new Head();

public Head getHead1() {
return head1;
}

public void setHead1(Head h) {
this.head1 = h;
}

private Link link1 = new Link();

public Link getLink1() {
return link1;
}

public void setLink1(Link l) {
this.link1 = l;
}

private Body body1 = new Body();

public Body getBody1() {
return body1;
}

public void setBody1(Body b) {
this.body1 = b;
}

private Form form1 = new Form();

public Form getForm1() {
return form1;
}

public void setForm1(Form f) {
this.form1 = f;
}
private TextField textField1 = new TextField();

public TextField getTextField1() {
return textField1;
}

public void setTextField1(TextField tf) {
this.textField1 = tf;
}
private TextField textField2 = new TextField();

public TextField getTextField2() {
return textField2;
}

public void setTextField2(TextField tf) {
this.textField2 = tf;
}
private TextField textField3 = new TextField();

public TextField getTextField3() {
return textField3;
}

public void setTextField3(TextField tf) {
this.textField3 = tf;
}
private Label label1 = new Label();

public Label getLabel1() {
return label1;
}

public void setLabel1(Label l) {
this.label1 = l;
}
private Label label2 = new Label();

public Label getLabel2() {
return label2;
}

public void setLabel2(Label l) {
this.label2 = l;
}
private Label label3 = new Label();

public Label getLabel3() {
return label3;
}

public void setLabel3(Label l) {
this.label3 = l;
}
private Button button1 = new Button();

public Button getButton1() {
return button1;
}

public void setButton1(Button b) {
this.button1 = b;
}
private Label label4 = new Label();

public Label getLabel4() {
return label4;
}

public void setLabel4(Label l) {
this.label4 = l;
}
private StaticText staticText1 = new StaticText();

public StaticText getStaticText1() {
return staticText1;
}

public void setStaticText1(StaticText st) {
this.staticText1 = st;
}
private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA4 = new USAddressVerificationSoapVerifyAddressUSA();

public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA4() {
return USAddressVerificationSoapVerifyAddressUSA4;
}

public void setUSAddressVerificationSoapVerifyAddressUSA4(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
this.USAddressVerificationSoapVerifyAddressUSA4 = usavsvausa;
}
private USAddressVerificationSoapClient USAddressVerificationSoapClient3 = new USAddressVerificationSoapClient();

public USAddressVerificationSoapClient getUSAddressVerificationSoapClient3() {
return USAddressVerificationSoapClient3;
}

public void setUSAddressVerificationSoapClient3(USAddressVerificationSoapClient usavsc) {
this.USAddressVerificationSoapClient3 = usavsc;
}
private USAddressVerificationSoapClient USAddressVerificationSoapClient4 = new USAddressVerificationSoapClient();

public USAddressVerificationSoapClient getUSAddressVerificationSoapClient4() {
return USAddressVerificationSoapClient4;
}

public void setUSAddressVerificationSoapClient4(USAddressVerificationSoapClient usavsc) {
this.USAddressVerificationSoapClient4 = usavsc;
}
private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA5 = new USAddressVerificationSoapVerifyAddressUSA();

public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA5() {
return USAddressVerificationSoapVerifyAddressUSA5;
}

public void setUSAddressVerificationSoapVerifyAddressUSA5(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
this.USAddressVerificationSoapVerifyAddressUSA5 = usavsvausa;
}
private USAddressVerificationSoapVerifyAddressUSA USAddressVerificationSoapVerifyAddressUSA6 = new USAddressVerificationSoapVerifyAddressUSA();

public USAddressVerificationSoapVerifyAddressUSA getUSAddressVerificationSoapVerifyAddressUSA6() {
return USAddressVerificationSoapVerifyAddressUSA6;
}

public void setUSAddressVerificationSoapVerifyAddressUSA6(USAddressVerificationSoapVerifyAddressUSA usavsvausa) {
this.USAddressVerificationSoapVerifyAddressUSA6 = usavsvausa;
}

//

/**
*

Construct a new Page bean instance.


*/
public Page1() {
}

/**
*

Callback method that is called whenever a page is navigated to,
* either directly via a URL, or indirectly via page navigation.
* Customize this method to acquire resources that will be needed
* for event handlers and lifecycle methods, whether or not this
* page is performing post back processing.


*
*

Note that, if the current request is a postback, the property
* values of the components do not represent any
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.


*/
@Override
public void init() {
// Desempenha inicializações herdadas de nossa superclasse
// Perform initializations inherited from our superclass
super.init();
// Desempenha inicialização de aplicativo que deve ser completada
// *antes* de componentes gerenciados serem inicializados
// TODO - adicione aqui seu próprio código de inicialização

//
// Inicialize automaticamente componentes gerenciados
// *Observação* - esta lógica NÃO deve ser modificada
try {
_init();
} catch (Exception e) {
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e : new FacesException(e);
}
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here

//
// Initialize automatically managed components
// *Note* - this logic should NOT be modified


//

// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}

/**
*

Callback method that is called after the component tree has been
* restored, but before any event processing takes place. This method
* will only be called on a postback request that
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.


*/
@Override
public void preprocess() {
}

/**
*

Callback method that is called just before rendering takes place.
* This method will only be called for the page that
* will actually be rendered (and not, for example, on a page that
* handled a postback and then navigated to a different page). Customize
* this method to allocate resources that will be required for rendering
* this page.


*/
@Override
public void prerender() {
}

/**
*

Callback method that is called after rendering is completed for
* this request, if init() was called (regardless of whether
* or not this was the page that was actually rendered). Customize this
* method to release resources acquired in the init(),
* preprocess(), or prerender() methods (or
* acquired during execution of an event handler).


*/
@Override
public void destroy() {
}

/**
*

Return a reference to the scoped data bean.


*
* @return reference to the scoped data bean
*/
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
}

/**
*

Return a reference to the scoped data bean.


*
* @return reference to the scoped data bean
*/
protected RequestBean1 getRequestBean1() {
return (RequestBean1) getBean("RequestBean1");
}

/**
*

Return a reference to the scoped data bean.


*
* @return reference to the scoped data bean
*/
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
}

public String button1_action() {
// TODO: Processe a ação. O valor de retorno é um nome de caso
// de navegação em que nulo fará retornar para a mesma página.
USAddressVerificationSoapVerifyAddressUSA bean =
this.getUSAddressVerificationSoapVerifyAddressUSA4();
bean.setUserID("zaccantte");
bean.setPassword("zaccantte");
bean.setAddressLine1((String) getTextField1().getText());
bean.setAddressLine2((String) getTextField2().getText());
bean.setCityStateZip((String) getTextField3().getText());

getStaticText1().setText(bean.invokeMethod().getAddressStatus());

// getStaticText1().setText(bean.invokeMethod().getAddressStatus());
return null;
}

/**
*

Inicialização de componente gerenciada automaticamente. AVISO:
* Esse método é gerado automaticamente, de forma que qualquer código especificado pelo usuário
* inserido aqui estará sujeito a ser substituído.


*/
private void _init() {
USAddressVerificationSoapVerifyAddressUSA4.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
USAddressVerificationSoapVerifyAddressUSA5.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
USAddressVerificationSoapVerifyAddressUSA6.setUSAddressVerificationSoapClient((com.strikeiron.USAddressVerificationSoapClient) getValue("#{Page1.USAddressVerificationSoapClient3}"));
}

}

victor.godinho

Opa, boa. Só faltou a classe… :S VerifyAddressUSA hahaha.

Ow, põe na próxima entre as tags de “Code” ( fica no meu acima do textarea pra digitar a mensagem ).

Mas kara… sinceramente, do fundo do coração você quer que até nome de atributo eu cheque pra você??? Rala um poquinho tambem né ôôô filhote.

Falows

farzac

Ola Victor

Me desculpe se passei essa imagem da minha pessoa a voce.

É que nao estou entendendo que fazer.

Por exemplo:

Baixei o webService na minha maquina, agora crio um classe para comunicar com este webservice.

Vou utilizar este webservice apenas para testar o meu codigo.

Seria isso?

victor.godinho

Relaxa filhote. :wink:

Então velhão, a banda toca assim:
Pega o arquivo .wsdl do webservice que você quer usar (só ele é necessário), e coloca ele em por exemplo: WEB-INF/wsdl/
Caso esteja utilizando o eclipse, clique com o botão direito no arquivo (wsdl), e vá em webservice->generate client.

Ele já vai gerar os VO’s, Exception’s, Stub’s e tudo mais que seu WebService precisa pra que você use ele.

Feito isso, nem vai precisar criar classe nova alguma, uma das classes que o eclipse gera pra você, o stub, já tem todos os métodos do seu webservice, é só chamar normalmente.

Não sei se ficou meio "vago demais - longe de como isso fica na prática - ", mas é isso ai kara, simplizão, : pega o wsdl, manda o eclipse gerar os stubs e companhia, e pronto, você faz chamadas normais ( Meustub stub = new Meustub(); stub.criarProcessoNoServidor(1); ).

Qualquer coisa posta ai filhote.

Falows

Criado 7 de agosto de 2008
Ultima resposta 14 de ago. de 2008
Respostas 9
Participantes 2