Jump to content

nymets1104

Members
  • Posts

    18
  • Joined

  • Last visited

Everything posted by nymets1104

  1. UPDATE! After migrating my entire site to a new Host with a robust support of PHP and SOAP I have successfully made calls to the API <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://clients.mindbodyonline.com/api/0_5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns1:CheckoutShoppingCart> <ns1:Request> <ns1:SourceCredentials> <ns1:SourceName>YogaStudio</ns1:SourceName> <ns1:Password>***********************</ns1:Password> <ns1:SiteIDs> <ns1:int>99999</ns1:int> </ns1:SiteIDs> </ns1:SourceCredentials> <ns1:UserCredentials> <ns1:Username>username</ns1:Username> <ns1:Password>password</ns1:Password> <ns1:SiteIDs> <ns1:int>99999</ns1:int> </ns1:SiteIDs> </ns1:UserCredentials> <ns1:XMLDetail xsi:nil="true"/> <ns1:PageSize xsi:nil="true"/> <ns1:CurrentPageIndex xsi:nil="true"/> <ns1:ClientID>999</ns1:ClientID> <ns1:Test>true</ns1:Test> <ns1:CartItems> <ns1:CartItem> <ns1:Item xsi:type="ns1:Service"> <ns1:ID>77</ns1:ID> </ns1:Item> <ns1:DiscountAmount>0</ns1:DiscountAmount> <ns1:Quantity>1</ns1:Quantity> < /ns1:CartItem> </ns1:CartItems> <ns1:InStore xsi:nil="true"/> <ns1:Payments> <ns1:PaymentInfo xsi:type="ns1:CreditCardInfo"> <ns1:CreditCardNumber>9999999999999999</ns1:CreditCardNumber> <ns1:Amount>15</ns1:Amount> <ns1:ExpMonth>06</ns1:ExpMonth> <ns1:ExpYear>2015</ns1:ExpYear> <ns1:BillingAddress>123 Happy Ln</ns1:BillingAddress> <ns1:BillingPostalCode>93405</ns1:BillingPostalCode> </ns1:PaymentInfo> </ns1:Payments> <ns1:SendEmail xsi:nil="true"/> <ns1:LocationID xsi:nil="true"/> </ns1:Request> </ns1:CheckoutShoppingCart> </SOAP-ENV:Body> </SOAP-ENV:Envelope> I used this PHP to make the call: <?php ini_set('display_errors', 1); error_reporting(-1); include_once('MINDBODY_API_v0.5.php'); $mb = new MINDBODY_API(); $checkoutShoppingCartRequest = $mb->CheckoutShoppingCart(array( 'Test'=>'true', 'ClientID'=>999, 'CartItems'=>array( 'CartItem'=>array( 'Quantity'=>1, 'Item' => new SoapVar( array('ID'=>'999'), SOAP_ENC_ARRAY, 'Service', 'http://clients.mindbodyonline.com/api/0_5' ), 'DiscountAmount' => 0 ) ), 'Payments' => array( 'PaymentInfo' => new SoapVar( array( 'CreditCardNumber'=>'9999999999999999', 'ExpYear'=>'2015', 'ExpMonth'=>'06', 'Amount'=>'0', 'BillingAddress'=>'123 Happy Ln', 'BillingPostalCode'=>'93405' ), SOAP_ENC_ARRAY, 'CreditCardInfo', 'http://clients.mindbodyonline.com/api/0_5' ) ) )); ?> <textarea><?= $mb->getXMLRequest(); ?></textarea> <textarea><?= $mb->getXMLResponse(); ?></textarea> Thanks for all who commeted as it was all very helpful!
  2. I appreciate your help with this. Unfortunately it seems with the limitations imposed by Fatcow Hosting, I am not bale to form the request in the way that the Server handling it can interpret correctly. I briefly attempted to use Java script to run interact with the Web Service, but this caused even more problems with cross domain issues and so forth. I will continue to work through this and will post any updates here. Again, thanks for sticking with me on this frustrating situation
  3. OK I tried this: echo "Request: ".$proxySales->_last_request; and got nothing... Request:
  4. Good Call, now I get: Request : No operation __getLastRequest for port Sale_x0020_ServiceSoap in WSDL. The Code I am using to call this is: sale_proxy.php: <?php class WebService_Sale_x0020_Service_Sale_x0020_ServiceSoap extends SOAP_Client { function WebService_Sale_x0020_Service_Sale_x0020_ServiceSoap($path = 'https://api.mindbodyonline.com/0_5/SaleService.asmx?wsdl') { $option=array('trace'=>1); $this->SOAP_Client($path,$option); } function &CheckoutShoppingCart($Request) { $CheckoutShoppingCart = new SOAP_Value('{http://clients.mindbodyonline.com/api/0_5}CheckoutShoppingCart', false, $v = array('Request' => $Request)); $result = $this->call('CheckoutShoppingCart', $v = array('CheckoutShoppingCart' => $CheckoutShoppingCart), array('namespace' => 'http://clients.mindbodyonline.com/api/0_5', 'soapaction' => 'http://clients.mindbodyonline.com/api/0_5/CheckoutShoppingCart', 'style' => 'document', 'use' => 'literal')); return $result; } sale.php: require_once 'SOAP/Client.php'; require_once 'sale_proxy.php'; $proxySales= new WebService_Sale_x0020_Service_Sale_x0020_ServiceSoap(); $ret=$proxySales->CheckoutShoppingCart($Request); // <xmp> tag displays xml output in html echo 'Request : <br/><xmp>', $proxySales->__getLastRequest(), '</xmp><br/><br/> Error Message : <br/>';
  5. Set Trace to 1 and got this response: Unable to parse WSDL file https://api.mindbodyonline.com/0_5/SaleService.asmx XML error on line 5: > required Im doing some googling as we speak... I get this same message for succesful and unsuccesful SOAP Calls
  6. So I tried capturing the XML Packets with Wireshark on this SOAP Request and even on other succesful Requests. I had no luck, but then it dawned on me. The XML is being sent from the Server (Fatcow) to the Web Service Endpoint (MindBody). So would it even be possible to capture this packet with wireshark or an alternate way?
  7. Thank You very much for your input. I believe that these limitations from PEAR will ultimately make it impossible to accomplish this call successfully. I did try the Soap_Value suggestion and while it did fix the Fatal Errors, the End Point doesnt seem to recognize it as a valid request. [CartItems] => Array ( [0] => Array ( [Quantity] => 1 [Item] => SOAP_Value Object ( [value] => Array ( [ID] => 1357 ) [nqn] => QName Object ( [name] => Item [prefix] => [namespace] => ) [name] => Item [namespace] => [tqn] => QName Object ( [name] => Service [prefix] => [namespace] => ) [type] => Service [type_namespace] => [arrayType] => [attributes] => Array ( ) [options] => Array ( ) ) ) ) [Payments] => Array ( [0] => Array ( [PaymentInfo] => SOAP_Value Object ( [value] => Array ( [CreditCardNumber] => 4111111111111111 [ExpYear] => 2015 [ExpMonth] => 06 [Amount] => 130 [BillingAddress] => 123 Happy Ln [BillingPostalCode] => 93405 ) [nqn] => QName Object ( [name] => PaymentInfo [prefix] => [namespace] => ) [name] => PaymentInfo [namespace] => [tqn] => QName Object ( [name] => CreditCardInfo [prefix] => [namespace] => ) [type] => CreditCardInfo [type_namespace] => [arrayType] => [attributes] => Array ( ) [options] => Array ( ) ) ) ) ) object(stdClass)#13 (7) { ["Status"]=> string(17) "InvalidParameters" ["ErrorCode"]=> string(4) "9999" ["Message"]=> string(55) "The cart must have at least one payment method defined." ["XMLDetail"]=> string(4) "Full" ["ResultCount"]=> string(1) "0" ["CurrentPageIndex"]=> string(1) "0" ["TotalPageCount"]=> string(1) "0" } I can start another thread for this, but rather than relocating my website to a Server that supports a more recent and robust PHP Library, would it be possible for me to utililize an external server for these requests while allowing me to keep my site with Fatcow?
  8. Unfortunately Fatcow's shared hosting is very limited as far as PHP: http://www.fatcow.com/knowledgebase/beta/article.bml?ArticleID=2124 SOAP is installed as I can make calls to this API that do not contain the XSI:TYPE tag (<Item xsi:type="Service">) Fatcow does not support PHP SOAP only PEAR SOAP which seems to be a huge hurdle.
  9. Once I enabled Error Reporting I am getting these Errors: Notice: Undefined property: stdClass::$PaymentInfo in /hermes/waloraweb019/b71/moo.studiosevacom/saleOYC.php on line 35 Fatal error: Class 'SoapVar' not found in /hermes/waloraweb019/b71/moo.studiosevacom/saleOYC.php on line 35 I am running PEAR SOAP on Fatcow with PHP 5.3
  10. Is this thread hidden? I noticed it has 0 views in 12 hours? Edit: Hmm, now it suddenly has 39 views. Guess I needed to refresh
  11. I have been using PEAR SOAP with an API that supports SOAP for several years. One a new call I am trying to implement, the request is required to be in this format: <CartItems> <CartItem> <Quantity>1</Quantity> <Item xsi:type="Service"> <ID>000123</ID> </Item> </CartItem> </CartItems> <Payments> <PaymentInfo xsi:type="CreditCardInfo"> <CreditCardNumber>{CreditCardNumber}</CreditCardNumber> <Amount>5</Amount> <BillingAddress>123 Happy Ln</BillingAddress> <BillingCity>San Luis Obispo</BillingCity> <BillingState>CA</BillingState> <BillingPostalCode>93405</BillingPostalCode> <ExpYear>2014</ExpYear> <ExpMonth>7</ExpMonth> <BillingName>Bob Joe</BillingName> </PaymentInfo> </Payments> The main issues are with: <Item xsi:type="Service"> AND <PaymentInfo xsi:type="CreditCardInfo"> With traditional PHP SOAP I Would use the following code for the request: $checkoutShoppingCartRequest = $mb->CheckoutShoppingCart(array( 'Test'=>'true', 'ClientID'=>1234, 'CartItems'=>array( 'CartItem'=>array( 'Quantity'=>1, 'Item' => new SoapVar( array('ID'=>'1357'), SOAP_ENC_ARRAY, 'Service', 'http://clients.mindbodyonline.com/api/0_5' ), 'DiscountAmount' => 0 ) ), 'Payments' => array( 'PaymentInfo' => new SoapVar( array( 'CreditCardNumber'=>'4111111111111111', 'ExpYear'=>'2015', 'ExpMonth'=>'06', 'Amount'=>'130', 'BillingAddress'=>'123 Happy Ln', 'BillingPostalCode'=>'93405' ), SOAP_ENC_ARRAY, 'CreditCardInfo', 'http://clients.mindbodyonline.com/api/0_5' ) ) )); This does not seem to work with PEAR SOAP, in fact anything involving the SoapVar kills the request and nothing is sent. Any statements or even an echo "HELLO" below the SoapVar are not touched when I load the page. I have found very limited documention on this. Does anyone know the proper way to form this request with PEAR SOAP?
  12. For anyone attempting to use PEAR SOAP with their Webservice, I was able to generate the proxy code for each class from the WSDL by using the PEAR SOAP method generateProxyCode() to generate PEAR SOAP compliant code that is slightly different than the standard php. Example: http://stackoverflow.com/questions/16... PEAR SOAP documentation: http://pear.php.net/package/SOAP/docs... I was finally able to make a valid request and get a response after nearly 3 weeks of hair pulling and testing with my webservice
  13. I am attempting to implement an API on my website using WSDL through SOAP. My hosting company (fatcow) does not support PHP SOAP. They do however support PEAR SOAP 0.9.1. I have continuosly ran into the error: Server was unable to process request. --- Object reference not set to an instance of an object. I believe I am possibly forming the XML SOAP request incorrectly. The getLastRequest() method is not returning anything for debugging. The var_dump() method is returning an enormous amount of information. I am looking for some guidance in debugging this SOAP call. I have included my php code below with the resulting XML SOAP request found in my var_dump. <?php require_once 'SOAP/Client.php'; $WSDL=new SOAP_WSDL('https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl',array(trace=>1)); $proxy=$WSDL->getProxy(); $options=array('soapaction' => 'http://clients.mindbodyonline.com/api/0_5/GetLocations'); $params = array('Request'=>array('SourceCredentials' => array('SourceName'=>'StudioSevaYoga','Password'=>'*************','siteIDs'=>array('int'=>'23661')),'XMLDetail'=>'Full','PageSize'=>'10','CurrentPageIndex'=>'0')); $ret = $proxy->call("GetLocations",$params,$options); var_dump($ret); ?> POST /0_5/SiteService.asmx HTTP/1.0 User-Agent: PEAR-SOAP @version@-beta Host: api.mindbodyonline.com Content-Type: text/xml; charset=UTF-8 Content-Length: 862 SOAPAction: "http://clients.mindbodyonline.com/api/0_5/GetLocations" Connection: close <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <GetLocations> <Request> <SourceCredentials> <SourceName xsi:type="xsd:string">StudioSevaYoga</SourceName> <Password xsi:type="xsd:string">********************</Password> <siteIDs> <int xsi:type="xsd:string">23661</int></siteIDs></SourceCredentials> <XMLDetail xsi:type="xsd:string">Full</XMLDetail> <PageSize xsi:type="xsd:string">10</PageSize> <CurrentPageIndex xsi:type="xsd:string">0</CurrentPageIndex></Request></GetLocations> </SOAP-ENV:Body> </SOAP-ENV:Envelope> WSDL: https://api.mindbodyonline.com/0_5/SiteService.asmx?wsdl My php page throwing error: http://studio-seva.com/pearSoap5.php Any help would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.