Hi. When I invoke the swa examples, either from axis 2 or wso2-esb, the input 
message comes as null on the service side, do you know why this may be 
happening ? I am injecting a text message, not a binary file. Could this be the 
cause ?
 
The axis service class looks like this:
 
public class AttachmentService {
 
 public String uploadFile(String name, String attchmentID) throws IOException
 {
  MessageContext msgCtx = MessageContext.getCurrentMessageContext();
  Attachments attachment = msgCtx.getAttachmentMap();
  DataHandler dataHandler = attachment.getDataHandler(attchmentID);
  File file = new File(
    name);
  FileOutputStream fileOutputStream = new FileOutputStream(file);
  dataHandler.writeTo(fileOutputStream);
  fileOutputStream.flush();
  fileOutputStream.close();
  
  return "File saved succesfully.";
 }
 
services.xml:
 
<service name="SWASampleService" targetNamespace=" 
http://ws.apache.org/commons/ns/payload";>
    <schema schemaNamespace=" http://ws.apache.org/commons/ns/payload"/ 
<http://ws.apache.org/commons/ns/payload> >
    <parameter locked="false" 
name="ServiceClass">sample.soapwithattachments.service.AttachmentService</parameter>
    <operation name="uploadFile">
        <actionMapping>urn:uploadFile</actionMapping>
        <messageReceiver 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </operation>
</service>

synapse:
 
<syn:sequence name="swa_proxy">
        <syn:log level="full" separator=","/>
        <syn:header name="Action" value="urn:uploadFile"/>
        <syn:send>
            <syn:endpoint>
                <syn:address format="soap12" uri=" 
http://localhost:8080/axis2/services/SWASampleService"; optimize="swa"/>
            </syn:endpoint>
        </syn:send>
    </syn:sequence>

thanks
 
Remsy

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Indika Kumara
Sent: October 3, 2008 1:37 PM
To: [email protected]
Subject: Re: [esb-java-user] calling axis swa sample



This happens when the name-space of expected incoming message according to the 
WSDL of service is not equal to the name-space of the request payload (The 
first element of the SOAP body). 


You have to do either change service WSDL or change request message or do 
transform in the ESB prior to forwarding message to external service.


Thanks

Indika



Schmilinsky, Remsy wrote: 

I configured a sequence to invoke one of the axis 2 samples, the one dealing 
with swa.



from synapse:



<syn:sequence name="swa_proxy">

        <syn:log level="full" separator=","/>

        <syn:header name="Action" value="uploadFile"/>

        <syn:send>

            <syn:endpoint>

                <syn:address uri= 
"http://localhost:8080/axis2/services/SWASampleService"; 
<http://localhost:8080/axis2/services/SWASampleService>  optimize="swa"/>

            </syn:endpoint>

        </syn:send>

    </syn:sequence>



on the axis server console, I got this error, how can I set this namespace ? 
The message comes from jms transport.



[ERROR] namespace mismatch require  http://service.soapwithattachments.sample 
found  http://ws.apache.org/commons/ns/payload

org.apache.axis2.AxisFault: namespace mismatch require  
http://service.soapwithattachments.sample found  http://ws.apache.org/comm

ons/ns/payload



thanks



remsy



_______________________________________________

Esb-java-user mailing list

[email protected]

http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user


  _____  



No virus found in this incoming message.

Checked by AVG -  http://www.avg.com 

Version: 8.0.173 / Virus Database: 270.7.5/1698 - Release Date: 9/29/2008 7:25 
PM



  


_______________________________________________
Esb-java-user mailing list
[email protected]
http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to