PHP Soap客户端[关闭]

HI,

I have this xml I'm trying to make parameter for SOAP Client

<?xml version="1.0" encoding="utf-8" ?> 
<RequestGenerateInvoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="XML">
  <Type>enAdd</Type> 
  <Invoice>
      <InvoiceNumber>5</InvoiceNumber> 
      <InvoiceIDTxt>101</InvoiceIDTxt> 
      <AccountIDTxt>1001</AccountIDTxt> 
      <InvoiceDate>2011-02-21T15:04:42.8500736+02:00</InvoiceDate> 
      <Code>1</Code> 
      <Details>Some Details</Details> 
      <Quantity>1</Quantity> 
      <Amount>10</Amount> 
      <AmountDue>20</AmountDue> 
      <FromDate>2011-02-21T15:04:42.8490735+02:00</FromDate> 
      <ToDate>2011-02-21T15:04:42.8530738+02:00</ToDate> 
      <Months>7</Months> 
      <IsPrinted>false</IsPrinted> 
      <Paid>0</Paid> 
      <CardNumber>101</CardNumber> 
      <PrevAccBalance>100</PrevAccBalance> 
      <RealUsageAmount>80</RealUsageAmount> 
      <LocationID>0</LocationID> 
      <BatchNumber>1</BatchNumber> 
      <BatchText>Some Text</BatchText> 
  </Invoice>
  <RequestLocationID>0</RequestLocationID> 
  <RequestDateTime>0001-01-01T00:00:00</RequestDateTime> 
</RequestGenerateInvoice>

So far my script is:

$client = new SoapClient("https://Some.?wsdl");
$client->MakeInvoice(array('Type'=>'enAdd', 
                           'Invoice'=> array('InvoiceNumber' => '101', 
                                             'InvoiceIDTxt' => '101', 
                                             'AccountIDTxt' => '2',......), 
                           'RequestLocationID'=>'2', 
                           'RequestDateTime'=>'0001-01-01T00:00:00'));

But I'm keep getting no response from the server

You need Content-Type: text/xml

Try using SoapClient->_getLastRequest() and SoapClient->_getLastResponse() to see what's going on under the hood. Note that you need to switch this feature on in the SoapClient constructor:

$client = SoapClient("some.wsdl", array('trace' => 1));

I don't believe that this XML is part of a SOAP communication. There is no SOAP envelope and body?! This seems to be a ReST API. Anyway you should read the documentation of the API.

If you are only interested in generating the printed XML via PHP you can use either DOM or SimpleXML.