Hi Indika. Can you clarify whether  this parameter goes within axis2.xml from 
wso2-esb or services.xml from the remote service ?
 
thanks
 
Remsy

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



Hi 


Try adding <parameter name="enableSwA">true</parameter> to the service.xml and 
make sure that there is a contentID that is equal to the 'attchmentID' 
parameter.  You can either debug Service or add something like following to 
service. 


for (String contentID:attachment.getAllContentIDs()){

             System.out.println(contentID);    

        }

System.out.println(attchmentID);

 BTW, there is an issue with mtom [1].  But, SwA need to work. I also try out 
[2]; it is working for SwA and for both text/binary. If you can provide sample 
service and client code, I may able to try it. 

You may have already followed the [4] and [5], if not please go through those. 
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->

Thanks

Indika
 

[1] https://issues.apache.org/jira/browse/SYNAPSE-348

[2] http://wso2.org/project/esb/java/1.7.1/docs/ESB_Samples.html#Sample51

[3] http://wso2.org/library/1675

[4] http://ws.apache.org/axis2/1_4/mtom-guide.html

[5] http://wso2.org/library/1675










Schmilinsky, Remsy wrote: 

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%22/> >
    <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

  


  _____  



Internal Virus Database is out of date.

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