Closed myname1614 closed 3 years ago
Actually, the first XML you're showing is the SoapUI request, am I wrong? Which is the SoapUI-generated XML request to send, not the actual definition of requestGetNumOfOrderLines
.
The getNumOfOrderLines
is defined such as:
<xs:complexType name="getNumOfOrderLines">
<xs:sequence>
<xs:element name="arg0" type="tns:requestGetNumOfOrderLines" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="requestGetNumOfOrderLines">
<xs:complexContent>
<xs:extension base="tns:requestBase">
<xs:sequence>
<xs:element name="OrderNo" type="xs:string" minOccurs="0"/>
<xs:element name="ReasonCodeFilter" type="xs:string" minOccurs="0"/>
<xs:element name="StatusShippedFilter" type="xs:boolean"/>
<xs:element name="StatusUnshippedFilter" type="xs:boolean"/>
<xs:element name="ItemFilter" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
And requestBase
is defined as below:
<xs:complexType name="requestBase">
<xs:sequence>
<xs:element name="CompanyName" type="xs:string" minOccurs="0"/>
<xs:element name="Login" type="xs:string" minOccurs="0"/>
<xs:element name="Password" type="xs:string" minOccurs="0"/>
<xs:element name="RequestId" type="xs:string" minOccurs="0"/>
<xs:element name="applicationId" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
So, with PHP you should be able to do as below:
$request = new RequestGetNumOfOrderLines();
$request
->setOrderNo()
->setReasonCodeFilter()
->setStatusShippedFilter()
->setStatusUnshippedFilter()
->setItemFilter()
// RequestGetNumOfOrderLines extends the RequestBase class,
// these setters are within the generated RequestBase class
->setCompanyName()
->setLogin()
->setPassword()
->setRequestId()
->setapplicationId();
As the RequestGetNumOfOrderLines
extends the Requestbase
class which is defined with its own properties along with their fluent setters.
yes it will work. I can even wrap this all in my extend class. but we created a kit of helpers :-) I wanted to avoid manually calling hundreds of setters Maybe you need to provide for some additional functionality? Something similar to this:
class RequestGetNumOfOrderLines
{
//auto generated if has parent
public function initBase(RequestBase $obj)
{
//to iterate obj props & batch assigns
}
}
thanks. sorry for my googletranslate english )
You have indeed the static __set_state(array $properties)
method which takes care of calling the setter for each property.
Is this what you're looking for?
looks good. I will try it. Thanks.
wsdl: https://econnector.elit.cz/InterCompany-1.75.0/BuyerService?wsdl
method getNumOfOrderLines has definitions:
but generator created classes:
my question. how can I create a request correctly with all params?
i tried to do like this:
but I did not understand how to add a login, password here.
thanks!
P.S. in a similar case, no problem. we have constructor params: