SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple: sending XML with PHP

    I'm trying to send this:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Request version="1.0" xmlns="http://europay.smart2pay.com/message">
    <Action>INSERT_PAYIN</Action> <MID>F520156B-5E64-447F-B0B2-C638FA101C6F</MID> <PaymentMethod>mercadopago</PaymentMethod> <IPAddress>127.0.0.1</IPAddress> <Hash>F83525BC77811EC24FF10E50383BB5ED</Hash>
    <Details>
     <MTID>123456789</MTID>
     <Amount>100</Amount>
     <Currency>REA</Currency> <SuccessURL>http://www.smart2pay.com/success.html</SuccessURL>    <FailureURL>http://www.smart2pay.com/failure.html</FailureURL> <CancelURL>http://www.smart2pay.com/cancel.html</CancelURL>   <ProcessingURL>http://www.smart2pay.com/processing.html</ProcessingURL> <Shipping Amount="50" CostMode="DS" />
     <Language>pt-BR</Language> <Description>payment</Description>
     <CustomerName FirstName="John" LastName="Doe" /> <CustomerEmail>john.doe@test.com</CustomerEmail>
        </Details>
    </Request>
    like this:

    Code:
    $client = new SoapClient("https://europaytest.smart2pay.com/MerchantService.asmx?wsdl");
    $response = $client->__doRequest($xml, "https://europaytest.smart2pay.com/MerchantService.asmx", "SubmitRequest", 1.1);
    ...but it just doesn't work saying "Server did not recognize the value of HTTP Header"

    Any ideas?

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    You may need to use the SOAP XML format, rather than the standard XML format

    Example:

    http://en.wikipedia.org/wiki/SOAP#Message_format
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •