Problem with generated soap requests using the WSDLDriverFac

When using the SOAP::WSDLDriverFactory to talk to webservices the form tag of some elements is not honored. If you look at the wsdl below you will see that the schemas 'elementFormDefault="qualified"' but the complexType sequence elements have a 'form="unqualified"' tag. The generated soap request is not correct. It adds the namespace for the sequence elements of the complexType anyway. This also happens with the classes generated using the WSDL2Ruby class to generate classdef's. I was able to get around it by generating a driver with WSDL2Ruby and setting the flag on the in parameters to false and then modifying the classdef generated file for the complexType to have nil namespaces in the @@schema_element. Also it seems wrong for the response that I do not have to set the flag on the out parameters of the generated driver class to false or change the @@schema_element in the classdef generated file and it still properly handlers the response xml that does not have the namespace on its complex type sequence elements.


GENERATED REQUEST:
<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:TestTransaction xmlns:n1="http://TEST/TestTransaction">
      <n1:Request>
        <n1:FirstName>testfirst</n1:FirstName>
        <n1:LastName>testlast</n1:LastName>
        <n1:Street>teststreet</n1:Street>
        <n1:City>testcity</n1:City>
        <n1:State>teststate</n1:State>
        <n1:Zip>testzip</n1:Zip>
      </n1:Request>
    </n1:TestTransaction>
  </env:Body>
</env:Envelope>

PROPER REQUEST (What it should look like):
<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Body>
    <n1:TestTransaction xmlns:n1="http://TEST/TestTransaction">
      <n1:Request>
        <FirstName>testfirst</FirstName>
        <LastName>testlast</LastName>
        <Street>teststreet</Street>
        <City>testcity</City>
        <State>teststate</State>
        <Zip>testzip</Zip>
      </n1:Request>
    </n1:TestTransaction>
  </env:Body>
</env:Envelope>


WSDL:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://TEST/TestTransaction" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://TEST/TestTransaction" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://TEST/TestTransaction">
      <s:element name="TestTransaction">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="Request" type="tns:TransactionRequest" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="TransactionRequest">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="FirstName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="LastName" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Street" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="City" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="State" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Zip" type="s:string" />
        </s:sequence>
      </s:complexType>
      <s:element name="TestTransactionResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="Response" type="tns:TransactionResponse" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="TransactionResponse">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="TransactionStatus" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="TransactionID" type="s:string" />
          <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="Message" type="s:string" />
        </s:sequence>
      </s:complexType>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="TestTransactionSoapIn">
    <wsdl:part name="parameters" element="tns:TestTransaction" />
  </wsdl:message>
  <wsdl:message name="TestTransactionSoapOut">
    <wsdl:part name="parameters" element="tns:TestTransactionResponse" />
  </wsdl:message>
  <wsdl:portType name="PerformTestTransactionSoap">
    <wsdl:operation name="TestTransaction">
      <wsdl:input message="tns:TestTransactionSoapIn" />
      <wsdl:output message="tns:TestTransactionSoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="PerformTestTransactionSoap" type="tns:PerformTestTransactionSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    <wsdl:operation name="TestTransaction">
      <soap:operation soapAction="http://TEST/TestTransaction/TestTransaction" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="PerformTestTransaction">
    <wsdl:port name="PerformTestTransactionSoap" binding="tns:PerformTestTransactionSoap">
      <soap:address location="http://localhost:3000/testwebservice/action" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

NAKAMURA, Hiroshi wrote:

You are right. I filed this as a ticket:
http://dev.ctor.org/soap4r/ticket/260 . I’ll look into this.

Thank you :slight_smile: , I had filed a bug on rubyforge (
http://rubyforge.org/tracker/index.php?func=detail&aid=5763&group_id=426&atid=1698
) that includes a test app with a test wsdl to recreate the problem. I
thought that was the right place to report it because I was using the
wsdl classes included in the ruby standard library. I will update that
bug report with a link to the ticket you have created.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

David S. wrote:

the @@schema_element. Also it seems wrong for the response that I do not
have to set the flag on the out parameters of the generated driver class
to false or change the @@schema_element in the classdef generated file
and it still properly handlers the response xml that does not have the
namespace on its complex type sequence elements.

You are right. I filed this as a ticket:
http://dev.ctor.org/soap4r/ticket/260 . I’ll look into this.

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRRFK1R9L2jg5EEGlAQKlYQgAlHKbsQOVymA0DLZb2QBwLbvaenM8YuyC
PqT+8S+rSpxtEA6P1GUJOiGGwdtyzGZ06i5CXsygFZhXLeuQgWFfm0OG7PNl2b8K
1WBTATJrSs2FlKOGygyyFJGiJPLJoqgr6qg/7KVv0BCgB4yJnNWm+C2ZoKmrQPlE
vgkIDsZUWm9Q3CZPqpe7AFfS2HuabvyAWgblhe7ecuOZdSWbvp9mMKnk/TWPiM3p
poRUpdIY1b3w+ykkpPsslfsFMOCbmms/RqwNuWmmThhmDPzHbPGVNOqIdbrxIPE1
hF94BzzmrQZ00/pJCPBrvV/3AvcdOWrNDLJK+FsESVkk/D07+pZt6A==
=Z53/
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

David S. wrote:

Thank you :slight_smile: , I had filed a bug on rubyforge (
http://rubyforge.org/tracker/index.php?func=detail&aid=5763&group_id=426&atid=1698
) that includes a test app with a test wsdl to recreate the problem. I
thought that was the right place to report it because I was using the
wsdl classes included in the ruby standard library. I will update that
bug report with a link to the ticket you have created.

Thank you. I fixed the problem in the changeset 1724
(http://dev.ctor.org/soap4r/changeset/1724) and confirmed that main.rb
in WSDLTest.zip generated the following request.

<?xml version="1.0" encoding="utf-8" ?>

<env:Envelope xmlns:xsd=“http://www.w3.org/2001/XMLSchema
xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>
env:Body
<n1:TestTransaction xmlns:n1=“http://TEST/TestTransaction”>
n1:Request
testfirst
testlast
teststreet
testcity
teststate
testzip
</n1:Request>
</n1:TestTransaction>
</env:Body>
</env:Envelope>

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRRaWTB9L2jg5EEGlAQKN5wgAkAdmaENG8nRoSMNVSMnfaA4ksEXId4P7
imvc2dmFgl3X6Q3P65hRv+beF5xNrwQNozvU4hT3Nqi54eCBN1+XFQ/ri5RmYK6p
qAhOVa+GN1GXMpnF3swpx5YLeOFhkG3KSoRXjrfvEHqWgH/e2HWvi4JIaFV9kauj
4HonAQo+I9HD0dMRkMK1i+N4+lS3VYO3eksUzE3v69BGkAHobUwGQkULdAahz0Rm
Gqgy+ZkskdmU0L+uCeohJYuVHFNz/cBf9mDr57yUFQalFNGpftaOmNoRFGDRd/zW
d8GhZ5aM6tJBZ2olsHC0toxu/2C2HGcgyfgnWlJbccvTpi08nqkcxQ==
=fO4f
-----END PGP SIGNATURE-----

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs