axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vidura Gamini Abhaya <vidu...@gmail.com>
Subject Re: AxisFault thrown with 'unknown'
Date Fri, 20 Feb 2009 14:45:30 GMT
Hi Martin,

I test with a very simple service which is deployed as a POJO. Following is
the WSDL generated by Axis2 for the service.

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="
http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="
http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="
http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="
http://org.apache.axis2/xsd" xmlns:wsaw="
http://www.w3.org/2006/05/addressing/wsdl" xmlns:ns="
http://endpoint.testservice" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="
http://endpoint.testservice">
    <wsdl:documentation>FactorPrimesService</wsdl:documentation>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://endpoint.testservice
">
            <xs:element name="isPrime">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="n" type="xs:long"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="isPrimeResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return"
type="xs:boolean"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="primeCount">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="n" type="xs:long"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="primeCountResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return"
type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getPrime">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="n" type="xs:long"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="getPrimeResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="return"
type="xs:long"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:schema>
    </wsdl:types>
    <wsdl:message name="getPrimeRequest">
        <wsdl:part name="parameters" element="ns:getPrime"/>
    </wsdl:message>
    <wsdl:message name="getPrimeResponse">
        <wsdl:part name="parameters" element="ns:getPrimeResponse"/>
    </wsdl:message>
    <wsdl:message name="primeCountRequest">
        <wsdl:part name="parameters" element="ns:primeCount"/>
    </wsdl:message>
    <wsdl:message name="primeCountResponse">
        <wsdl:part name="parameters" element="ns:primeCountResponse"/>
    </wsdl:message>
    <wsdl:message name="isPrimeRequest">
        <wsdl:part name="parameters" element="ns:isPrime"/>
    </wsdl:message>
    <wsdl:message name="isPrimeResponse">
        <wsdl:part name="parameters" element="ns:isPrimeResponse"/>
    </wsdl:message>
    <wsdl:portType name="FactorPrimesServicePortType">
        <wsdl:operation name="getPrime">
            <wsdl:input message="ns:getPrimeRequest"
wsaw:Action="urn:getPrime"/>
            <wsdl:output message="ns:getPrimeResponse"
wsaw:Action="urn:getPrimeResponse"/>
        </wsdl:operation>
        <wsdl:operation name="primeCount">
            <wsdl:input message="ns:primeCountRequest"
wsaw:Action="urn:primeCount"/>
            <wsdl:output message="ns:primeCountResponse"
wsaw:Action="urn:primeCountResponse"/>
        </wsdl:operation>
        <wsdl:operation name="isPrime">
            <wsdl:input message="ns:isPrimeRequest"
wsaw:Action="urn:isPrime"/>
            <wsdl:output message="ns:isPrimeResponse"
wsaw:Action="urn:isPrimeResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="FactorPrimesServiceSoap11Binding"
type="ns:FactorPrimesServicePortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
        <wsdl:operation name="getPrime">
            <soap:operation soapAction="urn:getPrime" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="primeCount">
            <soap:operation soapAction="urn:primeCount" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="isPrime">
            <soap:operation soapAction="urn:isPrime" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="FactorPrimesServiceSoap12Binding"
type="ns:FactorPrimesServicePortType">
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
        <wsdl:operation name="getPrime">
            <soap12:operation soapAction="urn:getPrime" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="primeCount">
            <soap12:operation soapAction="urn:primeCount" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="isPrime">
            <soap12:operation soapAction="urn:isPrime" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="FactorPrimesServiceHttpBinding"
type="ns:FactorPrimesServicePortType">
        <http:binding verb="POST"/>
        <wsdl:operation name="getPrime">
            <http:operation location="FactorPrimesService/getPrime"/>
            <wsdl:input>
                <mime:content type="text/xml" part="getPrime"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="getPrime"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="primeCount">
            <http:operation location="FactorPrimesService/primeCount"/>
            <wsdl:input>
                <mime:content type="text/xml" part="primeCount"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="primeCount"/>
            </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="isPrime">
            <http:operation location="FactorPrimesService/isPrime"/>
            <wsdl:input>
                <mime:content type="text/xml" part="isPrime"/>
            </wsdl:input>
            <wsdl:output>
                <mime:content type="text/xml" part="isPrime"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="FactorPrimesService">
        <wsdl:port name="FactorPrimesServiceHttpSoap11Endpoint"
binding="ns:FactorPrimesServiceSoap11Binding">
            <soap:address location="
http://169.254.2.2:8080/axis2/services/FactorPrimesService.FactorPrimesServiceHttpSoap11Endpoint
"/>
        </wsdl:port>
        <wsdl:port name="FactorPrimesServiceHttpSoap12Endpoint"
binding="ns:FactorPrimesServiceSoap12Binding">
            <soap12:address location="
http://169.254.2.2:8080/axis2/services/FactorPrimesService.FactorPrimesServiceHttpSoap12Endpoint
"/>
        </wsdl:port>
        <wsdl:port name="FactorPrimesServiceHttpEndpoint"
binding="ns:FactorPrimesServiceHttpBinding">
            <http:address location="
http://169.254.2.2:8080/axis2/services/FactorPrimesService.FactorPrimesServiceHttpEndpoint
"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>


Furthermore, I add a few OMElements to the SOAP header with the following
code in the client. Unfortunately. This code is written inside a Thread and
multiple requests are generated at the client parallely as a result. I don't
have a XSD written for this unfortunately.

FactorPrimesServiceStub service;

