axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nath, Niraj" <Niraj.N...@cns-inc.com>
Subject Help needed - Problem returning binary data
Date Wed, 02 Jan 2008 19:48:11 GMT

Hi, 
  
I have written a webservice which takes in a paramter (file name with
path) and returns its binary data within a DataHandler 
  
OMText data = l_objFactory.createOMText(new DataHandler(new
FileDataSource(new File(p_sFileName))), true);<BR> 
                l_objResponse.addChild(data);     
The WSDL goes as follows: 
  
[CODE] <wsdl :D efinitions
xmlns:tns="http://www.xxxxx.com/wsdl/FileUtilService"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns1="http://common.webservices.ecams.com/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.xxxxx.com/wsdl/FileUtilService"><wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ax21="http://common.webservices.ecams.com/xsd"
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://common.webservices.ecams.com/xsd"> 
<xs:element name="getFileData"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="p_objOMElement" type="xs:anyType" /> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 
<xs:element name="getFileDataResponse"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="return" type="xs:anyType" /> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 
</xs:schema></wsdl:types><wsdl:message name="getFileDataMessage"><wsdl
:p art name="part1" element="ns1:getFileData"
/></wsdl:message><wsdl:message name="getFileDataResponseMessage"><wsdl
:p art name="part1" element="ns1:getFileDataResponse"
/></wsdl:message><wsdl :p ortType name="FileUtilServicePortType"><wsdl
:o peration name="getFileData"><wsdl:input
message="tns:getFileDataMessage" /><wsdl :o utput
message="tns:getFileDataResponseMessage" /></wsdl :o peration></wsdl :p
ortType><wsdl:binding name="FileUtilServiceSOAP11Binding"
type="tns:FileUtilServicePortType"><soap:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl :o peration name="getFileData"><soap :o peration
soapAction="urn:getFileData" style="document" /><wsdl:input><soap:body
use="literal" namespace="http://www.xxxxx.com/wsdl/FileUtilService"
/></wsdl:input><wsdl :o utput><soap:body use="literal"
namespace="http://www.xxxxx.com/wsdl/FileUtilService" /></wsdl :o
utput></wsdl :o peration></wsdl:binding><wsdl:binding
name="FileUtilServiceSOAP12Binding"
type="tns:FileUtilServicePortType"><soap12:binding
transport="http://schemas.xmlsoap.org/soap/http" style="document"
/><wsdl :o peration name="getFileData"><soap12 :o peration
soapAction="urn:getFileData" style="document" /><wsdl:input><soap12:body
use="literal" namespace="http://www.xxxxx.com/wsdl/FileUtilService"
/></wsdl:input><wsdl :o utput><soap12:body use="literal"
namespace="http://www.xxxxx.com/wsdl/FileUtilService" /></wsdl :o
utput></wsdl :o peration></wsdl:binding><wsdl:service
name="FileUtilService"><wsdl :p ort name="FileUtilServiceSOAP11port"
binding="tns:FileUtilServiceSOAP11Binding"><soap:address
location="http://localhost:8080/axis2/services/FileUtilService" /></wsdl
:p ort><wsdl :p ort name="FileUtilServiceSOAP12port"
binding="tns:FileUtilServiceSOAP12Binding"><soap12:address
location="http://localhost:8080/axis2/services/FileUtilService" /></wsdl
:p ort></wsdl:service></wsdl :D efinitions>   [/CODE] 
 
The webservice works perfectly fine when invoked using a stand alone
client, but when invoked from within the web-application that hosts this
webservice, it pops up an Axis Fault: [CODE]A required header
representing a Message Addressing Property is not present[/CODE]
  
I have tried disabling addressing in axis2.xml completely, tried sending
the action explicitly 
[CODE]  options.setAction("urn:getFileData");  [/CODE] but have not been
able to make it work when the WS is invoked from within the web
application. 

Services.xml: 
        <service name="FileUtilService"> 
                <parameter name="ServiceClass"
locked="false">com.ecams.webservices.common.FileUtilService</parameter> 
            <operation name="getFileData"> 
                    <messageReceiver
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" /> 
            </operation> 
        </service> 

  
The WebServer is WebSphere 6.1. MTOM is enabled in axis2.xml. 
  
Any Ideas? Please Help...

 

Regards

 

Niraj Nath

CNSI

Ph - 240 399 2104


 





This electronic message contains information from CNSI, which may be company sensitive, proprietary,
privileged or otherwise protected from disclosure. The information is intended to be used
solely by the intended recipient(s). If you are not an intended recipient any review, disclosure,
copying, distribution or use of this transmission or its contents is prohibited. If you have
received this transmission in error, please notify the sender immediately and delete all copies
of this message.

---------------------------------------------------------------------
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