mrosenello Posted April 24, 2013 Share Posted April 24, 2013 I am new here, and not sure if this is the right place to put this, anyways I had a question about wsdl2php and php Soap Client. I need to send SOAP requests from a PHP applications and I am trying to use wsdl2php to generate the needed classes. (Did this a few times in the past with no issues.) Anyways, this time I am running into an issue where the WSDL has '.' in the element names and there are also nested element names. below is a section of the wsdl that shows this. -<xs:element name="option.list" minOccurs="0">-<xs:complexType>-<xs:complexContent>-<xs:extension base="cmn:ArrayType">-<xs:sequence>-<xs:element name="option.list" minOccurs="0" maxOccurs="unbounded">-<xs:complexType>-<xs:complexContent>-<xs:extension base="cmn:StructureType">-<xs:sequence><xs:element name="FromBundle" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemId" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemName" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemType" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptions" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptionValidations" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubOptionCosts" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemOptionInBundle" type="cmn:StringType" nillable="true" minOccurs="0"/><xs:element name="SubItemQuantityInBundle" type="cmn:DecimalType" nillable="true" minOccurs="0"/><xs:element name="SubItemOptionIdInBundle" type="cmn:StringType" nillable="true" minOccurs="0"/></xs:sequence></xs:extension></xs:complexContent></xs:complexType></xs:element></xs:sequence></xs:extension></xs:complexContent></xs:complexType></xs:element> So, wsdl2php is creating classes with a '.' in them and also declaring classes twice because of the nested element names. If anyone has any ideas on how I can get these soap requests working, or have seen this before, I would be very apprciative. Thanks, Mike Quote Link to comment https://forums.phpfreaks.com/topic/277273-wsdl2php-where-wsdl-has-elements-with-in-them/ Share on other sites More sharing options...
requinix Posted April 24, 2013 Share Posted April 24, 2013 The class names themselves don't matter so you can rename them to whatever you want (as long as you get all the references). Multiple classes? Delete the extras. Kinda sounds like wsdl2php isn't smart enough to do what you want it to do out of the box. But you're only generating these classes once, right? Generate them and tweak the results. Quote Link to comment https://forums.phpfreaks.com/topic/277273-wsdl2php-where-wsdl-has-elements-with-in-them/#findComment-1426426 Share on other sites More sharing options...
mrosenello Posted April 25, 2013 Author Share Posted April 25, 2013 (edited) Thanks for the response. Im going to give this a shot. What I meant by creating multiple classes with the same name is this: class option.list { public $option.list; // option.list } class option.list { public $SubItemId; // DecimalType public $SubOptions; // StringType public $SubItemName; // StringType } Edited April 25, 2013 by mrosenello Quote Link to comment https://forums.phpfreaks.com/topic/277273-wsdl2php-where-wsdl-has-elements-with-in-them/#findComment-1426635 Share on other sites More sharing options...
requinix Posted April 25, 2013 Share Posted April 25, 2013 I think the WSDL is saying that option.list is an array of elements (the second class), but it does it in a fairly roundabout way so maybe that's why wsdl2php thinks there's two element definitions. Otherwise it really is a set of elements contained within a parent , and you'll just need to create two classes for the two entities (but with different names of course). Quote Link to comment https://forums.phpfreaks.com/topic/277273-wsdl2php-where-wsdl-has-elements-with-in-them/#findComment-1426651 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.