jeudi 27 juillet 2017

"SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension" but Works fine using SOAPUI

I tried to get data from SAP using SOAPUI and it works fine. SOAP UI.

but when I tried to code it using PHP, i got error. it stated "SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension". I searched around and there is 2 solution.

  1. I need to save the WSDL then change wsp:UsingPolicy wsdl:required="true" to false. but then i got error SOAP-ERROR: Parsing WSDL: Couldn't load from '<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="ZHCM_PERSONAL_WORK_SCHEDULE_OB_SI" targetNamespace="urn:company.com:PersonalWorkSchedule" xmlns:ns0="urn:sap-com:document:sap:rfc:functions" xmlns:p1="urn:company.com:PersonalWorkSchedule" xmlns:wsp="http://ift.tt/Hm2joK" xmlns:wsu="http://ift.tt/Hm2joJ" xmlns:wsdl="http://ift.tt/LcBaVt"><wsdl:documentation/><wsp:UsingPolicy wsdl:required="false"/><wsp:Policy wsu:Id="OP_ZHCM_PERSONAL_WORK_SCHEDULE_OB_SI"/><wsdl:types><xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://ift.tt/tphNwY" xmlns="urn:sap-com:document:sap:rfc:functions"><xsd:element name="ZHCM_PERSONAL_WORK_SCHEDULE"><xsd:complexType><xsd:all><xsd:element name="EXTAPPLICATION"><xsd:annotation><xsd:documentation>External Application</xsd:documentation></xsd:annotation><xsd:simpleType>
  2. change ws_policy in url to standar. but there is no such string like "ws_policy". here is the format example of url http://ift.tt/2uHmn25

I wonder if can get data just like SOAPUI did without changing SOAP server configuration.

here my simple code to make connection to SAP SOAP

$user     = 'user';
        $password = 'password';
//        $wsdl     = Storage::disk('log')->get('workschedule.xsl');
        $wsdl = 'http://ift.tt/2uHmn25';

        $SOAP_CONFIG = array(
            'login' => $user,
            'password' => $password,
            'authentication' => SOAP_AUTHENTICATION_BASIC,
            'soap_version' => SOAP_1_1,
            'connection_timeout' => 15,
            'encoding' => 'UTF-8'
        );

        $client = new SoapClient($wsdl, $SOAP_CONFIG);

        var_dump($client);



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2v2FPcc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire