-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not seem to add type to xml #118
Comments
This often comes from the fact that the native PHP SoapClient class (used as the soap client by default) does not handle correctly this sort of abstraction. This is why you might need to override the SoapClient class in order to generate your own XML request based on the parameters. This can seem hard to do but not really. In any case, you can override the used SoapClient following this example in the PackageEws365 package by looking to the SoapClient directory and the generate.sh file. |
Awesome. Thank you for your help. I will check out the example. |
The example did not really help me. The example simply shows how I can adjust the generated xml file later on. I think I would have to find out how the php SoapClient generates the request based on the parameters but I was not able to find any kind of resources for that. |
You have to use the SoapClient class as it used in the sample in order to alter the XML before it is actually sent. Look to https://github.com/WsdlToPhp/PackageEws365/blob/develop/SoapClient/SoapClient.php |
I get how to alter the XML. That is not sufficient for my case, though. I would need to change the XML generation in the first place |
If you agree to:
Maybe I can spend a little time on it in order to indicate how I would handle it. I have used many different kind of SOAP WS so maybe I would be able to help you better with these information. |
I sent you the wsdl via email. I need to call the function getQuote() The big issue that I have is with something like CT_Person and CT_JuristischePerson. Thank you so much for your extensive help |
I'm running into the same issue, with a different WSDL, did you guys ever figure out a solution to this? EDIT: Figured out a solution by overriding |
this notice is not directly address to this issue, sorry, but it helped me to find a solution for my problem of missing namespaces. just in case somone (like me) has similar problems and finds this issue here: in my case i am trying to communicate with the ebay finding api and it turns out, the whole request that is generated by the default php soapclient needs extra namespaces, so a simple helper function did the job, without any complicated replacements of the generator: private function addNamespaceToObjects($obj) {
foreach ((new \ReflectionObject($obj))->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
$property_name = $property->name;
if (is_object($obj->{$property->name})) {
$obj->$property_name = new \SoapVar(self::addNamespaceToObjects($obj->{$property->name}),SOAP_ENC_OBJECT, null, null, null, $this->soap_namespace);
} else {
if ($obj->{$property->name}) {
$obj->$property_name = new \SoapVar($obj->{$property->name}, XSD_STRING, null, null, null, $this->soap_namespace);
}
}
}
return $obj;
} @btfo thanks, the notice with |
In my request I need to create a tag like:
The generator created two different classes that seem to have to do something with this structure:
CT_Partner.php and CT_Person.php
However even if I use the CT_Person class the generated xml tag looks like this:
The same behavior also happens with other tags that require the type attribute.
The text was updated successfully, but these errors were encountered: