axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject Re: axis2 - ADB , XMLBeans : service difference. Error while invoking different implementations of the same service
Date Wed, 18 Apr 2007 12:58:40 GMT
Good Morning

My question is how is the XML schema definition could be imported without 
ref'ng a valid XMLSchema from namespace attribute?
I would suggest looking at this example from 
/samples/databinding/stockquote/StockQuote.xsd

//remember to import the namespace in your .wsdl via import statement e.g.
 <import 
namespace="http://w3.ibm.com/schemas/services/2002/11/15/stockquote" 
location="StockQuote.xsd" />

//In the wsdl we can import our own parameters based on the getStockQuote
<message name="getStockQuoteReq">
  <part name="parameters" element="types:getStockQuote" />
 </message>

//Display of Contents of StockQuote.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 targetNamespace="http://w3.ibm.com/schemas/services/2002/11/15/stockquote"
 xmlns="http://w3.ibm.com/schemas/services/2002/11/15/stockquote"
>
 <xsd:element name="quote">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="symbol" type="xsd:string"/>
    <xsd:element name="volume" type="xsd:integer"/>
    <xsd:element name="lastTrade" type="lastTradeType"/>
    <xsd:element name="change" type="changeType"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="changeType">
  <xsd:sequence>
   <xsd:element name="dollar" type="xsd:float"/>
   <xsd:element name="percent" type="xsd:float"/>
   <xsd:element name="positive" type="xsd:boolean"/>
  </xsd:sequence>
 </xsd:complexType>
 <xsd:complexType name="lastTradeType">
  <xsd:sequence>
   <xsd:element name="price" type="xsd:float"/>
   <xsd:element name="date" type="xsd:long"/>
  </xsd:sequence>
 </xsd:complexType>

 <!-- Methods signatures -->
 <xsd:element name="getStockQuote">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="symbol" type="xsd:string"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="getStockQuoteResponse">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element ref="quote" />
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
</xsd:schema>

I suggest using a Working (.xsd) example/ modify the xsd elements to suit 
your own requirements..once defined in the imported xsd / then reference 
those types in the wsdl

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Sampige, Srinivas" <SSampige@DIRECTV.com>
To: <axis-user@ws.apache.org>; "Martin Gainty" <mgainty@hotmail.com>
Sent: Tuesday, April 17, 2007 9:29 PM
Subject: axis2 - ADB , XMLBeans : service difference. Error while invoking 
different implementations of the same service


I have implemented 2 versions of the same webservice; one using ADB and
the other using XMLBeans binding. Both services have the same exact
WSDL. I generated a client using xmlbeans binding which works fine
against the service using xmlbeans. But, the same client when pointed
against the service using ADB binding the, client fails with "
Unexpected subelement"

-------------------------------
org.apache.axis2.AxisFault: java.lang.RuntimeException: Unexpected
subelement Time
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:271)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO
peration.java:202)
at
com.directv.dtss.itx.client.ScheduleServiceStub.ScheduleReceiveService(S
cheduleServiceStub.java:152)
at
com.directv.dtss.itx.client.helper.ScheduleReceiveServiceClientHelper.po
stSchedule(ScheduleReceiveServiceClientHelper.java:112)
at
com.directv.dtss.itx.client.sample.ScheduleServiceClientSample.main(Sche
duleServiceClientSample.java:157)
----------------------------------

>From my understanding, given a WSDL, when we generate a client it should
work regardless of how the service is implemented correct?(transparent
to the client hence the very purpose of the WSDL right?).

I am running Axis2-1.1.1 on Tomcat 5.5.23

I have attached 2 files=
   1) the wsdl itself  (scheduleService.wsdl)
   2) the request/response output from tcpmon in the 2 cases
(adbxmlbeans.txt)

I followed steps outlined in
http://www.nabble.com/-Axix2--java.lang.RuntimeException:-Unexpected-sub
element-value-t3489089.html but I cannot get to the stage where I can
see the response in the scenario when it fails.


Thanks in advance
Srinivas



--------------------------------------------------------------------------------


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message