Difference between two soap requests

后端 未结 3 1221
小蘑菇
小蘑菇 2021-01-15 19:16

My SOAP Request




        
相关标签:
3条回答
  • 2021-01-15 19:42
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://ws.dgpys.deloitte.com" xmlns:ns2="ws.apache.org/namespaces/axis2">
        <env:Header>
            <ns2:ServiceGroupId>
                urn:uuid:7C2F61BDE7CB9D9C6D1424938568724
            </ns2:ServiceGroupId>
        </env:Header>
        <env:Body>
            <ns1:getGunlukParametreRapor>
                <date>2015-02-22T00:00Z</date>
            </ns1:getGunlukParametreRapor>
        </env:Body>
    </env:Envelope>
    

    And

    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://ws.dgpys.deloitte.com">
       <soap:Header>
           <axis2:ServiceGroupId xmlns:axis2="http://ws.apache.org/namespaces/axis2">urn:uuid:479731898147E116AD1424691518968</axis2:ServiceGroupId>
       </soap:Header>
       <soap:Body>
          <ws:getGunlukParametreRapor>
             <date>2015-02-22T00:00Z</date>
          </ws:getGunlukParametreRapor>
       </soap:Body>
    </soap:Envelope>
    

    Are the same. env=soap, ns2=ws and ns2=axis2. You can have any prefix to refer to these namespaces as you like. Once you assign the prefix you just refer to it using that in the other places. Only diff was the bogus tag tin first request. Just remove that.

    0 讨论(0)
  • 2021-01-15 20:03

    They are not the same. To get rid of the BOGUS node you need to use this:

    $strHeaderComponent_Session = "<SessionHeader><ServiceGroupId>$theVarWithTheIDGoesHere</ServiceGroupId></SessionHeader>";
    $objVar_Session_Inside = new SoapVar($strHeaderComponent_Session, XSD_ANYXML,
                                         null, null, null);
    $objHeader_Session_Outside = new SoapHeader('http//ws.apache.org/namespaces/axis2', 
                                               'SessionHeader', $objVar_Session_Inside);
    
    // More than one header can be provided in this array.
    $client->__setSoapHeaders(array($objHeader_Session_Outside));
    
    0 讨论(0)
  • 2021-01-15 20:05

    try the following

    $ns = 'http//ws.apache.org/namespaces/axis2'; //Namespace of the WS.
    //Body of the Soap Header.
    $headerbody = array('ServiceGroupId' => $UNIQUEID_Token);
    //Create Soap Header.       
    $header = new SOAPHeader($ns, 'axis2', $headerbody);             
    //set the Headers of Soap Client.
    $soap_client->__setSoapHeaders($header); 
    
    0 讨论(0)
提交回复
热议问题