title: WSDL: Can't figure out the parameter for method
body: <p>I've been googling around for two days with no luck, hoping directly asking the question would shed light!</p>
  
  <p>I'm working on a stock level update system with a fulfilment company. I've been given the wsdl address and the following instructions:</p>
  
  <blockquote>
    <p>When calling a command, the website must pass the command name to the web service as well as a list
    of parameters. The parameters must be formatted in the following way:</p>
  </blockquote>
  
  <pre><code>&lt;params&gt;
  &lt;ParamName&gt;Value&lt;/ParamName&gt;
  &lt;AnotherParam&gt;Value&lt;/AnotherParam&gt;
  &lt;/params&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>GetStock</strong> - Get available stock levels for a given supplier</p>
    
    <p>Parameter Datatype Comments</p>
    
    <p>ClientCode  String<br>
    SupplierCode    String  Leave blank or exclude
    parameter for all stock levels for the client</p>
  </blockquote>
  
  <p>and:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt;
  &lt;GetStock&gt;
    &lt;StockLevels&gt;
      &lt;Stock&gt;
        &lt;Sku&gt;12848&lt;/Sku&gt;
        &lt;AltSku&gt;&lt;/AltSku&gt;
        &lt;SupplierCode&gt;0044&lt;/SupplierCode&gt;
        &lt;Description&gt;Australia Toggle £20 credit SIM&lt;/Description&gt;
        &lt;InStock&gt;1&lt;/InStock&gt;
        &lt;Allocated&gt;2&lt;/Allocated&gt;
        &lt;Available&gt;17&lt;/Available&gt;
        &lt;Prices&gt;&lt;/Prices&gt;
      &lt;/Stock&gt;
    &lt;/StockLevels&gt;
  &lt;/GetStock&gt;
  </code></pre>
  
  <p>I managed to get my SoapClient working, authenticating and getting a token back (after receiving authentication errors). I couldn't call GetStock so I used __getFunctions() and figured I need to use the GetData() method.</p>
  
  <p>Looking up the WSDL file I found the following:</p>
  
  <pre><code>&lt;wsdl:operation name="GetData"&gt;
      &lt;soap:operation soapAction="http://www.mnp-main.com/OMSConnect/IDataFeed/GetData" style="document"/&gt;
      &lt;wsdl:input&gt;
          &lt;soap:body use="literal"/&gt;
      &lt;/wsdl:input&gt;
      &lt;wsdl:output&gt;
          &lt;soap:body use="literal"/&gt;
      &lt;/wsdl:output&gt;
  &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>Now I'm completely stumped as to what to do! I know GetStock is not an available method so it has to be done via GetData, but I just can't figure out what parameters to pass through it.</p>
  
  <p>The only thing I've figured out is that the second parameter for GetData is the auth token, but the first part - whatever I put it results in the following message:</p>
  
  <blockquote>
    <p>End element 'Body' from namespace '<a href="http://schemas.xmlsoap.org/soap/envelope/" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/</a>' expected. Found element 'param1' from namespace ''. Line 2, position 174.</p>
  </blockquote>
  
  <p>Looking through the schema file hasn't shed any light for me at all either :(</p>
  
  <p>I apologise if I'm missing something very obvious but I've had no former training on this and all the tutorials I came across seem to have clear method name and params in the wsdl file, unlike what I've got here.</p>
  
  <p>Many thanks for your help!</p>
  
  <p><strong>Update 2:</strong></p>
  
  <p>Here's the __getFunctions and __getTypes results:</p>
  
  <pre><code>array(7) {
    [0]=&gt;
    string(59) "AuthenticateResponse Authenticate(Authenticate $parameters)"
    [1]=&gt;
    string(44) "GetDataResponse GetData(GetData $parameters)"
    [2]=&gt;
    string(74) "GetDataWithParamsResponse GetDataWithParams(GetDataWithParams $parameters)"
    [3]=&gt;
    string(68) "ValidateSessionResponse ValidateSession(ValidateSession $parameters)"
    [4]=&gt;
    string(53) "ClearCacheResponse ClearCache(ClearCache $parameters)"
    [5]=&gt;
    string(53) "GetVersionResponse GetVersion(GetVersion $parameters)"
    [6]=&gt;
    string(77) "GetImageWithResizeResponse GetImageWithResize(GetImageWithResize $parameters)"
  }
  </code></pre>
  
  <p>For GetData and GetDataWithParams:</p>
  
  <pre><code>[10]=&gt;
    string(55) "struct GetData {
    string command;
    string tokenValue;
  }"
  [11]=&gt;
    string(56) "struct GetDataResponse {
    ResultGetData GetDataResult;
  }"
  [12]=&gt;
    string(85) "struct GetDataWithParams {
    string command;
    string parameters;
    string tokenValue;
  }"
  [13]=&gt;
    string(76) "struct GetDataWithParamsResponse {
    ResultGetData GetDataWithParamsResult;
  }"
  </code></pre>