Jump to content

Search the Community

Showing results for tags 'XML SOAP PHP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. I am trying to make a shopping cart and am using a web service my partner made to complete a transaction. The idea is to build an xml sheet and then transmit it to the web service using SOAP, but since PHP is a web language I am having problems. The web service is expecting a string, but the web service keeps getting a null pointer each time I try to submit the XML. $xmlDocument = '<?xml version="1.0" encoding="utf-16"?>'; $xmlDocument.= '<SalesOrder dateCreated="'.$year.'-'.$mon.'-'.$day.' '.$hour.':'.$minutes.':'.$seconds.'" amount="'.$amount.'" mark_up="15.0000" customerID="'.$customer_id.'" employeeID="80000003-1325611163" source="0">'; while($row=mysql_fetch_array($result)){ //Product Id is called ProductID in the XML$product_id = $row['product_id']; //Sales info is NOT needed for the order.$sales_info = $row['sales_info'];echo $sales_info.'<br>';//Final price is called SalesPrice in the XML$final_price = $row['final_price'];echo $final_price.'<br>';//qty is called Quantity in the XML$qty = $row['qty'];echo $qty.'<br>';//Purchase cost is called PurchaseCost in the XML$purchase_cost = $row['purchase_cost'];echo $purchase_cost.'<br>'; $xmlDocument .="<SalesOrderLine>"; $xmlDocument.='<ProductID>'.$product_id.'</ProductID>';$xmlDocument.='<Quantity>'.$qty.'</Quantity>';$xmlDocument.='<SalesPrice>'.$final_price.'</SalesPrice>';$xmlDocument.='<PurchaseCost>'.$purchase_cost.'</PurchaseCost>'; // Escaping illegal characters $xmlDocument.='</SalesOrderLine>';//$amount = $amount + $final_price;//$i++;} $xmlDocument .="</SalesOrder>"; echo $xmlDocument."<br>"; ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient("http://someplace.com/CreateDB?wsdl", array( 'trace' => 1, 'exceptions' => 1, 'soap_version' => SOAP_1_1, 'encoding' => 'ISO-8859-1', 'features' => SOAP_SINGLE_ELEMENT_ARRAYS )); $xmlvar = new SoapVar( "<ns1:xmlDocument>".$xmlDocument."</ns1:xmlDocument>", XSD_ANYXML );$params->xmlDocument = (object)$xmlvar; $save_result = $client->AddSalesOrder($params); I've been learning as much as I can about SOAP, but its really new to me. How do I make the xml document successfully go to the web service? The server log says that the connection is successful each time I click the submit button. But nothing is transferred to the web service.
×
×
  • Create New...