« Return to Thread: Get values from wsdl:types

Re: Get values from wsdl:types

by noddle :: Rate this Message:

| View in Thread

Hi,

OK, it's been over a year but if I remember right I had to define all the simple XML data types before defining the complex data types.

First thing I would do is to take this WSDL

http://www.webservicex.net/genericbarcode.asmx?WSDL

and validate it using Eclipse's WSDL or some other similar validation tool.

Also, I'm telling you. Doing SOAP in PHP is tough.

These weren't ready when I was trying to do my work but may make your job easier now:


http://wso2.com/products/web-services-framework/php/

or

http://www.osoa.org/display/PHP/SOA+PHP+Homepage


I think the first may be easier but give them a look over yourself.

Ciao,
Andy



Ok i'm really wearing but use this plugin.

I have installed php 5.3.5 version with php_soap enabled.

in this example:

http://www.webservicex.net/genericbarcode.asmx?WSDL

i run this php script:

$client = new SoapClient("http://www.webservicex.net/genericbarcode.asmx?WSDL");
var_dump($client->__getTypes());


and i have the following result:

array
  0 => string 'struct GenerateBarCode {
 BarCodeData BarCodeParam;
 string BarCodeText;
}' (length=74)
  1 => string 'struct BarCodeData {
 int Height;
 int Width;
 int Angle;
 int Ratio;
 int Module;
 int Left;
 int Top;
 boolean CheckSum;
 string FontName;
 string BarColor;
 string BGColor;
 float FontSize;
 BarcodeOption barcodeOption;
 BarcodeType barcodeType;
 CheckSumMethod checkSumMethod;
 ShowTextPosition showTextPosition;
 ImageFormats BarCodeImageFormat;
}' (length=352)
  2 => string 'string BarcodeOption' (length=20)
  3 => string 'string BarcodeType' (length=18)
  4 => string 'string CheckSumMethod' (length=21)
  5 => string 'string ShowTextPosition' (length=23)
  6 => string 'string ImageFormats' (length=19)
  7 => string 'struct GenerateBarCodeResponse {
 base64Binary GenerateBarCodeResult;
}' (length=71)

2, 3, 4, 5, 6 is enumeration types, but the values is ignored.
I don't know what to do...

If i did something wrong to the above code please tell me otherwise thanks you very much for your time!!

George


Hi,

It's build in, just enable it in the php.conf file.

If the PHP 5 you have wasn't compiled with SOAP support upgrade to a version that has this support.

Here is the manual page:

http://php.net/manual/en/book.soap.php

Ciao,
Andy


Hi,

Sorry I'm wearing, one last question,
I can not find this "Soap plugin for PHP5" on google.

Can you provide me a link?
I'll be obliged..

Thanks a lot
George

Hi,

That is handled with the Soap plugin for PHP5. The SimpleTypes and Complex types are handled when defined correctly.

Ciao,
Andy

boulouk wrote:
Hi Andy

First of all, thanks for your answer.
I'm trying to parse wsdl files based on soap. I use the php extension but i face the problem that ignores the enumeration types. There is a php bug about this: https://bugs.php.net/bug.php?id=47934

Do you know how to face this problem?
What is this plugin SOAP plugin made for PHP5?

Thanks again,

George
noddle wrote:
Hi George,

Well I did 3 main things which got me going regarding SOAP, XML, & PHP:

1. I used the SOAP plugin made for PHP5 and forgot about doing SOAP in PHP4

2. I did the XML / SOAP validation by designing a top level WSDL using the XML templates from Amazon Seller Central using Eclipse.

3. I bought this book and worked through the examples: SOA and WS-BPEL (Yuli Vasiliev - Packt Publishing)

One you get the WSDL designed correctly and the XML correct (or corrected as the Amazon Seller Central XML had errors in it) then the SOAP plugin hangles the type validation & other things).

Ciao,
Andy

boulouk wrote:
Hello Andrew,

Im' trying to do the same thing and i have problem.
I follow your link, but i couldn't find a solution?

Can you tell me where exactly is the solution to this links?

Thanks,

George.
noddle wrote:
Hello Marco,

I was looking to do the same thing. The best tool I have been able to find so far is at:

http://trac.substring.no/url/pst/browser/ (PST!)

I don't know yet how robust it is though.

Ciao,
Andrew

Marco-172 wrote:
I need to read the values from <wsdl:types>, but I don't find how to
do this using SOAPClient.

I have an WSDL with this types:

<wsdl:types>
    <xsd:schema targetNamespace="http://soap.domain.com/v2"
xmlns="http://www.w3.org/2001/XMLSchema">
        <simpleType name="Language">
            <restriction base="string">
                <enumeration value="EN"/>
                <enumeration value="DE"/>
                <enumeration value="ES"/>
                <enumeration value="FR"/>
                <enumeration value="GR"/>
                <enumeration value="IT"/>
                <enumeration value="PL"/>
                <enumeration value="RU"/>
            </restriction>
        </simpleType>

        <complexType name="Access">
            <sequence>
                <element name="account" type="tns:Account"/>
                <element name="subAccount" type="tns:Account" minOccurs="0"/>
                <element name="reference" type="string" minOccurs="0"/>
            </sequence>
            <attribute name="language" type="tns:Language" use="optional"/>
        </complexType>
    </xsd:schema>
</wsdl:types>

Using the "__getTypes()" function only returns something like this:

array
    0 => string 'string Language' (length=15)
    1 => string 'struct Access {
        Account account; Account subAccount;
        string reference;
        boolean testMode;
        Language language;
    }' (length=114)

Is it possible to read the "enumeration" values from the "Language"
type or must this be done using an XML Parser!?

Regards,
Marco

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 « Return to Thread: Get values from wsdl:types