Jump to content

Recommended Posts

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

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.

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 by mrosenello

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).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.