Hi everybody,

I have 2 questions regarding WebServices DataTypes:

1. Problem with String Arrays

I created a function in J2EE exposed as a web-service that returns a string array to 
the caller:

        /**
  |      * @jboss-net.web-method
  |      * @jboss-net.wsdd-operation
  |      * @ejb.interface-method view-type = "remote"
  |      */     
  |     public String[] testStringArray(){
  |             String s[] = {"test","string"};
  |             return s;
  |     }

When I call this function in a C# Client - I get an System.InvalidOperationException 
that states that there is an error in the XML-Document.

Part of the WSDL looks like this:

...
  | - <complexType name="ArrayOf_xsd_string">
  | - <complexContent>
  | - <restriction base="soapenc:Array">
  |   <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> 
  |   </restriction>
  |   </complexContent>
  |   </complexType>
  | ...
  |   <wsdl:message name="testStringArrayRequest" /> 
  | ...
  | - <wsdl:message name="testStringArrayResponse">
  |   <wsdl:part name="testStringArrayReturn" type="impl:ArrayOf_xsd_string" /> 
  |   </wsdl:message>

If I transfer an int-array everything works fine. Does this have something to do with 
the way XDoclet generates the WSDL-file ?? Or is this a fault of the WSDL generator 
from Microsoft.


2. Accessing Array content in C#

If I transfer an int-array everyting works fine:

        /**
  |      * @jboss-net.web-method
  |      * @jboss-net.wsdd-operation
  |      * @ejb.interface-method view-type = "remote"
  |      */     
  |     public int[] testIntArray(){
  |             int i[] = {10,20,30};
  |             return i;
  |     }

but on the C# site I can't figure out how to access the content of the array... 

...
  | int[] testint = stub.testIntArray();
  | Console.WriteLine(testint[0]);
  | ...

This just shows a 0. What is the problem with this ?? testint.Length returns the 
correct array size of 3.

Thanks 
matt

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3839841#3839841

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3839841


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to