SOAP-ERROR:编码:对象没有' Endereco'属性

时间:2014-12-09 18:39:47

标签: php web-services soap wsdl

我需要使用web服务并且我使用php来创建客户端,但是在运行脚本时它会返回以下错误:

致命错误:未捕获的SoapFault异常:[客户端] SOAP-ERROR:编码:对象在/srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php:147中没有'Endereco'属性堆栈跟踪:#0 / srv / www / htdocs / wwwintranet / nusoap_ex / sap_xml.php(147):/srv/www/htdocs/wwwintranet/nusoap_ex/sap_xml.php中抛出的SoapClient-> __ soapCall('InputCV',Array)#1 {main}在第147行

一段Wsdl文件:

<xsd:element name="Endereco" type="DT_CV_INBOUND_ENDERECO_Data">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">62f66dd96a9711e4a9ab50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                </xsd:element>



........ 

            <xsd:complexType name="DT_CV_INBOUND_ENDERECO_Data">
                <xsd:annotation>
                    <xsd:appinfo source="http://sap.com/xi/VersionID">4a5894c76a8411e4a4f10000002b025a</xsd:appinfo>
                </xsd:annotation>
                <xsd:sequence>
                    <xsd:element name="Numero">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca748096a8511e4a17d50465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="10" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="Complemento">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480a6a8511e4ce6950465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="40" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="Bairro">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480b6a8511e4908850465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="40" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="Cidade">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480c6a8511e4c62450465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="40" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="CEP">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480d6a8511e4b8d050465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="10" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="Estado">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480e6a8511e4cffb50465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="3" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                    <xsd:element name="Celular">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca748116a8511e4a92650465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="Tipo">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca7480f6a8511e4c66d50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                                <xsd:element name="Numero">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca748106a8511e48a1b50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="20" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="Residencial">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca766dc6a8511e4b23a50465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="Tipo">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca748126a8511e4a06f50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                                <xsd:element name="Numero">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca766db6a8511e4ad4c50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="20" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="Comercial">
                        <xsd:annotation>
                            <xsd:appinfo source="http://sap.com/xi/TextID">1ca766df6a8511e4939950465d3c7dc9</xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element name="Tipo">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca766dd6a8511e4c98050465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="4" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                                <xsd:element name="Numero">
                                    <xsd:annotation>
                                        <xsd:appinfo source="http://sap.com/xi/TextID">1ca766de6a8511e4c28b50465d3c7dc9</xsd:appinfo>
                                    </xsd:annotation>
                                    <xsd:simpleType>
                                        <xsd:restriction base="xsd:string">
                                            <xsd:maxLength value="20" />
                                        </xsd:restriction>
                                    </xsd:simpleType>
                                </xsd:element>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                    <xsd:element name="Email">
                        <xsd:simpleType>
                            <xsd:restriction base="xsd:string">
                                <xsd:maxLength value="241" />
                            </xsd:restriction>
                        </xsd:simpleType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:complexType>

php代码:

try {  
    $client = new soapclient(
    'SI_CV_WS_Outb_SyncService.wsdl',
    array(
        'proxy_host' => "mv114.agraria.coop.br",
        'proxy_port' => 50000,
        'proxy_login' => "WSPO",
        'proxy_password' => "WAgr9876",
        'trace' => 1, 
        'exceptions' => true, 
        'cache_wsdl' => WSDL_CACHE_NONE
         )
    );
} catch (Exception $e) {  
    echo $e->getMessage(); 
} 

$function = 'InputCV';
$arguments = array('MT_CV_INBOUND_Request' => array( 'ListaDadosCV' => 
                    array( 'DadosPessoais' => array(
                                                    'Sobrenome'              => '?',
                                                    'Nome'                   => '?',
                                                    'DataNascimento'         => '?',
                                                    'EstadoCivil'            => '?',
                                                    'Sexo'                   => '?',
                                                    'Nacionalidade'          => '?',
                                                    'FoiColaboradorEmpresa'  => '?',
                                                    'Segmento'               => '?'
                                            )),
                    array( 'Endereco'      => array(
                                                    'Numero'                 => '?',
                                                    'Complemento'            => '?',
                                                    'Bairro'                 => '?',
                                                    'Cidade'                 => '?',
                                                    'CEP'                    => '?',
                                                    'Estado'                 => '?',
                                                    'Celular'       => array(
                                                                'Tipo'      => '?',
                                                                'Numero'    => '?'
                                                                ),
                                                    'Residencial'   => array(
                                                                'Tipo'      => '?',
                                                                'Numero'    => '?'
                                                                ),
                                                    'Comercial'     => array(
                                                                'Tipo'      => '?',
                                                                'Numero'    => '?'
                                                                ),
                                                    'Email'                 => '?'
                    )),
                    array( 'Documentos'    => array(
                                                    'CPF'                   => '?',
                                                    'RG'                    => '?',
                                                    'OrgaoExpeditor'        => '?',
                                                    'DataEmissaoRG'         => '?',
                                                    'CNH'                   => '?',
                                                    'DataEmissaoCNH'        => '?',
                                                    'OrgaoEmissorCNH'       => '?'
                                                    )),
                    array( 'ListaFormacoesEducacionais'    => array(
                                                    'Comercial'     => array(
                                                                'DataTermino'       => '?',
                                                                'NivelFormacao'     => '?',
                                                                'Instituicao'       => '?',
                                                                'Situacao'          => '?',
                                                                'CursoSuperior'     => '?'
                                                                ),
                                                    )),
                    array( 'ListaEmpregosAnteriores'      => array(
                                                    'EmpregoAnterior'=> array(
                                                                'DataAdmissao'      => '?',
                                                                'DataDemissao'      => '?',
                                                                'Empresa'           => '?',
                                                                'Local'             => '?',
                                                                'Pais'              => '?',
                                                                'Cargo'             => '?'
                                                                ),
                                                    )),
                    array( 'ListaQualificacoes'           => array(
                                                    'Qualificacao'=> array(
                                                                'OTYPE'         => '?',
                                                                'OBJID'         => '?',
                                                                'STEXT'         => '?',
                                                                'LEVEL'         => '?',
                                                                'PUP_OTYPE'     => '?',
                                                                'BEGDA'         => '?',
                                                                'ENDDA'         => '?'
                                                                ),
                                                    )),
                    array( 'ListaAdicionais'              => array(
                                                    'Adicionais '=> array(
                                                                'NumeroLinha'       => '?',
                                                                'Texto'             => '?',
                                                                ),
                                                    )),
                    array( 'AtribuicaoVaga'    => array(
                                                    'DataInicio'                => '?',
                                                    'Vaga'                      => '?'
                                                    ))
            ));

//$options = array('http://mv114.agraria.coop.br:50000/XISOAPAdapter/MessageServlet?channel=:BC_SOAP_CV:CC_SOAP_CV_Sender');

$result = $client->__soapcall($function, $arguments);   //line 147

echo '<br/><br/>Response: <br/>';
print_r($result);


?>

如果有人能帮助我,我将非常感激。感谢

0 个答案:

没有答案