php soap server prefix in elements

0

I am programming a soap server with php, the code:

$options = array('uri' => 'http://myserver/wsdl', 'soap_version' => SOAP_1_1 );
$server = new SoapServer("http://myserver/wsdl/wsas.wsdl", $options );
$server -> setClass("myclass"); 
$server->handle();

That works perfectly with a standard structure:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://myserver/wsdl.php">
   <soapenv:Header/>
   <soapenv:Body>
      <wsdl:element1>
         <subelement1>
            <subId1>?</subId1>
            <subName1>?</subName1>
         </subelement1>
         <subpart>
            <subIdp>?</subId1>
            <subNamePart>?</subName1>
         </subpart>
    ...

The structure definition file wsas.wsdl:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsas="http://myserver/wsdl.php" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="wsas" targetNamespace="http://myserver/wsdl.php">
  <wsdl:types>
    <xsd:schema targetNamespace="http://myserver/wsdl.php">
      <xsd:element name="element">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="subelement1" minOccurs="1" maxOccurs="1">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="subId1" type="xsd:int" minOccurs="1" maxOccurs="1"/>
                  <xsd:element name="subName1" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
            <xsd:element name="subpart" minOccurs="0" maxoccurs="unbounded">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="subIdp" type="xsd:int"/>
                  <xsd:element name="subNamePart" type="xsd:int"/>
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
...

But the structure sent by the client is different, also obligatorily  must be wsas: element (with the prefix wsas). I have tried putting aliases, changing names, definitions and I do not give with the solution.

How can I get "wsas: element"?

Thanks

    
asked by Wanhjo 07.06.2017 в 14:03
source

1 answer

1

Just post a repository that is what you need:

link

Check READ.md well, there is all the detailed information on how to use it.

    
answered by 09.06.2017 в 18:44