Good Morning Ken

Binding errors are *usually* the result of datatype conversion errors or possibly client using any definition *not* specifically defined (in your wsdl)
Do you post the  WSDL (and the xsd) so we can view the datatypes as well as the operations you are using?
 
Take a look at this page on how to properly format your parameters *(according to QName spec)* here
http://www.w3.org/TR/wsdl#_document-n
as well as PortSpecifier
 
Your XML Schema document should look something like
<?xml version="1.0"?>
<schema targetNamespace="http://example.com/stockquote/schemas"
       xmlns="http://www.w3.org/2000/10/XMLSchema">       
    <element name="TradePriceRequest">
        <complexType>
            <all>
                <element name="tickerSymbol" type="string"/>
            </all>
        </complexType>
    </element>
    <element name="TradePrice">
        <complexType>
            <all>
                <element name="price" type="float"/>
            </all>
        </complexType>
    </element>
</schema>
WSDL (client) should look something like

http://example.com/stockquote/stockquote.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote/definitions"
          xmlns:tns="http://example.com/stockquote/definitions"
          xmlns:xsd1="http://example.com/stockquote/schemas"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

   <import namespace="http://example.com/stockquote/schemas"
           location="http://example.com/stockquote/stockquote.xsd"/>

    <message name="GetLastTradePriceInput">
        <part name="body" element="xsd1:TradePriceRequest"/>
    </message>

    <message name="GetLastTradePriceOutput">
        <part name="body" element="xsd1:TradePrice"/>
    </message>

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>
        </operation>
    </portType>
</definitions>

(Service definition for SoapService should look something like)
http://example.com/stockquote/stockquoteservice.wsdl

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote/service"
          xmlns:tns="http://example.com/stockquote/service"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:defs="http://example.com/stockquote/definitions"
          xmlns="http://schemas.xmlsoap.org/wsdl/">

   <import namespace="http://example.com/stockquote/definitions"
           location="http://example.com/stockquote/stockquote.wsdl"/>

    <binding name="StockQuoteSoapBinding" type="defs:StockQuotePortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="GetLastTradePrice">
           <soap:operation soapAction="http://example.com/GetLastTradePrice"/>
           <input>
               <soap:body use="literal"/>
           </input>
           <output>
               <soap:body use="literal"/>
           </output>
        </operation>
    </binding>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>
</definitions>
 
In other words all bindings -where to go as well as port, as well as functions as well as what is passed and definitions of same are stated in detail

Makes sense?
Martin--
----- Original Message -----
Sent: Thursday, April 06, 2006 9:40 AM
Subject: [Axis2 0.95]Stub problem.

Hi,

 

I’ve deployed a skeleton service  with an xmlbeans data binding which handles five types of operation: login,format, search,metadata and page. I know the service is working because I’ve accessed it from .NET and it returns correct responses. However, when I try to use the generated Stub class in the following way:

 

         PAFStub stub = new PAFStub(null, "http://localhost:8080/axis2/services/PAF");

         LoginRequestDocument ld = LoginRequestDocument.Factory.newInstance();

         ld.addNewLoginRequest();

 

         // Populate the request

    

         ld.getLoginRequest().setUserID("test");

         ld.getLoginRequest().setPassword("test");

        

         LoginResponseDocument loginResponse = stub.login(ld);

 

it throws an AxisFault telling me that there is a data binding error;

The nested XmlException says: document is not a [EMAIL PROTECTED]://www.edp.co.uk/ws/PAF/: document element local name mismatch expected FormatRequest got LoginRequest

 

This has me very puzzled bearing in mind that a login request works fine when using a NET web reference to the service. As far as I can work out problems arise in MessageReceiverInOut fromOM(OMElement param, Class type) method.

 

Any ideas?

 

Regards,

Ken

Reply via email to