service = new FactorPrimesServiceStub();
FactorPrimesServiceStub.PrimeCount gp = new
FactorPrimesServiceStub.PrimeCount();

OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMElement omElement = omFactory.createOMElement
(new QName("http://ws.edu.rmit.cs.rt", "RealTimeParams", "edu.rmit.cs.rt"),
null);
OMElement omDeadline = omFactory.createOMElement(new QName("
http://ws.edu.rmit.cs.rt","Deadline","edu.rmit.cs.rt"), null);
OMElement omPeriod = omFactory.createOMElement(new QName("
http://ws.edu.rmit.cs.rt", "Period", "edu.rmit.cs.rt"), null);
OMElement omClientID = omFactory.createOMElement(new QName("
http://ws.edu.rmit.cs.rt", "clientid", "edu.rmit.cs.rt"), null);
OMElement omExecTime = omFactory.createOMElement(new QName("
http://ws.edu.rmit.cs.rt", "ExecTime", "edu.rmit.cs.rt"), null);

omPeriod.setText("0");
omClientID.setText(client.getClientId());

omElement.addChild(omDeadline);
omElement.addChild(omPeriod);
omElement.addChild(omClientID);
omElement.addChild(omExecTime);

service._getServiceClient().addHeader(omElement);

omDeadline.setText(Long.toString(deadline));
omExecTime.setText(Float.toString(execTime));

gp.setN(taskSize);

long total = 0;
try {

    FactorPrimesServiceStub.PrimeCountResponse grp = service.primeCount(gp);
    total = grp.get_return();



Thanks,

Vidura



On Sat, Feb 21, 2009 at 12:33 AM, Martin Gainty <mgainty@hotmail.com> wrote:

>  contentType is set for the each element in your XSD e.g.
>                     <xsd:element maxOccurs="1" minOccurs="1"
> name="binaryData" nillable="true"
>                         type="xmime:base64Binary"
>
> xmime:expectedContentTypes="application/octet-stream"
>                         xmlns:xmime="http://www.w3.org/2005/05/xmlmime"/>
>
> concerning WSDL messages you can use Message Formatter such as what is seen
> here
>     <!--Following content type to message formatter mapping can be used to
> implement support for different message -->
>     <!--format  serialization in Axis2. These message formats are expected
> to be resolved based on the content type. -->
>     <messageFormatters>
>         <messageFormatter contentType="application/x-www-form-urlencoded"
>
> class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
>         <messageFormatter contentType="multipart/form-data"
>
> class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
>         <messageFormatter contentType="application/xml"
>
> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>         <messageFormatter contentType="text/xml"
>
> class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
>         <messageFormatter contentType="application/soap+xml"
>
> class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
>     </messageFormatters>
>
> If you could post your XSD and WSDL we could be of further assistance
>
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and Sender
> does not endorse distribution to any party other than intended recipient.
> Sender does not necessarily endorse content contained within this
> transmission.
>
>
>
>
> ------------------------------
> Date: Fri, 20 Feb 2009 13:31:43 +1100
> Subject: AxisFault thrown with 'unknown'
> From: viduras@gmail.com
> To: axis-user@ws.apache.org; axis-dev@ws.apache.org
>
> Hi,
>
> I've modified the Axis2 1.4 engine for some experiments and after a recent
> modification it is throwing the following AxisFault at the client
> intermittently,
>
> org.apache.axis2.AxisFault: unknown
>     at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>     at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>     at
> edu.rmit.cs.ws.testservice.FactorPrimesServiceStub.primeCount(FactorPrimesServiceStub.java:740)
>     at
> edu.rmit.cs.net.client.TCPProcessor.createRequest(TCPProcessor.java:127)
>     at edu.rmit.cs.net.client.TCPProcessor.run(TCPProcessor.java:63)
>     at java.lang.Thread.run(Thread.java:713)
>
> The client uses an unmodified version of the axis2-kernel-1.4.jar.
>
> A few things observed,
>
> - If the web service calls are done in a sequential manner (one after the
> other waiting for the first one to complete) the problem doesn't seem to be
> there.
> - Even when the requests are sent in parallel to the server, the first
> requests gets serviced without any problem. The error comes only on the
> second request or after that. When the exception is thrown it gets thrown
> for all the subsequent requests.
> - When the exception is received at the client, the client hangs
> momentarily.
> - No errors are reported on the server.
>
> I've been unable to pinpoint exactly what causes this so far after a couple
> of days effort. However, I found out that the AxisFault gets thrown due to a
> SOAP fault that happens somewhere up the execution. The AxisFault gets
> thrown from the client code due to the code in
> OutInAxisOperationClient.handleRequest,
>
> if (resenvelope.hasFault()||responseMessageContext.isProcessingFault()) {
>                 if (options.isExceptionToBeThrownOnSOAPFault()) {
>                     // does the SOAPFault has a detail element for
> Excpetion
>                     throw
> Utils.getInboundFaultFromMessageContext(responseMessageContext);
>                 }
>             }
>
> due to the MessageContext inside
> operationContext.messageContexts.[Hashmap].key("In"), it its properties
> having a 'fault' for the ContentType.
>
> I couldn't specifically find where the ContentType is set from and what
> causes the fault. Any help in finding out what causes this would be greatly
> appreciated.
>
> Thanks,
>
> Vidura
>
>
> ------------------------------
> Windows Liveā„¢: Keep your life in sync. Check it out.<http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_022009>
>

Mime
View raw message