You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Eugene Shershnev <sh...@gmail.com> on 2005/02/09 17:32:05 UTC

Returning arrays to .Net (again)

Hi All,

I've searched through the list trying to find why .Net client does not see the array of beans returned by Axis-based wrapped service.
I've tried everything I found except changing the code as was suggested by Eric Chijioke at http://marc.theaimsgroup.com/?l=axis-user&m=109606665519335&w=2

The response that I have now looks fine to me, but .Net still gets an empty array back.

Any tips will be greatly appreciated.

The WSDL is attached (didn't want to make the message body huge) but the response is here:

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <listResponse xmlns="http://enterprise.ent">
      <item xsi:type="ns1:EntDocument" xmlns:ns1="http://enterprise.ent">
        <URI xsi:type="xsd:string">ent://000000000080ea83202a2bf6b9724d04</URI>
        <created xsi:type="xsd:dateTime">2005-02-02T21:42:31.765Z</created>
        <name xsi:type="xsd:string">TEST</name>
        <size xsi:type="xsd:long">0</size>
      </item>
      <item xsi:type="ns2:EntDocument" xmlns:ns2="http://enterprise.ent">
        <URI xsi:type="xsd:string">ent://000000000080f9502c042b57dd68d7eb</URI>
        <created xsi:type="xsd:dateTime">2005-02-08T15:39:49.640Z</created>
        <name xsi:type="xsd:string">FirstNewDocument</name>
        <size xsi:type="xsd:long">0</size>
      </item>
    </listResponse>
  </soapenv:Body>
</soapenv:Envelope>

The WSDL was originally auto-generated by Axis, but was later slightly modified.

Also, here is my deploy.wsdd file:

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

  <service name="ent" provider="java:RPC" style="wrapped" use="literal">
    <wsdlFile>ent-wrapped.wsdl</wsdlFile>

    <parameter name="className" value="ent.enterprise.EntAPI" />
    <parameter name="allowedMethods" value="load write clear list delete read create login logout"/>

    <operation name="list"
        qname="ns:list"
        returnQName="ns:item"
        returnType="ns:ArrayOf_EntDocument"
        xmlns:ns="http://enterprise.ent">
      <parameter name="sid" qname="ns:sid" type="xsd:string" mode="IN" />
    </operation>

    <beanMapping
      xmlns:ns="http://enterprise.ent"
      qname="ns:EntDocument"
      languageSpecificType="java:ent.enterprise.EntDocument"/>
  </service>

</deployment>


Thanks for any help,
Eugene

Re: Returning arrays to .Net (again)

Posted by Praveen Peddi <pp...@contextmedia.com>.
I think this will solve lot of people's problems (Well atleast mine, as I am still struggling with the issue :)).

Praveen
  ----- Original Message ----- 
  From: Bill Keese 
  To: axis-user@ws.apache.org 
  Sent: Sunday, February 13, 2005 7:54 PM
  Subject: Re: Returning arrays to .Net (again)


  Yes I agree.    Actually, releasing Axis 1.2 without document/literal array support seems somewhat meaningless.  Dims - can this be fixed for the 1.2 release?

  Anyway, the bug is http://issues.apache.org/jira/browse/AXIS-1547 and you can patch the code according to these instructions:

    http://marc.theaimsgroup.com/?l=axis-user&m=109587880222477&w=2 
    http://marc.theaimsgroup.com/?l=axis-user&m=109631383200039&w=2 
    http://marc.theaimsgroup.com/?l=axis-user&m=109646648222389&w=2

  Bill

  Praveen Peddi wrote: 
    If Eric's patch fixes so many array related issues, why can't this be rolled into CVS? I am sure there must be some reason why it was not done till now but looks like this is an important patch to support array of custom beans support.

    Praveen
      ----- Original Message ----- 
      From: Bill Keese 
      To: axis-user@ws.apache.org 
      Sent: Wednesday, February 09, 2005 8:19 PM
      Subject: Re: Returning arrays to .Net (again)


      It doesn't work because your WSDL specifies an element called <listReturn> but your response doesn't contain such an element.

      I think you need Eric Chijoke's code modification (hereafter referred to as "Eric Chijoke's famous Axis array patch" :-)

      Bill

      Eugene Shershnev wrote: 
        Hi All,

        I've searched through the list trying to find why .Net client does not see the array of beans returned by Axis-based wrapped service.
        I've tried everything I found except changing the code as was suggested by Eric Chijioke at http://marc.theaimsgroup.com/?l=axis-user&m=109606665519335&w=2

        The response that I have now looks fine to me, but .Net still gets an empty array back.

        Any tips will be greatly appreciated.

        The WSDL is attached (didn't want to make the message body huge) but the response is here:

        <soapenv:Envelope
            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <soapenv:Body>
            <listResponse xmlns="http://enterprise.ent">
              <item xsi:type="ns1:EntDocument" xmlns:ns1="http://enterprise.ent">
                <URI xsi:type="xsd:string">ent://000000000080ea83202a2bf6b9724d04</URI>
                <created xsi:type="xsd:dateTime">2005-02-02T21:42:31.765Z</created>
                <name xsi:type="xsd:string">TEST</name>
                <size xsi:type="xsd:long">0</size>
              </item>
              <item xsi:type="ns2:EntDocument" xmlns:ns2="http://enterprise.ent">
                <URI xsi:type="xsd:string">ent://000000000080f9502c042b57dd68d7eb</URI>
                <created xsi:type="xsd:dateTime">2005-02-08T15:39:49.640Z</created>
                <name xsi:type="xsd:string">FirstNewDocument</name>
                <size xsi:type="xsd:long">0</size>
              </item>
            </listResponse>
          </soapenv:Body>
        </soapenv:Envelope>

        The WSDL was originally auto-generated by Axis, but was later slightly modified.

        Also, here is my deploy.wsdd file:

        <deployment xmlns="http://xml.apache.org/axis/wsdd/"
                    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

          <service name="ent" provider="java:RPC" style="wrapped" use="literal">
            <wsdlFile>ent-wrapped.wsdl</wsdlFile>

            <parameter name="className" value="ent.enterprise.EntAPI" />
            <parameter name="allowedMethods" value="load write clear list delete read create login logout"/>

            <operation name="list"
                qname="ns:list"
                returnQName="ns:item"
                returnType="ns:ArrayOf_EntDocument"
                xmlns:ns="http://enterprise.ent">
              <parameter name="sid" qname="ns:sid" type="xsd:string" mode="IN" />
            </operation>

            <beanMapping
              xmlns:ns="http://enterprise.ent"
              qname="ns:EntDocument"
              languageSpecificType="java:ent.enterprise.EntDocument"/>
          </service>

        </deployment>


        Thanks for any help,
        Eugene

Re: Returning arrays to .Net (again)

Posted by Praveen Peddi <pp...@contextmedia.com>.
If Eric's patch fixes so many array related issues, why can't this be rolled into CVS? I am sure there must be some reason why it was not done till now but looks like this is an important patch to support array of custom beans support.

Praveen
  ----- Original Message ----- 
  From: Bill Keese 
  To: axis-user@ws.apache.org 
  Sent: Wednesday, February 09, 2005 8:19 PM
  Subject: Re: Returning arrays to .Net (again)


  It doesn't work because your WSDL specifies an element called <listReturn> but your response doesn't contain such an element.

  I think you need Eric Chijoke's code modification (hereafter referred to as "Eric Chijoke's famous Axis array patch" :-)

  Bill

  Eugene Shershnev wrote: 
    Hi All,

    I've searched through the list trying to find why .Net client does not see the array of beans returned by Axis-based wrapped service.
    I've tried everything I found except changing the code as was suggested by Eric Chijioke at http://marc.theaimsgroup.com/?l=axis-user&m=109606665519335&w=2

    The response that I have now looks fine to me, but .Net still gets an empty array back.

    Any tips will be greatly appreciated.

    The WSDL is attached (didn't want to make the message body huge) but the response is here:

    <soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body>
        <listResponse xmlns="http://enterprise.ent">
          <item xsi:type="ns1:EntDocument" xmlns:ns1="http://enterprise.ent">
            <URI xsi:type="xsd:string">ent://000000000080ea83202a2bf6b9724d04</URI>
            <created xsi:type="xsd:dateTime">2005-02-02T21:42:31.765Z</created>
            <name xsi:type="xsd:string">TEST</name>
            <size xsi:type="xsd:long">0</size>
          </item>
          <item xsi:type="ns2:EntDocument" xmlns:ns2="http://enterprise.ent">
            <URI xsi:type="xsd:string">ent://000000000080f9502c042b57dd68d7eb</URI>
            <created xsi:type="xsd:dateTime">2005-02-08T15:39:49.640Z</created>
            <name xsi:type="xsd:string">FirstNewDocument</name>
            <size xsi:type="xsd:long">0</size>
          </item>
        </listResponse>
      </soapenv:Body>
    </soapenv:Envelope>

    The WSDL was originally auto-generated by Axis, but was later slightly modified.

    Also, here is my deploy.wsdd file:

    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
                xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

      <service name="ent" provider="java:RPC" style="wrapped" use="literal">
        <wsdlFile>ent-wrapped.wsdl</wsdlFile>

        <parameter name="className" value="ent.enterprise.EntAPI" />
        <parameter name="allowedMethods" value="load write clear list delete read create login logout"/>

        <operation name="list"
            qname="ns:list"
            returnQName="ns:item"
            returnType="ns:ArrayOf_EntDocument"
            xmlns:ns="http://enterprise.ent">
          <parameter name="sid" qname="ns:sid" type="xsd:string" mode="IN" />
        </operation>

        <beanMapping
          xmlns:ns="http://enterprise.ent"
          qname="ns:EntDocument"
          languageSpecificType="java:ent.enterprise.EntDocument"/>
      </service>

    </deployment>


    Thanks for any help,
    Eugene

Re: Returning arrays to .Net (again)

Posted by dr...@yahoo.com.
Does the .net client method you're trying to invoke have the proper XmlElementAttribute mapping to your EntDocument class?
 
It should be something like:
 

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace="http://axis.apache.org/ns/interop", ResponseNamespace="http://axis.apache.org/ns/interop", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

[return: System.Xml.Serialization.XmlElementAttribute("item", Type=typeof(EndDocument))]

public EndDocument[] list(string sid)
{

}
 
I had to manually add the element type mapping to some of my .net clients to properly deserialize the response.
 


Eugene Shershnev <sh...@gmail.com> wrote:
Hi All,
 
I've searched through the list trying to find why .Net client does not see the array of beans returned by Axis-based wrapped service.
I've tried everything I found except changing the code as was suggested by Eric Chijioke at http://marc.theaimsgroup.com/?l=axis-user&m=109606665519335&w=2
 
The response that I have now looks fine to me, but .Net still gets an empty array back.
 
Any tips will be greatly appreciated.
 
The WSDL is attached (didn't want to make the message body huge) but the response is here:
 
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <listResponse xmlns="http://enterprise.ent">
      <item xsi:type="ns1:EntDocument" xmlns:ns1="http://enterprise.ent">
        <URI xsi:type="xsd:string">ent://000000000080ea83202a2bf6b9724d04</URI>
        <created xsi:type="xsd:dateTime">2005-02-02T21:42:31.765Z</created>
        <name xsi:type="xsd:string">TEST</name>
        <size xsi:type="xsd:long">0</size>
      </item>
      <item xsi:type="ns2:EntDocument" xmlns:ns2="http://enterprise.ent">
        <URI xsi:type="xsd:string">ent://000000000080f9502c042b57dd68d7eb</URI>
        <created xsi:type="xsd:dateTime">2005-02-08T15:39:49.640Z</created>
        <name xsi:type="xsd:string">FirstNewDocument</name>
        <size xsi:type="xsd:long">0</size>
      </item>
    </listResponse>
  </soapenv:Body>
</soapenv:Envelope>

The WSDL was originally auto-generated by Axis, but was later slightly modified.
 
Also, here is my deploy.wsdd file:
 
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 
  <service name="ent" provider="java:RPC" style="wrapped" use="literal">
    <wsdlFile>ent-wrapped.wsdl</wsdlFile>
 
    <parameter name="className" value="ent.enterprise.EntAPI" />
    <parameter name="allowedMethods" value="load write clear list delete read create login logout"/>
 
    <operation name="list"
        qname="ns:list"
        returnQName="ns:item"
        returnType="ns:ArrayOf_EntDocument"
        xmlns:ns="http://enterprise.ent">
      <parameter name="sid" qname="ns:sid" type="xsd:string" mode="IN" />
    </operation>
 
    <beanMapping
      xmlns:ns="http://enterprise.ent"
      qname="ns:EntDocument"
      languageSpecificType="java:ent.enterprise.EntDocument"/>
  </service>
 
</deployment>

 
Thanks for any help,
Eugene
 


> ATTACHMENT part 2 application/octet-stream name=ent-wrapped.wsdl