• Post Reply Bookmark Topic Watch Topic
  • New Topic

simple array in WSAD 5.0 web service. is it possible?  RSS feed

 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I'm trying to create a web service in WSAD 5.0.
It doesn't matter if my array is simple type or complex (i.e. String[]), and it doesn't matter if it's a parametr or a result from the method, I get an error in my wsdl.
WSAD generates an xsd file:
<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="qualified"
elementFormDefault="unqualified" targetNamespace="http://myFoo/"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd1="http://myFoo/">
<import namespace="http://schemas.xmlsoap.org/wsdl/" schemaLocation="http://schemas.xmlsoap.org/wsdl/"/>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<sequence/>
<attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
</restriction>
</complexContent>
</complexType>
</schema>
for this file i get three errors:
1. src-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/wsdl/'. Foo.xsdFooWeb/Web Content/wsdl/myFooline 7
2. src-import.0: Failed to read imported schema document 'http://schemas.xmlsoap.org/soap/encoding/'.Foo.xsdFooWeb/Web Content/wsdl/myFoo line 8
3. src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) type definition component.Foo.xsdFooWeb/Web Content/wsdl/myFooline 11

it seems to me that for some odd reason WSAD doesn't recognize the schams (warnings 1+2) and there for has an erro (3).
Does any body know how to fix the problem?
I'm want to use my generted wsdl's in a .net platform (but as for noe I can't because ther's a fault in the genrated wsdl...)
My method is (it's a part of a EJB):
public void setStringArray(String[] strArray)
{
String[] str = strArray;
System.out.println("Array length is: " + str.length);
}
 
Byron Estes
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this will solve your problem, because from your initial post I couln't ascertain when you were seeing the errors.
However, since you are creating a complex type (...not a standard value), the following may be helpful. I found that for an EJB webservice that returns a complex value object defined by me that I needed to put those class files in a special "shared" library (a separate jave project) that I could add to the EJB project. The Java Build Path for the EJB project must include "shared project" and be selected/checked (Order/Export).
Hope this helps.
 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'll try your solution although my samlpe above doesn't use a complex object, it uses String[]. Look at the EJB method:
public void setStringArray(String[] strArray)
{
String[] str = strArray;
System.out.println("Array length is: " + str.length);
}

Does it count as a complex object?
What can I do?
My problem occurs (the two warnings above and the error hapend when I try to compile my Web Project...).
Why is this hapening?
While generating the WSAD client fo my webservices (trying both String[] and Account[] where Account is in a seperate java project...) I get the following errors (at creation time):
"The following parameter is of type array that is not supported". trhis error occurs twice for each array specified above...
As a result I get the following message:
"Some methods have been omitted from the sample because they contained unsupported types:.
Needless to say that in my sample the EJB methods that deal with String[] and Account[], aren't visible...
[ March 19, 2003: Message edited by: Yair Ogen ]
 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, by generating a .NET proxy I received the follwing Exception:
System.Web.Services.Protocols.SoapHeaderException: No Deserializer found to deserialize a ':acctArray' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!