Separate target IP and WSDL in PHP SoapClient









up vote
1
down vote

favorite












A video encoder I need to query from PHP for status and settings provides a SOAP interface.



The vendor provides a WSDL file which includes 15 schemas with schemaLocation naming external URLs. The XSD files are also provided by the vendor.



Since the system must operate without a public internet connection, I modified all of the imports to point to a local url, eg



http://localhost/path_to_schemas/xml.xsd
http://localhost/path_to_schemas/settings.xsd
http://localhost/path_to_schemas/inputs.xsd


and so forth



How do I use PHP SoapClient to query the encoder(s) using the local WSDL and schemas? Can't find any hints in the PHP documentation or elsewhere online. Most examples assume the WSDL file will be on the queried device, which in this case its not.



So I tried specifying the WSDL as localhost and put the target machine and namespace in the options:



$options = array("location" => "192.168.2.161", "uri" => "http://www.appeartv.com/automation/v1");

$sp = new SoapClient("http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/ATV.wsdl", $options);
$result = $sp->getModuleList();


However, this fails with an exception "Unable to parse URL" on the getModuleList() line.



Apache error_log:



[Sat Nov 10 06:55:05 2018] [error] [client 192.168.2.10] 
PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unable to parse URL
in /usr/local/webgui/be/testSoap.php:16
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', '192.168.2.161', 'getModuleList', 1, 0)
#1 /usr/local/webgui/be/testSoap.php(16): SoapClient->__call('getModuleList', Array)
#2 /usr/local/webgui/be/testSoap.php(16): SoapClient->getModuleList()
#3 main
thrown in /usr/local/webgui/be/testSoap.php on line 16


Which URL can it not parse?



The PHP docs say that:




location is the URL of the SOAP server to send the request to, and uri
is the target namespace of the SOAP service




I'm a bit confused on what uri should be set to. The "target namespace" in the xsd and wsdl files shows:



<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.appeartv.com/automation/v1/wsdl"
xmlns:atv="http://www.appeartv.com/automation/v1"
name="AppearTV_Automation"
targetNamespace="http://www.appeartv.com/automation/v1/wsdl">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://www.appeartv.com/automation/v1"
schemaLocation="http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/automationInterface.xsd" />
</schema>
</types>

<!-- system.xsd -->
<message name="getModuleList">
<part name="foo" element="atv:getModuleList"/>
</message>
and so on...


So is the target namespace atv (as used throughout the xsd files) or http://www.appeartv.com/automation/v1/wsdl (as shown in the wsdl file) or http://www.appeartv.com/automation/v1 (as shown in the xsd files) ??



I've tried all, but all show the same error message.










