php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48283 Invalid and wrong SOAP request using WSDL
Submitted: 2009-05-14 15:09 UTC Modified: 2009-05-22 08:16 UTC
From: vanya at myfastmail dot com Assigned:
Status: Not a bug Package: SOAP related
PHP Version: 5.2.9 OS: Kubuntu 9.04
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vanya at myfastmail dot com
New email:
PHP Version: OS:

 

 [2009-05-14 15:09 UTC] vanya at myfastmail dot com
Description:
------------
PHP SOAP extension produces invalid and incorrect SOAP request, see actual result. __soapCall was tried, direct ->functionName(attributes) approach tried as well.

Reproduce code:
---------------
http://pastebin.com/d4a1551db

Expected result:
----------------
No Exception thrown, SOAP request should be something like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.tsystems.com/zfinder/1.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getLebenslageTree>
         <lebenslageKey>
            <id>93256</id>
            <mandantenId>0</mandantenId>
         </lebenslageKey>
         <kategorieIds>783160</kategorieIds>
         <kategorieIds>783161</kategorieIds>     
         <mandantenIds>0</mandantenIds>
         <profilData>
            <ags>0</ags>
            <plz>0</plz>
            <sprache>deu</sprache>
         </profilData>
      </ns:getLebenslageTree>
   </soapenv:Body>
</soapenv:Envelope>

Actual result:
--------------
Exception from server because of wrong request, SOAP request is the following:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:ns1="http://www.tsystems.com/zfinder/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<SOAP-ENV:Body>
		<ns1:getLebenslageTree xsi:type="ns1:PrimaryKeyWs">
			<id>93256</id>
			<mandantenId>0</mandantenId>
		</ns1:getLebenslageTree>
		<param1>
			<xsd:int>783160</xsd:int>
			<xsd:int>783161</xsd:int>
		</param1>
		<param2>
			<xsd:int>0</xsd:int>
		</param2>
		<param3>false</param3>
		<param4 xsi:type="ns1:ProfilDataWs">
			<ags>0</ags>
			<plz>0</plz>
			<sprache>deu</sprache>
			<regionIds xsi:nil="true" />
			<mandantenIds xsi:nil="true" />
			<kategorien xsi:nil="true" />
			<kategorienUndVerknuepfung />
		</param4>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Which is TOTALLY wrong... :(

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-14 15:48 UTC] vanya at myfastmail dot com
Ok, sorry guys, this was my fault. Service should be called like this:

    $param = new stdClass();
    $param->lebenslageKey = $pkey; 
    $param->kategorieIds = $kategorieIds; 
    $param->mandantenIds = $mandantenIds; 
    $param->operatorAnd = false; 
    $param->profilData = $profilData;
    $treeInfo = $lebenslage->__soapCall('getLebenslageTree', array($param));

and not the way I used it. But still output is strange. You can just close this bug..
 [2009-05-22 08:16 UTC] vanya at myfastmail dot com
Bogus report, sorry.
 [2013-02-24 20:02 UTC] reto at casserini dot com
Another workaround. 

Instead of

    <message name="getCourses">
        <part name="parameters" type="xsd:int"/>
    </message>
    <message name="getUsers">
        <part name="parameters" type="xsd:int"/>
    </message>

which always leads to a call of the first operation "getCourses", I define two new types:

    <xsd:element name="getCoursesInput" type="xsd:int"/>
    <xsd:element name="getUsersInput" type="xsd:int"/>

and use them for the messages:

    <message name="getCourses">
        <part name="parameters" element="tns:getCoursesInput"/>
    </message>
    <message name="getUsers">
        <part name="parameters" element="tns:getUsersInput"/>
    </message>

works fine for me.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 26 19:01:34 2024 UTC