J Camp <[EMAIL PROTECTED]> wrote:
Hi,I am new to using axis and strugling to find an answer to this issue. hope you can helpI am trying to call a webservice. It requires a 'bean type' ie beanA. The client program I am writing is expecting another 'bean type' ie beanB.I have this statements in my code..Service service = new Service();
Call call = (Call) service.createCall();
//QName qn = new QName("http://hello.org/wsdl", "getReceipt");
QName qn = new QName( "http://hello.org/types", "getReceiptRequest" );
QName qnResponse = new QName( "http://hello.org/types", "getReceiptResponse");call.registerTypeMapping(getReceiptRequest.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(getReceiptRequest.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(getReceiptRequest.class, qn));call.registerTypeMapping(getReceiptResponse.class, qnResponse,
new org.apache.axis.encoding.ser.BeanSerializerFactory(getReceiptResponse.class, qnResponse),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(getReceiptResponse.class, qnResponse));call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( new QName("http://hello.org/wsdl", "getReceipt") );
call.addParameter( "getReceiptRequest_1", qn, ParameterMode.IN );
call.addParameter( "getReceiptResponse_1",qnResponse,ParameterMode.INOUT);
call.setReturnType(qnResponse, getReceiptResponse.class);
call.invoke( new Object[] { new getReceiptRequest(), new getReceiptResponse()} );
Map outparams = call.getOutputParams();I getError : caught exception while handling request: deserialization error: unexpected XML reader state. expected: END but found: START: GetReceiptResponse_1
Can you help me how to properly call this webservice?
Here is the wsdl.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://hello.org/wsdl" xmlns:ns2="aaaa" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="UniService" targetNamespace="http://hello.org/wsdl">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="aaaa" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="aaaa">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="GetReceiptRequest">
<sequence>
<element name="localTransactionDate" type="string"/>
<element name="localTransactionTime" type="string"/>
<element name="localSystemId" type="string"/>
<element name="localSystemTransactionId" type="string"/>
<element name="amount" type="string"/>
</sequence>
</complexType>
<complexType name="GetReceiptResponse">
<sequence>
< ;element name="responseCode" type="string"/>
<element name="erDate" type="string"/>
<element name="erTime" type="string"/>
<element name="localTransactionDate" type="string"/>
<element name="localTransactionTime" type="string"/>
<element name="localSystemId" type="string"/>
<element name="localSystemTransactionId" type="string"/>
</sequence>
</complexType>
</schema>
</types>
<message name="Receipt_getReceipt">
<part name="GetReceiptRequest_1" type="ns2:GetReceiptRequest"/>
</message>
<message name="Receipt_getReceiptResponse">
<part name="GetReceiptResponse_1" type="ns2:GetReceiptResponse"/>
</message>
<portType name="UniServiceIF">
<operation name="getReceipt" parameterOrder="GetReceiptRequest_1">
<input message="tns:Receipt_getReceipt"/>
<output message="tns:Receipt_getReceiptResponse"/>
</operation>
</portType>
<binding name="UniServiceIFBinding" type="tns:UniServiceIF">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="getReceipt">
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://hello.org/wsdl"/></output>
&nb sp; <soap:operation soapAction=""/>
</operation>
</binding>
<service name="UniService">
<port name="UniServiceIFPort" binding="tns:UniServiceIFBinding">
<soap:address xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" location="http://203.202.188.236:8090/Uni"/>
</port>
</service>
</definitions>
Start your day with Yahoo! - make it your home page
