SoapFault异常:[HTTP]路径中的请求错误

SoapFault异常:[HTTP]路径中的请求错误,soap,Soap,我将集成Way代币支付集成,我面临这个问题 SoapFault exception: [HTTP] Bad Request wsdl文件在这里 https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx?wsdl 这里是xml格式 https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpa

我将集成Way代币支付集成,我面临这个问题

SoapFault exception: [HTTP] Bad Request
wsdl文件在这里

https://www.eway.com.au/gateway/ManagedPaymentService/managedCreditCardPayment.asmx?wsdl
这里是xml格式

https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx?op=CreateCustomer
我用$client->uu getLastRequest()获取xml文件;剧本是

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="https://www.eway.com.au/gateway/managedpayment" xmlns:ns2="eWAYHeader">
<env:Header>
<ns2:http://www.eway.com.au/gateway/managedPayment>
<item>
<key>eWAYCustomerID</key><value>87654321</value>
</item>
<item><key>Username</key><value>test@eway.com.au</value>
</item>
<item><key>Password</key><value>test123</value>
</item>
</ns2:http://www.eway.com.au/gateway/managedPayment>
</env:Header><env:Body>
<ns1:CreateCustomer>
<ns1:Title>Mr.</ns1:Title>
<ns1:FirstName>Joe</ns1:FirstName>
<ns1:LastName>Bloggs</ns1:LastName>
<ns1:Address>Bloggs Enterprise</ns1:Address>
<ns1:Suburb>Capital City</ns1:Suburb>
<ns1:State>ACT</ns1:State>
<ns1:Company>Bloggs</ns1:Company>
<ns1:PostCode>2111</ns1:PostCode>
<ns1:Country>au</ns1:Country>
<ns1:Email>test@eway.com.au</ns1:Email>
<ns1:Fax>0298989898</ns1:Fax>
<ns1:Phone>0297979797</ns1:Phone>
<ns1:Mobile>9841381980</ns1:Mobile>
<ns1:CustomerRef>Ref123</ns1:CustomerRef>
<ns1:JobDesc>Web developer</ns1:JobDesc>
<ns1:Comments>Please Ship ASASP</ns1:Comments>
<ns1:URL>http://www.test.com.au</ns1:URL>
<ns1:CCNumber>4444333322221111</ns1:CCNumber>
<ns1:CCNameOnCard>Test Account </ns1:CCNameOnCard>
<ns1:CCExpiryMonth>1</ns1:CCExpiryMonth>
<ns1:CCExpiryYear>13</ns1:CCExpiryYear>
</ns1:CreateCustomer>
</env:Body>
</env:Envelope>
我得到:

SoapFault exception: [HTTP] Bad Request in D:\wamp\www\eway\newfile.php:196
Stack trace:
#0 [internal function]: SoapClient->__doRequest('__call('CreateCustomer', Array)
#2 D:\wamp\www\eway\newfile.php(196): SoapClient->CreateCustomer(Array)
#3 {main}
调用此函数时,此错误始终存在

$customerinfo = 
        array(
        'Title'=>'Mr.',
        'FirstName' => 'Joe',
        'LastName'=>'Bloggs',
        'Address'=>'Bloggs Enterprise',
        'Suburb'=>'Capital City',
        'State'=>'ACT',
        'Company'=>'Bloggs',
        'PostCode'=>'2111',
        'Country'=>'au',
        'Email'=>'test@eway.com.au',
        'Fax'=>'0298989898',
        'Phone'=>'0297979797',
        'Mobile'=>'9841381980',
        'CustomerRef'=>'Ref123',
        'JobDesc'=>'Web developer',
        'Comments'=>'Please Ship ASASP',
        'URL'=>'http://www.test.com.au',
        'CCNumber'=>'4444333322221111',
        'CCNameOnCard'=>'Test Account ',
        'CCExpiryMonth'=>'01',
        'CCExpiryYear'=>'13'

);

$client->CreateCustomer($customerinfo);
任何帮助都会更有价值


提前感谢。

请尝试使用以下代码:

<?php
$apiUrl         = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx?WSDL';
$options        = array( 'trace' => 1, 'exceptions' => 1);
try{
    $client     = new SoapClient($apiUrl, $options);
    $data       = array(
        'eWAYCustomerID'    => '87654321',
        'Username'          => "test@eway.com.au",
        'Password'          => "test123"
    );

    $header = new SoapHeader('https://www.eway.com.au/gateway/managedpayment', 'eWAYHeader', $data, false);
    $client->__setSoapHeaders($header);

    $customerinfo =  array(
            'Title'=>'Mr.',
            'FirstName' => 'Joe',
            'LastName'=>'Bloggs',
            'Address'=>'Bloggs Enterprise',
            'Suburb'=>'Capital City',
            'State'=>'ACT',
            'Company'=>'Bloggs',
            'PostCode'=>'2111',
            'Country'=>'au',
            'Email'=>'test@eway.com.au',
            'Fax'=>'0298989898',
            'Phone'=>'0297979797',
            'Mobile'=>'9841381980',
            'CustomerRef'=>'Ref123',
            'JobDesc'=>'Web developer',
            'Comments'=>'Please Ship ASASP',
            'URL'=>'http://www.test.com.au',
            'CCNumber'=>'4444333322221111',
            'CCNameOnCard'=>'Test Account ',
            'CCExpiryMonth'=>'01',
            'CCExpiryYear'=>'13'

    );

    $result = $client->CreateCustomer($customerinfo);
    var_dump($result);

}catch(Exception $e){
    echo $e->getMessage();
}

<?php
$apiUrl         = 'https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx?WSDL';
$options        = array( 'trace' => 1, 'exceptions' => 1);
try{
    $client     = new SoapClient($apiUrl, $options);
    $data       = array(
        'eWAYCustomerID'    => '87654321',
        'Username'          => "test@eway.com.au",
        'Password'          => "test123"
    );

    $header = new SoapHeader('https://www.eway.com.au/gateway/managedpayment', 'eWAYHeader', $data, false);
    $client->__setSoapHeaders($header);

    $customerinfo =  array(
            'Title'=>'Mr.',
            'FirstName' => 'Joe',
            'LastName'=>'Bloggs',
            'Address'=>'Bloggs Enterprise',
            'Suburb'=>'Capital City',
            'State'=>'ACT',
            'Company'=>'Bloggs',
            'PostCode'=>'2111',
            'Country'=>'au',
            'Email'=>'test@eway.com.au',
            'Fax'=>'0298989898',
            'Phone'=>'0297979797',
            'Mobile'=>'9841381980',
            'CustomerRef'=>'Ref123',
            'JobDesc'=>'Web developer',
            'Comments'=>'Please Ship ASASP',
            'URL'=>'http://www.test.com.au',
            'CCNumber'=>'4444333322221111',
            'CCNameOnCard'=>'Test Account ',
            'CCExpiryMonth'=>'01',
            'CCExpiryYear'=>'13'

    );

    $result = $client->CreateCustomer($customerinfo);
    var_dump($result);

}catch(Exception $e){
    echo $e->getMessage();
}