-
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
WSDL not reacting how others do #231
Comments
The What is bothering you? The fact that the Le me know if you can share the WSDL here or at [email protected]. |
The issue is that when doing something like this:
I'd expect the soap packet to contain something like:
But instead it shows up like this:
So, not essentially two problems.
Hopefully that makes sense. Thanks, Kevin |
I'd bet it's the SoapClient class based on the WSDL that does not handle correctly the PHP data transformation to the SOAP XML Request. The simpliest way to validate my hypothesis is to use the native SoapClient class, without using any of the generated classes and passing a basic array to the method with the required data and see how it goes. Le me know then, good luck |
If it is that, is there any recourse or are you saying I'm stuck? Or is there just a different soapClient class that is needed? And what is the easiest way to swap out the soapClient. Would it be this:
? |
The native PHP SoapClient is funtionning well in most of the cases, most does not mean all... You can look to the NuSOAP client or the PHPro SoapClient (never used it). This would mean you have to use the soapclient option when generating the package in order to use your own implementation of SoapClient base class which would allow you to use another SoapClient class instead of the native PHP SoapClient, the way it is used within the PackageEws365 package |
When running the basic php soapClient processes lots of stuff is incorrect including the array I passed in, while the data shows up it lists the property as param1 instead of the correctly named property name. So, with that said, I assume that is to mean I'll need to use a custom soap client? Is there a good way to know what all I'll need to customize and how to know what is not allowing the data to come through correctly? |
I can't tell unless having the WSDL in hand. I work as a freelance if you need further help ;) |
Unfortunately, this is a vendor relationship and due to an NDA I'm not able to share the WSDL. However, I discovered something. (And I didn't have to switch to using a custom soapClient) If I fill in all the fields with the appropriate objects at creation of the initial object, instead of defining all the properties later, everything fills into the soap packet just fine.
However, I thought the WSDL Package Generator didn't require those all to be set if the --validation=false ? Maybe I've misunderstood how that works? I like to code like the below, because I find it easier to read.
Creating the initial object and below it setting all the parameters after the fact. And then when needing to set a property that is an object defining it as a variable and setting it up above. But apparently, you have to fill in initial parameters when you first instantiate?? I also noticed that it seemed to only care about certain properties being filled in during this process, and as long as they were setup correctly initially, then you could add other properties that come after them later on just fine. So, essentially, the below worked fine too because I defined the version 1 and version 2 properties with their objects directly when instantiating vendorHeader_CType:
Any ideas what causes this? Thanks, Kevin |
$object
->setConsumerProduct($product)
->setConsumerName($consumerName)
That's for the clarification of the generated code, I should create a kind of manifest about the generated code... Concerning your issue, is the |
Well, if it needs to be an instance of a \THIS_WSDL\StructType\ConsumerName_Type, then I would still do that mapping it to the $consumerName variable. However, it's interesting. In the generated WSDL to PHP output, it is: It is an instance of this: "\THIS_WSDL\StructType\ConsumerName_Type" but with only with a parameter of "$_" which is a string. However, as long as the "Version1_Type" instance was set initially, I can either pass it the instance or set it as a string manually like below and it seems to still work normally:
So, if I understand, essentially this is working as you'd expect it to and something in the actual WSDL is required to be set initially? When I generate the packages using the --validation=false flag, that isn't actually accomplishing anything? |
Can you paste the
Can't say wihout the WSDL
It's not generating the validation rules within the setters, that's all. |
Hi Mikael, I've sent you a sanitized and stripped down version, of the class file via email to: [email protected] Hopefully that helps. Kevin |
It's defined as I was expecting it :), so I'm not sure to understand your issue. What I understood it that you set the Let me know if there is still something not working taking into account what I just detailed. |
Okay, well it seems to be working okay. So, I'll go from here. Thanks for all the above explanations! |
Always a pleasure to make my work more comprehensible and to ensure it's not unpredictable 😅. I'm working on a manifest that'll contain a resume of what is generated and how the classes/files are intended to be used. I hope it'll be helpful. Feel free to comment it when it'll be pushed ;) |
Sounds great. Thanks! |
Hello,
I've used the generator on a WSDL that has a number of other .xsd and dtd files associated with it. And one where I had to manually download the WSDL and convert it. But otherwise i'm running the process as normal and that worked fine and I imported it into my project.
However, going to use it there is an inner object that contains almost every property like this. However, it appears that the only property in these sub objects is showing as this:
I don't seem to have a way to set these variables or I'm not understanding what is expected. Any ideas what is going on?
As a side note, when I opened this WSDL in SOAPUI, each one seems to be more of a string and I can just type it in to the proper tag.
oh, also, when running the call, this section is all blank not even bring in these properties into the soap packet.
??
The text was updated successfully, but these errors were encountered: