RE: AxisFault thrown with 'unknown'

2009-02-20 Thread Martin Gainty

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: vidu...@gmail.com
To: axis-user@ws.apache.org; axis-...@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. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_022009

Re: AxisFault thrown with 'unknown'

2009-02-20 Thread Vidura Gamini Abhaya
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:documentationFactorPrimesService/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