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 Ralph Scheuer <ra...@gmx.net> on 2005/02/10 18:55:46 UTC
Newbie Axis mapping problem
Hello everybody,
I am just getting started with axis and I have run into a strange
issue. In the BizTalk server's WSDL there is an imported schema for a
"priceEnv" entity. In the "GetPrice" method definition, I get the
following declaration:
<s:element name="GetPriceResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetPriceResult">
<s:complexType>
<s:sequence>
<s:any namespace="http://www.tempuri.org/pricesEnv.xsd"/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
After generating the classes with WSDL2Java, I find that my *SOAP class
contains a method getPrice with the appropriate parameters but returns
a GetPriceResult object that does not contain the usual accessor
methods, just a get_any method that returns a MessageElement array and
all the other standard methods. However, the PriceEnv class is
generated twice (once for the org.tempuri.www namespace from where the
schema is imported and once for the namespace where the WSDL comes
from).
When querying the webservice by hand, I find that the GetPrice method
returns a priceEnv entity with a schema and a diffgram containing the
real data. How do I get the appropriate priceEnv object from the query
so that I have a real object mapping without dealing with all the XML
manually? I am thinking of a situation like the following:
In another test setup that I used previously with Axis, I had a service
definition in the WSDL for Customer objects that looked like:
<s:element name="GetCustomerResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCustomerResult"
type="tns:Customer"/>
</s:sequence>
</s:complexType>
</s:element>
The customer object itself was defined inside the WSDL and Axis
WSDL2Java generated perfect mappings for the Java equivalents, so that
I could use myCustomer.getName() etc.
Is there a bug in the server implementation or am I doing something
fundamentally wrong or ignoring the obvious?
Your help is greatly appreciated.
Thanks,
Ralph Scheuer