Problem mit SOAP Server Ausgabe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem mit SOAP Server Ausgabe

    Moin Leute,

    ich stehe seit einiger Zeit vor einem SOAP Server Problem. Mein Ziel ist eine Amazon Umgebung nachzubilden. Die WSDL Datei stammt also von Amazon, nur die SOAP Adresse wurde verändert um meinen Server anzusteuern.

    WSDL Datei: AmazonFBAInventory.wsdl

    Wenn ich eine Anfrage sende, sei es durch meinen Client oder über SOAPClient.com, bekomme ich keinerlei Antwort.

    Hier die angesprochene PHP Datei.

    PHP Code:
    function ListUpdatedInventorySupply($request){

        return 
    "<ns1:ListUpdatedInventorySupplyResponse      
          xmlns:ns1=\"http://fba-inventory.amazonaws.com/doc/2009-07-31/\">
          <ns1:ListUpdatedInventorySupplyResult>
            <ns1:NextToken>H4sIAAAAAAAAAD</ns1:NextToken>
            <ns1:HasNext>true</ns1:HasNext>
            <ns1:MerchantSKUSupply>
              <ns1:MerchantSKU>25</ns1:MerchantSKU>          
              <ns1:FulfillmentNetworkSKU>TESTCASE15</ns1:FulfillmentNetworkSKU>
              <ns1:ASIN>TESTCASE15</ns1:ASIN>
              <ns1:Condition />
              <ns1:TotalSupplyQuantity>0</ns1:TotalSupplyQuantity>          
              <ns1:InStockSupplyQuantity>0</ns1:InStockSupplyQuantity>
            </ns1:MerchantSKUSupply>
          </ns1:ListUpdatedInventorySupplyResult>
          <ns1:ResponseMetadata>       
            <ns1:RequestId>
              479527b9-53e2-455e-9d05-f948292e7ff0
            </ns1:RequestId>
          </ns1:ResponseMetadata>
        </ns1:ListUpdatedInventorySupplyResponse>"
    ;
        
        }

    $server = new SoapServer("AmazonFBAInventory.wsdl"); 
    $server->addFunction("ListUpdatedInventorySupply");
    $server->handle(); 
    Warum gekomme ich den Return nicht ausgegeben? Danke im voraus.

  • #2
    'kein Antwort' gibt es nicht.
    was sagt getLastResponseHeaders ?
    Slava
    bituniverse.com

    Comment


    • #3
      Hab das Problem gelöst, über SOAP Client.com bekomm ich jetzt die Ausgabe.

      Eine jetzt neue aufgekommene Frage ist, warum mein Client die Antwort nicht auswerten kann. Zur Client Implementierung habe ich zu Testzwecken eine einfach XML Datei benutzt. Wenn ich selbige jedoch über den Server übergeben will, funktioniert es nicht.
      Über Soapclient.com bekommen ich alle Werte als String hintereinander gehängt ausgegeben.

      PHP Code:
      return Amazon_FWSInventory_Model_ListUpdatedInventorySupplyResponse::fromXML(_invoke('ListUpdatedInventorySupply'));

      function 
      _invoke($actionName)
          {
              return 
      $xml file_get_contents('Amazon/FWSInventory/Mock/' $actionName 'Response.xml'TRUE);
          }

      function 
      fromXML($xml)
          {
              
      $dom = new DOMDocument();
              
      $dom->loadXML($xml);
              
      $xpath = new DOMXPath($dom);
              
      $xpath->registerNamespace('a''http://fba-inventory.amazonaws.com/doc/2009-07-31/');
              
      $response $xpath->query('//a:ListUpdatedInventorySupplyResponse');
              if (
      $response->length == 1) {
                  return new 
      Amazon_FWSInventory_Model_ListUpdatedInventorySupplyResponse(($response->item(0))); 
              } else {
                  throw new 
      Exception ("Unable to construct 
      Amazon_FWSInventory_Model_ListUpdatedInventorySupplyResponse from provided XML. 
                                        Make sure that ListUpdatedInventorySupplyResponse is a root element"
      );
              }
                
          } 
      Last edited by herrentor; 14-05-2010, 14:53.

      Comment

      Working...
      X