За последние 24 часа нас посетили 22356 программистов и 1173 робота. Сейчас ищут 712 программистов ...

SOAP не wdsl

Тема в разделе "PHP для профи", создана пользователем agvozdezkiy, 9 мар 2021.

  1. agvozdezkiy

    agvozdezkiy Новичок

    С нами с:
    9 мар 2021
    Сообщения:
    1
    Симпатии:
    0
    В режиме wdsl все работает. Но стоит задача дернуть SomeFunction() без wdsl. По ссылке http://masup.local:8080/ProxyService2?wsdl прилетает такая xml (Все адреса изменены!)

    Код (Text):
    1. <wsdl:definitions name="DAxService" targetNamespace="http://namespace.org/">
    2.     <wsdl:types>
    3.         <xsd:schema targetNamespace="http://namespace.org/Imports">
    4.             <xsd:import schemaLocation="http://masup.local:8080/ProxyService2?xsd=xsd0" namespace="http://namespace.org/"/>
    5.             <xsd:import schemaLocation="http://masup.local:8080/ProxyService2?xsd=xsd2" namespace="http://schemas.a1.org/ProxyServiceLibrary"/>
    6.             <xsd:import schemaLocation="http://masup.local:8080/ProxyService2?xsd=xsd1" namespace="http://schemas.a2.com/Serialization/"/>
    7.             <xsd:import schemaLocation="http://masup.local:8080/ProxyService2?xsd=xsd3" namespace="http://schemas.a2.com/Serialization/Arrays"/>
    8.             <xsd:import schemaLocation="http://masup.local:8080/ProxyService2?xsd=xsd4" namespace="http://schemas.a3.org/System.Collections.Generic"/>
    9.         </xsd:schema>
    10.     </wsdl:types>
    11.  
    12.     ........
    13.  
    14.     <wsdl:operation name="SomeFunction>
    15.         .........
    16.     </wsdl:operation>
    17.  
    18.     ........
    19.  
    20.     <wsdl:service name="DAxService">
    21.         <wsdl:port name="BasicHttpBinding_IDAxService" binding="tns:BasicHttpBinding_IDAxService">
    22.             <soap:address location="http://masup.local:8080/ProxyService2"/>
    23.         </wsdl:port>
    24.     </wsdl:service>
    25. </wsdl:definitions>
    На php получается такой код, где параметры подбираются из xml выше:
    PHP:
    1. $client = new SoapClient(null, ['location' => 'http://masup.local:8080/ProxyService2', 'uri' => 'http://namespace.org/']);
    2. $price =  $client->__soapCall('SomeFunction', ['param1' => 'string1', 'param2' => 'string2']);
    Прилетает исключение:
    The message with Action 'http://namespace.org/IDAxService#SomeFunction' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

    Как только не тусовал местами location, uri и soapaction. Не работает.

    Кто нибудь выдергивал параметры из xml для soapзапроса? Что куда вставить что бы заработало? Может чего не хватает? Что означает решетка в сообщении об ошибке перед SomeFunction?