share|improve this question

























    up vote
    1
    down vote

    favorite












    A video encoder I need to query from PHP for status and settings provides a SOAP interface.



    The vendor provides a WSDL file which includes 15 schemas with schemaLocation naming external URLs. The XSD files are also provided by the vendor.



    Since the system must operate without a public internet connection, I modified all of the imports to point to a local url, eg



    http://localhost/path_to_schemas/xml.xsd
    http://localhost/path_to_schemas/settings.xsd
    http://localhost/path_to_schemas/inputs.xsd


    and so forth



    How do I use PHP SoapClient to query the encoder(s) using the local WSDL and schemas? Can't find any hints in the PHP documentation or elsewhere online. Most examples assume the WSDL file will be on the queried device, which in this case its not.



    So I tried specifying the WSDL as localhost and put the target machine and namespace in the options:



    $options = array("location" => "192.168.2.161", "uri" => "http://www.appeartv.com/automation/v1");

    $sp = new SoapClient("http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/ATV.wsdl", $options);
    $result = $sp->getModuleList();


    However, this fails with an exception "Unable to parse URL" on the getModuleList() line.



    Apache error_log:



    [Sat Nov 10 06:55:05 2018] [error] [client 192.168.2.10] 
    PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unable to parse URL
    in /usr/local/webgui/be/testSoap.php:16
    Stack trace:
    #0 [internal function]: SoapClient->__doRequest('<?xml version="...', '192.168.2.161', 'getModuleList', 1, 0)
    #1 /usr/local/webgui/be/testSoap.php(16): SoapClient->__call('getModuleList', Array)
    #2 /usr/local/webgui/be/testSoap.php(16): SoapClient->getModuleList()
    #3 main
    thrown in /usr/local/webgui/be/testSoap.php on line 16


    Which URL can it not parse?



    The PHP docs say that:




    location is the URL of the SOAP server to send the request to, and uri
    is the target namespace of the SOAP service




    I'm a bit confused on what uri should be set to. The "target namespace" in the xsd and wsdl files shows:



    <?xml version="1.0" encoding="UTF-8"?>
    <definitions
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.appeartv.com/automation/v1/wsdl"
    xmlns:atv="http://www.appeartv.com/automation/v1"
    name="AppearTV_Automation"
    targetNamespace="http://www.appeartv.com/automation/v1/wsdl">
    <types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://www.appeartv.com/automation/v1"
    schemaLocation="http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/automationInterface.xsd" />
    </schema>
    </types>

    <!-- system.xsd -->
    <message name="getModuleList">
    <part name="foo" element="atv:getModuleList"/>
    </message>
    and so on...


    So is the target namespace atv (as used throughout the xsd files) or http://www.appeartv.com/automation/v1/wsdl (as shown in the wsdl file) or http://www.appeartv.com/automation/v1 (as shown in the xsd files) ??



    I've tried all, but all show the same error message.










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      A video encoder I need to query from PHP for status and settings provides a SOAP interface.



      The vendor provides a WSDL file which includes 15 schemas with schemaLocation naming external URLs. The XSD files are also provided by the vendor.



      Since the system must operate without a public internet connection, I modified all of the imports to point to a local url, eg



      http://localhost/path_to_schemas/xml.xsd
      http://localhost/path_to_schemas/settings.xsd
      http://localhost/path_to_schemas/inputs.xsd


      and so forth



      How do I use PHP SoapClient to query the encoder(s) using the local WSDL and schemas? Can't find any hints in the PHP documentation or elsewhere online. Most examples assume the WSDL file will be on the queried device, which in this case its not.



      So I tried specifying the WSDL as localhost and put the target machine and namespace in the options:



      $options = array("location" => "192.168.2.161", "uri" => "http://www.appeartv.com/automation/v1");

      $sp = new SoapClient("http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/ATV.wsdl", $options);
      $result = $sp->getModuleList();


      However, this fails with an exception "Unable to parse URL" on the getModuleList() line.



      Apache error_log:



      [Sat Nov 10 06:55:05 2018] [error] [client 192.168.2.10] 
      PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unable to parse URL
      in /usr/local/webgui/be/testSoap.php:16
      Stack trace:
      #0 [internal function]: SoapClient->__doRequest('<?xml version="...', '192.168.2.161', 'getModuleList', 1, 0)
      #1 /usr/local/webgui/be/testSoap.php(16): SoapClient->__call('getModuleList', Array)
      #2 /usr/local/webgui/be/testSoap.php(16): SoapClient->getModuleList()
      #3 main
      thrown in /usr/local/webgui/be/testSoap.php on line 16


      Which URL can it not parse?



      The PHP docs say that:




      location is the URL of the SOAP server to send the request to, and uri
      is the target namespace of the SOAP service




      I'm a bit confused on what uri should be set to. The "target namespace" in the xsd and wsdl files shows:



      <?xml version="1.0" encoding="UTF-8"?>
      <definitions
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://www.appeartv.com/automation/v1/wsdl"
      xmlns:atv="http://www.appeartv.com/automation/v1"
      name="AppearTV_Automation"
      targetNamespace="http://www.appeartv.com/automation/v1/wsdl">
      <types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://www.appeartv.com/automation/v1"
      schemaLocation="http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/automationInterface.xsd" />
      </schema>
      </types>

      <!-- system.xsd -->
      <message name="getModuleList">
      <part name="foo" element="atv:getModuleList"/>
      </message>
      and so on...


      So is the target namespace atv (as used throughout the xsd files) or http://www.appeartv.com/automation/v1/wsdl (as shown in the wsdl file) or http://www.appeartv.com/automation/v1 (as shown in the xsd files) ??



      I've tried all, but all show the same error message.










      share|improve this question













      A video encoder I need to query from PHP for status and settings provides a SOAP interface.



      The vendor provides a WSDL file which includes 15 schemas with schemaLocation naming external URLs. The XSD files are also provided by the vendor.



      Since the system must operate without a public internet connection, I modified all of the imports to point to a local url, eg



      http://localhost/path_to_schemas/xml.xsd
      http://localhost/path_to_schemas/settings.xsd
      http://localhost/path_to_schemas/inputs.xsd


      and so forth



      How do I use PHP SoapClient to query the encoder(s) using the local WSDL and schemas? Can't find any hints in the PHP documentation or elsewhere online. Most examples assume the WSDL file will be on the queried device, which in this case its not.



      So I tried specifying the WSDL as localhost and put the target machine and namespace in the options:



      $options = array("location" => "192.168.2.161", "uri" => "http://www.appeartv.com/automation/v1");

      $sp = new SoapClient("http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/ATV.wsdl", $options);
      $result = $sp->getModuleList();


      However, this fails with an exception "Unable to parse URL" on the getModuleList() line.



      Apache error_log:



      [Sat Nov 10 06:55:05 2018] [error] [client 192.168.2.10] 
      PHP Fatal error: Uncaught SoapFault exception: [HTTP] Unable to parse URL
      in /usr/local/webgui/be/testSoap.php:16
      Stack trace:
      #0 [internal function]: SoapClient->__doRequest('<?xml version="...', '192.168.2.161', 'getModuleList', 1, 0)
      #1 /usr/local/webgui/be/testSoap.php(16): SoapClient->__call('getModuleList', Array)
      #2 /usr/local/webgui/be/testSoap.php(16): SoapClient->getModuleList()
      #3 main
      thrown in /usr/local/webgui/be/testSoap.php on line 16


      Which URL can it not parse?



      The PHP docs say that:




      location is the URL of the SOAP server to send the request to, and uri
      is the target namespace of the SOAP service




      I'm a bit confused on what uri should be set to. The "target namespace" in the xsd and wsdl files shows:



      <?xml version="1.0" encoding="UTF-8"?>
      <definitions
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://www.appeartv.com/automation/v1/wsdl"
      xmlns:atv="http://www.appeartv.com/automation/v1"
      name="AppearTV_Automation"
      targetNamespace="http://www.appeartv.com/automation/v1/wsdl">
      <types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://www.appeartv.com/automation/v1"
      schemaLocation="http://localhost/visor/options/optAppearControl/webgui/be/atvSoapSchema/automationInterface.xsd" />
      </schema>
      </types>

      <!-- system.xsd -->
      <message name="getModuleList">
      <part name="foo" element="atv:getModuleList"/>
      </message>
      and so on...


      So is the target namespace atv (as used throughout the xsd files) or http://www.appeartv.com/automation/v1/wsdl (as shown in the wsdl file) or http://www.appeartv.com/automation/v1 (as shown in the xsd files) ??



      I've tried all, but all show the same error message.







      php soap soap-client






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 at 15:20









      Danny

      94911419




      94911419



























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240357%2fseparate-target-ip-and-wsdl-in-php-soapclient%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240357%2fseparate-target-ip-and-wsdl-in-php-soapclient%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo