You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by loredana loredana <lo...@yahoo.com> on 2007/10/08 17:45:52 UTC

Re: simplest example pls help THANKS

thanks a lot. it worked

----- Original Message ----
From: Upul Godage <up...@gmail.com>
To: axis-user@ws.apache.org
Sent: Monday, October 8, 2007 4:31:17 PM
Subject: Re: simplest example pls help

Hi,

Add this line and try.

call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("
http://tempuri.org";, "CelsiusToFahrenheit"));

call.setSOAPActionURI("http://tempuri.org/CelsiusToFahrenheit
");

Also checkout Axis2 if you are starting out.
http://ws.apache.org/axis2/

Upul


On 10/8/07, 
loredana loredana <lo...@yahoo.com> wrote:
I am strugling for a couple of days now to do the most simplest web service client using a web service on w3schools as test.

http://www.w3schools..com/webservices/tempconvert.asmx


This is the web service. has 2 possible operations with one parameter. Can't get any simpler than this. Yet, I can't make a client for it. I already wrote about this problems couple of days ago, but I got nowhere. so this is what I tried:


try{

    String endpoint =
              "http://www.w3schools.com/webservices/tempconvert.asmx";;

          Service  service = new Service();

          Call     call    = (Call) service.createCall();

          call.setTargetEndpointAddress( new java.net.URL(endpoint) );
          call.setOperationName(new QName("http://tempuri.org
";, "CelsiusToFahrenheit"));

          String ret = (String) call.invoke( new Object[] { "10" } );

          System.out.println("result: " + ret + "'");}

        catch{}

this should work but I keep getting
"Server did not recognize the value of HTTP Header SOAPAction: ."

can any of you give this a try?? for someone with experience in axis this shouldn't take more than 5 min to try. I have a eclipse plugin that generates a web service client based on the wsdl but I don't want to "cheat"! I want to do it myself but i'm stuck. any help would be appreciated it!!





      ____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.

http://tv.yahoo.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org

For additional commands, e-mail: axis-user-help@ws.apache..org










       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

Re: Axis2 SWA client communicating Axis2 MTOM service

Posted by Thilina Gunarathne <cs...@gmail.com>.
I missed your earlier mail...sorry abt that..

1)  While using SWA we need to use  OperationClient API at client side.
>  using MessageContext on service side to attach a attachment . Don't forget
> to send messageId back as pay load so that you can extract  actual
> attachment client side.


Yes.. sending the ID is the recommended and most useful way.. But you can
also send unreferenced attachments with SWA, without putting a MessageID in
the body.. Then in the other side you can access them by getting an iterator
out of attachment map.

2) Yes caching is supported while using SWA.
> 3) if SOAP 1.2 version works with SWA ? I need to to try yet.


It works with SOAP 1.2 too...

thanks,
Thilina

regards
> Yogesh
>
>
>
>
>
>  *Yogesh.Dhake@mizuhocbus.com*
>
> 10/08/2007 03:12 PM
>  Please respond to
> axis-user@ws.apache.org
>
>   To
> axis-user@ws.apache.org  cc
>
>  Subject
> Re: Axis2 SWA client communicating Axis2 MTOM service
>
>
>
>
>
>
>
> Hi
> Thanks for insight
> Sorry but two small question.
> 1) For enabling SWA do  i need to do any changes on service code or
> Just changing axis conf file is ok
>  <parameter name="enableMTOM" locked="false">false</parameter>
>  <parameter name="enableSwA" locked="false">true</parameter>
>
> As I see in SWA sample I see usage of MessageContext Variable and usage of
> OMelement variables/SenderClient at client side.In my case we really don't
> use them. or it will be transparent to me if I use stub client.
>
> 2) Is use of SOAP 1.2 is ok ? in sample i see
>
>
> 2) Caching is supported in SWA?
>
>
>
> regards
> Yogesh
>
>   *"Thilina Gunarathne" <cs...@gmail.com>*
>
> 10/08/2007 01:22 PM
>   Please respond to
> axis-user@ws.apache.org
>
>   To
> axis-user@ws.apache.org  cc
>
>  Subject
> Re: Axis2 SWA client communicating Axis2 MTOM service
>
>
>
>
>
>
>
>
> > I have a web service running with AXIS2 with MTOM and I am trying to
> > communicate it with  Axis2 Client with SWA enabled ( Soap with
> attachment).
> > Is this possible to do ?
> Nope.. Not if you are going to use the MTOM binding features, such as
> automatic binding of bianry attachments to the XML tree... Things will
> fail miserably if you r using data binding to generate the service
> skeleton, as the message no longer conforms to the schema.
>
> You can access the attachments using the attachments API..But then you
> are essentially doing SwA in the server side.. Also you won't be able
> to use data binding.
>
> >
> > Reason I need to do it as  I am using ALSB 2.6   in between which does
> not
> > support MTOM.
> >
> > If yes  Can any one tell me what is wrong in this SOAP response received
> at
> > client. It fails with ClassCastException at client side.   I am having
> > problem at client side .
> Looking at the source you pasted below, you seems to be using data
> binding together with a WSDL which has base64Binary in it. Your
> response is SwA, which does not conforms to the data bounded schema.
> Also the response message is broken, as it's header tells that it's
> SwA, but the body has XOP:include.
>
> Mixing SwA with MTOM when data binding is used is not a good idea..
>
> thanks,
> Thilina
>
> >I tried to debug found It try to cast
> > getBuilder() to
> > org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder
> > which is not in actually for my binaryData node.
> > I am finding difficult why  it try to use MTOMstax event I enabled only
> SWA
> > at client side.  If you can make anything out of SOAP message what is
> wrong
> > let me know.
> >
> > My Stub setting
> > EMISEPServiceStub serviceStub = new
> > EMISEPServiceStub("http://localhost:8085/EMISProxyService");
> >
> > serviceStub._getServiceClient().getOptions().setProperty(
> >         Constants.Configuration.ENABLE_MTOM,
> > Constants.VALUE_FALSE);
> > serviceStub._getServiceClient().getOptions().setProperty(
> >
> > Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
> >
> >
> >
> > SOAP message response
> >
> > HTTP/1.1 200 OK
> > Date: Mon, 08 Oct 2007 14:32:13 GMT
> > Transfer-Encoding: chunked
> > Content-Type: multipart/related; type="application/soap+xml";
> >
> > start="0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org";
> >         boundary=MIME_Boundary; charset=UTF-8
> > X-Powered-By: Servlet/2.4 JSP/2.0
> >
> > 0670
> > --MIME_Boundary
> > Content-ID:
> > 0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org
> > Content-Type: application/soap+xml; charset=utf-8
> > Content-Transfer-Encoding: 8bit
> >
> > <?xml version='1.0' encoding='utf-8'?>
> >    <soapenv:Envelope
> > xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
> >       <soapenv:Body>
> >          <ns1:getFileResponse
> > xmlns:ns1="http://mizuho.com/emis/ep/paraminfo">
> >             <ns1:method>getFile</ns1:method>
> >             <ns1:parameters>
> >                <ns1:FileDataInfo>
> >
> > <ns1:fileExtension>txt</ns1:fileExtension>
> >
> > <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
> >                   <ns1:fileName>test</ns1:fileName>
> >                   <ns1:folderName>c:\TEMP</ns1:folderName>
> >                   <ns1:scriptName>*</ns1:scriptName>
> >                   <ns1:attachment>
> >                      <ns1:size>1231</ns1:size>
> >                      <ns1:checksum>1231</ns1:checksum>
> >                   </ns1:attachment>
> >                </ns1:FileDataInfo>
> >             </ns1:parameters>
> >             <ns1:response>
> >                <ns1:attachment>
> >                   <ns1:binaryNode>
> >                      <xop:Include
> > href="cid:1.urn:uuid:A892DC0EC609F508D61191853934041@apache.org"
> > xmlns:xop="http://www.w3.org/2004/08/xop/include" />
> >                   </ns1:binaryNode>
> >                   <ns1:size>121</ns1:size>
> >                   <ns1:checksum>121</ns1:checksum>
> >                </ns1:attachment>
> >
> > <ns1:responseStatus>true</ns1:responseStatus>
> >                <ns1:hasAttachment>true</ns1:hasAttachment>
> >             </ns1:response>
> >             <ns1:EPInfo>
> >                <ns1:node>
> >                   <ns1:name>sasdf</ns1:name>
> >                   <ns1:id>12</ns1:id>
> >                </ns1:node>
> >                <ns1:system>
> >                   <ns1:name>sasdf</ns1:name>
> >                   <ns1:id>12</ns1:id>
> >                </ns1:system>
> >             </ns1:EPInfo>
> >             <ns1:currentInterface>
> >                <ns1:name>sdfa</ns1:name>
> >                <ns1:id>12</ns1:id>
> >             </ns1:currentInterface>
> >          </ns1:getFileResponse>
> >       </soapenv:Body>
> >    </soapenv:Envelope>--MIME_BoundaryContent-Type:
> > text/plainContent-Transfer-Encoding: binaryContent-ID:
> >
> > <1....@apache.org>Test
> > Data created by 12:00 at 10/4/2007  to test attachment at
> > ALSB0015--MIME_Boundary--0000
> >
> >
> > Exception stack trace.  I am getting.
> > java.lang.ClassCastException:
> > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub$Base64Binary$Factory.parse(
> EMISEPServiceStub.java:2228)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub$Attachment$Factory.parse(
> EMISEPServiceStub.java:6121)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub$ResponseData$Factory.parse(
> EMISEPServiceStub.java:3595)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub$CommandInfo$Factory.parse(
> EMISEPServiceStub.java:4698)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub$GetFileResponse$Factory.parse(
> EMISEPServiceStub.java:4003)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1684)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java
> :1221)
> >         at
> > com.mizuho.yogesh.WebServiceControlImpl.getFile(
> WebServiceControlImpl.java:89)
> >         at
> > com.mizuho.yogesh.NoWeblogic.webServiceControlGetFile(NoWeblogic.java
> :80)
> >         at
> > com.mizuho.yogesh.NoWeblogic.main(NoWeblogic.java:42)
> > org.apache.axis2.AxisFault:
> > org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
> >         at
> > org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1752)
> >         at
> > com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java
> :1221)
> >
> >
> > Thanks
> >
> > Regards
> > Yogesh Dhake
> >
> >
> ======================================================================================================
> >  This transmittal and any attachments may contain confidential,
> privileged
> > or sensitive information and is solely for the use of the intended
> > recipient. If you are not the intended recipient, you are hereby
> notified
> > that you have received this transmittal and any attachments in error and
> any
> > review, dissemination, distribution or copying thereof is strictly
> > prohibited. If you have received this transmittal and any attachments in
> > error please notify the sender and immediately destroy the message and
> all
> > its attachments. Any opinions herein expressed may be those of the
> author
> > and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate
> Bank
> > (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho
> > Financial Group ("Mizuho"). Mizuho accepts no responsibility for the
> > accuracy or completeness of any information herein contained.
> >  E-Mail received by or sent from officer of Mizuho Securities USA Inc.
> > (which is a registered U.S. broker-dealer and the entity through which
> > Mizuho generally conducts its investment banking, capital markets, and
> > securities business in the United States) is electronically archived and
> > recorded and is subject to review and monitoring by and/or disclosure to
> > persons other than the recipient, including (but not limited to) Mizuho
> > Securities USA Inc. supervisory personnel. Such communications may be
> > produced to regulatory authorities or others with legal rights to the
> > information.
>
>
> --
> Thilina Gunarathne  - http://thilinag.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>


-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

Re: Axis2 SWA client communicating Axis2 MTOM service

Posted by Yo...@mizuhocbus.com.
Hi 

I would like to answer my question for benifit of others.  I solved my 
issue well now. 
If wrong just correct it

1)  While using SWA we need to use  OperationClient API at client side. 
using MessageContext on service side to attach a attachment . Don't forget 
to send messageId back as pay load so that you can extract  actual 
attachment client side.
2) Yes caching is supported while using SWA.
3) if SOAP 1.2 version works with SWA ? I need to to try yet.

regards
Yogesh 






Yogesh.Dhake@mizuhocbus.com 
10/08/2007 03:12 PM
Please respond to
axis-user@ws.apache.org


To
axis-user@ws.apache.org
cc

Subject
Re: Axis2 SWA client communicating Axis2 MTOM service







Hi 
Thanks for insight   
Sorry but two small question. 
1) For enabling SWA do  i need to do any changes on service code or 
Just changing axis conf file is ok 
  <parameter name="enableMTOM" locked="false">false</parameter> 
  <parameter name="enableSwA" locked="false">true</parameter> 

As I see in SWA sample I see usage of MessageContext Variable and usage of 
OMelement variables/SenderClient at client side.In my case we really don't 
use them. or it will be transparent to me if I use stub client. 

2) Is use of SOAP 1.2 is ok ? in sample i see 


2) Caching is supported in SWA? 



regards 
Yogesh 


"Thilina Gunarathne" <cs...@gmail.com> 
10/08/2007 01:22 PM 

Please respond to
axis-user@ws.apache.org


To
axis-user@ws.apache.org 
cc

Subject
Re: Axis2 SWA client communicating Axis2 MTOM service








> I have a web service running with AXIS2 with MTOM and I am trying to
> communicate it with  Axis2 Client with SWA enabled ( Soap with 
attachment).
> Is this possible to do ?
Nope.. Not if you are going to use the MTOM binding features, such as
automatic binding of bianry attachments to the XML tree... Things will
fail miserably if you r using data binding to generate the service
skeleton, as the message no longer conforms to the schema.

You can access the attachments using the attachments API..But then you
are essentially doing SwA in the server side.. Also you won't be able
to use data binding.

>
> Reason I need to do it as  I am using ALSB 2.6   in between which does 
not
> support MTOM.
>
> If yes  Can any one tell me what is wrong in this SOAP response received 
at
> client. It fails with ClassCastException at client side.   I am having
> problem at client side .
Looking at the source you pasted below, you seems to be using data
binding together with a WSDL which has base64Binary in it. Your
response is SwA, which does not conforms to the data bounded schema.
Also the response message is broken, as it's header tells that it's
SwA, but the body has XOP:include.

Mixing SwA with MTOM when data binding is used is not a good idea..

thanks,
Thilina

>I tried to debug found It try to cast
> getBuilder() to
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder
> which is not in actually for my binaryData node.
> I am finding difficult why  it try to use MTOMstax event I enabled only 
SWA
> at client side.  If you can make anything out of SOAP message what is 
wrong
> let me know.
>
> My Stub setting
> EMISEPServiceStub serviceStub = new
> EMISEPServiceStub("http://localhost:8085/EMISProxyService");
>
> serviceStub._getServiceClient().getOptions().setProperty(
>         Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_FALSE);
> serviceStub._getServiceClient().getOptions().setProperty(
>
> Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
>
>
>
> SOAP message response
>
> HTTP/1.1 200 OK
> Date: Mon, 08 Oct 2007 14:32:13 GMT
> Transfer-Encoding: chunked
> Content-Type: multipart/related; type="application/soap+xml";
>
> start="0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org";
>         boundary=MIME_Boundary; charset=UTF-8
> X-Powered-By: Servlet/2.4 JSP/2.0
>
> 0670
> --MIME_Boundary
> Content-ID:
> 0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org
> Content-Type: application/soap+xml; charset=utf-8
> Content-Transfer-Encoding: 8bit
>
> <?xml version='1.0' encoding='utf-8'?>
>    <soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>       <soapenv:Body>
>          <ns1:getFileResponse
> xmlns:ns1="http://mizuho.com/emis/ep/paraminfo">
>             <ns1:method>getFile</ns1:method>
>             <ns1:parameters>
>                <ns1:FileDataInfo>
>
> <ns1:fileExtension>txt</ns1:fileExtension>
>
> <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
>                   <ns1:fileName>test</ns1:fileName>
>                   <ns1:folderName>c:\TEMP</ns1:folderName>
>                   <ns1:scriptName>*</ns1:scriptName>
>                   <ns1:attachment>
>                      <ns1:size>1231</ns1:size>
>                      <ns1:checksum>1231</ns1:checksum>
>                   </ns1:attachment>
>                </ns1:FileDataInfo>
>             </ns1:parameters>
>             <ns1:response>
>                <ns1:attachment>
>                   <ns1:binaryNode>
>                      <xop:Include
> href="cid:1.urn:uuid:A892DC0EC609F508D61191853934041@apache.org"
> xmlns:xop="http://www.w3.org/2004/08/xop/include" />
>                   </ns1:binaryNode>
>                   <ns1:size>121</ns1:size>
>                   <ns1:checksum>121</ns1:checksum>
>                </ns1:attachment>
>
> <ns1:responseStatus>true</ns1:responseStatus>
>                <ns1:hasAttachment>true</ns1:hasAttachment>
>             </ns1:response>
>             <ns1:EPInfo>
>                <ns1:node>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:node>
>                <ns1:system>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:system>
>             </ns1:EPInfo>
>             <ns1:currentInterface>
>                <ns1:name>sdfa</ns1:name>
>                <ns1:id>12</ns1:id>
>             </ns1:currentInterface>
>          </ns1:getFileResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>--MIME_BoundaryContent-Type:
> text/plainContent-Transfer-Encoding: binaryContent-ID:
>
> <1....@apache.org>Test
> Data created by 12:00 at 10/4/2007  to test attachment at
> ALSB0015--MIME_Boundary--0000
>
>
> Exception stack trace.  I am getting.
> java.lang.ClassCastException:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$Base64Binary$Factory.parse(EMISEPServiceStub.java:2228)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$Attachment$Factory.parse(EMISEPServiceStub.java:6121)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$ResponseData$Factory.parse(EMISEPServiceStub.java:3595)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$CommandInfo$Factory.parse(EMISEPServiceStub.java:4698)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$GetFileResponse$Factory.parse(EMISEPServiceStub.java:4003)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1684)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>         at
> 
com.mizuho.yogesh.WebServiceControlImpl.getFile(WebServiceControlImpl.java:89)
>         at
> 
com.mizuho.yogesh.NoWeblogic.webServiceControlGetFile(NoWeblogic.java:80)
>         at
> com.mizuho.yogesh.NoWeblogic.main(NoWeblogic.java:42)
> org.apache.axis2.AxisFault:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1752)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>
>
> Thanks
>
> Regards
> Yogesh Dhake
>
> 
======================================================================================================
>  This transmittal and any attachments may contain confidential, 
privileged
> or sensitive information and is solely for the use of the intended
> recipient. If you are not the intended recipient, you are hereby 
notified
> that you have received this transmittal and any attachments in error and 
any
> review, dissemination, distribution or copying thereof is strictly
> prohibited. If you have received this transmittal and any attachments in
> error please notify the sender and immediately destroy the message and 
all
> its attachments. Any opinions herein expressed may be those of the 
author
> and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate 
Bank
> (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho
> Financial Group ("Mizuho"). Mizuho accepts no responsibility for the
> accuracy or completeness of any information herein contained.
>  E-Mail received by or sent from officer of Mizuho Securities USA Inc.
> (which is a registered U.S. broker-dealer and the entity through which
> Mizuho generally conducts its investment banking, capital markets, and
> securities business in the United States) is electronically archived and
> recorded and is subject to review and monitoring by and/or disclosure to
> persons other than the recipient, including (but not limited to) Mizuho
> Securities USA Inc. supervisory personnel. Such communications may be
> produced to regulatory authorities or others with legal rights to the
> information.


-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



Re: Axis2 SWA client communicating Axis2 MTOM service

Posted by Yo...@mizuhocbus.com.
Hi 
Thanks for insight 
Sorry but two small question. 
1) For enabling SWA do  i need to do any changes on service code or
Just changing axis conf file is ok
  <parameter name="enableMTOM" locked="false">false</parameter>
  <parameter name="enableSwA" locked="false">true</parameter>

As I see in SWA sample I see usage of MessageContext Variable and usage of 
OMelement variables/SenderClient at client side.In my case we really don't 
use them. or it will be transparent to me if I use stub client.

2) Is use of SOAP 1.2 is ok ? in sample i see 


2) Caching is supported in SWA?



regards
Yogesh 



"Thilina Gunarathne" <cs...@gmail.com> 
10/08/2007 01:22 PM
Please respond to
axis-user@ws.apache.org


To
axis-user@ws.apache.org
cc

Subject
Re: Axis2 SWA client communicating Axis2 MTOM service






> I have a web service running with AXIS2 with MTOM and I am trying to
> communicate it with  Axis2 Client with SWA enabled ( Soap with 
attachment).
> Is this possible to do ?
Nope.. Not if you are going to use the MTOM binding features, such as
automatic binding of bianry attachments to the XML tree... Things will
fail miserably if you r using data binding to generate the service
skeleton, as the message no longer conforms to the schema.

You can access the attachments using the attachments API..But then you
are essentially doing SwA in the server side.. Also you won't be able
to use data binding.

>
> Reason I need to do it as  I am using ALSB 2.6   in between which does 
not
> support MTOM.
>
> If yes  Can any one tell me what is wrong in this SOAP response received 
at
> client. It fails with ClassCastException at client side.   I am having
> problem at client side .
Looking at the source you pasted below, you seems to be using data
binding together with a WSDL which has base64Binary in it. Your
response is SwA, which does not conforms to the data bounded schema.
Also the response message is broken, as it's header tells that it's
SwA, but the body has XOP:include.

Mixing SwA with MTOM when data binding is used is not a good idea..

thanks,
Thilina

>I tried to debug found It try to cast
> getBuilder() to
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder
> which is not in actually for my binaryData node.
> I am finding difficult why  it try to use MTOMstax event I enabled only 
SWA
> at client side.  If you can make anything out of SOAP message what is 
wrong
> let me know.
>
> My Stub setting
> EMISEPServiceStub serviceStub = new
> EMISEPServiceStub("http://localhost:8085/EMISProxyService");
>
> serviceStub._getServiceClient().getOptions().setProperty(
>         Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_FALSE);
> serviceStub._getServiceClient().getOptions().setProperty(
>
> Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
>
>
>
> SOAP message response
>
> HTTP/1.1 200 OK
> Date: Mon, 08 Oct 2007 14:32:13 GMT
> Transfer-Encoding: chunked
> Content-Type: multipart/related; type="application/soap+xml";
>
> start="0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org";
>         boundary=MIME_Boundary; charset=UTF-8
> X-Powered-By: Servlet/2.4 JSP/2.0
>
> 0670
> --MIME_Boundary
> Content-ID:
> 0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org
> Content-Type: application/soap+xml; charset=utf-8
> Content-Transfer-Encoding: 8bit
>
> <?xml version='1.0' encoding='utf-8'?>
>    <soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>       <soapenv:Body>
>          <ns1:getFileResponse
> xmlns:ns1="http://mizuho.com/emis/ep/paraminfo">
>             <ns1:method>getFile</ns1:method>
>             <ns1:parameters>
>                <ns1:FileDataInfo>
>
> <ns1:fileExtension>txt</ns1:fileExtension>
>
> <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
>                   <ns1:fileName>test</ns1:fileName>
>                   <ns1:folderName>c:\TEMP</ns1:folderName>
>                   <ns1:scriptName>*</ns1:scriptName>
>                   <ns1:attachment>
>                      <ns1:size>1231</ns1:size>
>                      <ns1:checksum>1231</ns1:checksum>
>                   </ns1:attachment>
>                </ns1:FileDataInfo>
>             </ns1:parameters>
>             <ns1:response>
>                <ns1:attachment>
>                   <ns1:binaryNode>
>                      <xop:Include
> href="cid:1.urn:uuid:A892DC0EC609F508D61191853934041@apache.org"
> xmlns:xop="http://www.w3.org/2004/08/xop/include" />
>                   </ns1:binaryNode>
>                   <ns1:size>121</ns1:size>
>                   <ns1:checksum>121</ns1:checksum>
>                </ns1:attachment>
>
> <ns1:responseStatus>true</ns1:responseStatus>
>                <ns1:hasAttachment>true</ns1:hasAttachment>
>             </ns1:response>
>             <ns1:EPInfo>
>                <ns1:node>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:node>
>                <ns1:system>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:system>
>             </ns1:EPInfo>
>             <ns1:currentInterface>
>                <ns1:name>sdfa</ns1:name>
>                <ns1:id>12</ns1:id>
>             </ns1:currentInterface>
>          </ns1:getFileResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>--MIME_BoundaryContent-Type:
> text/plainContent-Transfer-Encoding: binaryContent-ID:
>
> <1....@apache.org>Test
> Data created by 12:00 at 10/4/2007  to test attachment at
> ALSB0015--MIME_Boundary--0000
>
>
> Exception stack trace.  I am getting.
> java.lang.ClassCastException:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$Base64Binary$Factory.parse(EMISEPServiceStub.java:2228)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$Attachment$Factory.parse(EMISEPServiceStub.java:6121)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$ResponseData$Factory.parse(EMISEPServiceStub.java:3595)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$CommandInfo$Factory.parse(EMISEPServiceStub.java:4698)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub$GetFileResponse$Factory.parse(EMISEPServiceStub.java:4003)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1684)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>         at
> 
com.mizuho.yogesh.WebServiceControlImpl.getFile(WebServiceControlImpl.java:89)
>         at
> 
com.mizuho.yogesh.NoWeblogic.webServiceControlGetFile(NoWeblogic.java:80)
>         at
> com.mizuho.yogesh.NoWeblogic.main(NoWeblogic.java:42)
> org.apache.axis2.AxisFault:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1752)
>         at
> 
com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>
>
> Thanks
>
> Regards
> Yogesh Dhake
>
> 
======================================================================================================
>  This transmittal and any attachments may contain confidential, 
privileged
> or sensitive information and is solely for the use of the intended
> recipient. If you are not the intended recipient, you are hereby 
notified
> that you have received this transmittal and any attachments in error and 
any
> review, dissemination, distribution or copying thereof is strictly
> prohibited. If you have received this transmittal and any attachments in
> error please notify the sender and immediately destroy the message and 
all
> its attachments. Any opinions herein expressed may be those of the 
author
> and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate 
Bank
> (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho
> Financial Group ("Mizuho"). Mizuho accepts no responsibility for the
> accuracy or completeness of any information herein contained.
>  E-Mail received by or sent from officer of Mizuho Securities USA Inc.
> (which is a registered U.S. broker-dealer and the entity through which
> Mizuho generally conducts its investment banking, capital markets, and
> securities business in the United States) is electronically archived and
> recorded and is subject to review and monitoring by and/or disclosure to
> persons other than the recipient, including (but not limited to) Mizuho
> Securities USA Inc. supervisory personnel. Such communications may be
> produced to regulatory authorities or others with legal rights to the
> information.


-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



Re: Axis2 SWA client communicating Axis2 MTOM service

Posted by Thilina Gunarathne <cs...@gmail.com>.
> I have a web service running with AXIS2 with MTOM and I am trying to
> communicate it with  Axis2 Client with SWA enabled ( Soap with attachment).
> Is this possible to do ?
Nope.. Not if you are going to use the MTOM binding features, such as
automatic binding of bianry attachments to the XML tree... Things will
fail miserably if you r using data binding to generate the service
skeleton, as the message no longer conforms to the schema.

You can access the attachments using the attachments API..But then you
are essentially doing SwA in the server side.. Also you won't be able
to use data binding.

>
> Reason I need to do it as  I am using ALSB 2.6   in between which does not
> support MTOM.
>
> If yes  Can any one tell me what is wrong in this SOAP response received at
> client. It fails with ClassCastException at client side.   I am having
> problem at client side .
Looking at the source you pasted below, you seems to be using data
binding together with a WSDL which has base64Binary in it. Your
response is SwA, which does not conforms to the data bounded schema.
Also the response message is broken, as it's header tells that it's
SwA, but the body has XOP:include.

Mixing SwA with MTOM when data binding is used is not a good idea..

thanks,
Thilina

>I tried to debug found It try to cast
> getBuilder() to
> org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder
> which is not in actually for my binaryData node.
> I am finding difficult why  it try to use MTOMstax event I enabled only SWA
> at client side.  If you can make anything out of SOAP message what is wrong
> let me know.
>
> My Stub setting
> EMISEPServiceStub serviceStub = new
> EMISEPServiceStub("http://localhost:8085/EMISProxyService");
>
> serviceStub._getServiceClient().getOptions().setProperty(
>         Constants.Configuration.ENABLE_MTOM,
> Constants.VALUE_FALSE);
> serviceStub._getServiceClient().getOptions().setProperty(
>
> Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);
>
>
>
> SOAP message response
>
> HTTP/1.1 200 OK
> Date: Mon, 08 Oct 2007 14:32:13 GMT
> Transfer-Encoding: chunked
> Content-Type: multipart/related; type="application/soap+xml";
>
> start="0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org";
>         boundary=MIME_Boundary; charset=UTF-8
> X-Powered-By: Servlet/2.4 JSP/2.0
>
> 0670
> --MIME_Boundary
> Content-ID:
> 0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org
> Content-Type: application/soap+xml; charset=utf-8
> Content-Transfer-Encoding: 8bit
>
> <?xml version='1.0' encoding='utf-8'?>
>    <soapenv:Envelope
> xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>       <soapenv:Body>
>          <ns1:getFileResponse
> xmlns:ns1="http://mizuho.com/emis/ep/paraminfo">
>             <ns1:method>getFile</ns1:method>
>             <ns1:parameters>
>                <ns1:FileDataInfo>
>
> <ns1:fileExtension>txt</ns1:fileExtension>
>
> <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
>                   <ns1:fileName>test</ns1:fileName>
>                   <ns1:folderName>c:\TEMP</ns1:folderName>
>                   <ns1:scriptName>*</ns1:scriptName>
>                   <ns1:attachment>
>                      <ns1:size>1231</ns1:size>
>                      <ns1:checksum>1231</ns1:checksum>
>                   </ns1:attachment>
>                </ns1:FileDataInfo>
>             </ns1:parameters>
>             <ns1:response>
>                <ns1:attachment>
>                   <ns1:binaryNode>
>                      <xop:Include
> href="cid:1.urn:uuid:A892DC0EC609F508D61191853934041@apache.org"
> xmlns:xop="http://www.w3.org/2004/08/xop/include" />
>                   </ns1:binaryNode>
>                   <ns1:size>121</ns1:size>
>                   <ns1:checksum>121</ns1:checksum>
>                </ns1:attachment>
>
> <ns1:responseStatus>true</ns1:responseStatus>
>                <ns1:hasAttachment>true</ns1:hasAttachment>
>             </ns1:response>
>             <ns1:EPInfo>
>                <ns1:node>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:node>
>                <ns1:system>
>                   <ns1:name>sasdf</ns1:name>
>                   <ns1:id>12</ns1:id>
>                </ns1:system>
>             </ns1:EPInfo>
>             <ns1:currentInterface>
>                <ns1:name>sdfa</ns1:name>
>                <ns1:id>12</ns1:id>
>             </ns1:currentInterface>
>          </ns1:getFileResponse>
>       </soapenv:Body>
>    </soapenv:Envelope>--MIME_BoundaryContent-Type:
> text/plainContent-Transfer-Encoding: binaryContent-ID:
>
> <1....@apache.org>Test
> Data created by 12:00 at 10/4/2007  to test attachment at
> ALSB0015--MIME_Boundary--0000
>
>
> Exception stack trace.  I am getting.
> java.lang.ClassCastException:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> com.mizuho.emis.ep.EMISEPServiceStub$Base64Binary$Factory.parse(EMISEPServiceStub.java:2228)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub$Attachment$Factory.parse(EMISEPServiceStub.java:6121)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub$ResponseData$Factory.parse(EMISEPServiceStub.java:3595)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub$CommandInfo$Factory.parse(EMISEPServiceStub.java:4698)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub$GetFileResponse$Factory.parse(EMISEPServiceStub.java:4003)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1684)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>         at
> com.mizuho.yogesh.WebServiceControlImpl.getFile(WebServiceControlImpl.java:89)
>         at
> com.mizuho.yogesh.NoWeblogic.webServiceControlGetFile(NoWeblogic.java:80)
>         at
> com.mizuho.yogesh.NoWeblogic.main(NoWeblogic.java:42)
> org.apache.axis2.AxisFault:
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
>         at
> org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.fromOM(EMISEPServiceStub.java:1752)
>         at
> com.mizuho.emis.ep.EMISEPServiceStub.getFile(EMISEPServiceStub.java:1221)
>
>
> Thanks
>
> Regards
> Yogesh Dhake
>
> ======================================================================================================
>  This transmittal and any attachments may contain confidential, privileged
> or sensitive information and is solely for the use of the intended
> recipient. If you are not the intended recipient, you are hereby notified
> that you have received this transmittal and any attachments in error and any
> review, dissemination, distribution or copying thereof is strictly
> prohibited. If you have received this transmittal and any attachments in
> error please notify the sender and immediately destroy the message and all
> its attachments. Any opinions herein expressed may be those of the author
> and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate Bank
> (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho
> Financial Group ("Mizuho"). Mizuho accepts no responsibility for the
> accuracy or completeness of any information herein contained.
>  E-Mail received by or sent from officer of Mizuho Securities USA Inc.
> (which is a registered U.S. broker-dealer and the entity through which
> Mizuho generally conducts its investment banking, capital markets, and
> securities business in the United States) is electronically archived and
> recorded and is subject to review and monitoring by and/or disclosure to
> persons other than the recipient, including (but not limited to) Mizuho
> Securities USA Inc. supervisory personnel. Such communications may be
> produced to regulatory authorities or others with legal rights to the
> information.


-- 
Thilina Gunarathne  - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Axis2 SWA client communicating Axis2 MTOM service

Posted by Yo...@mizuhocbus.com.
Hi 

I have a web service running with AXIS2 with MTOM and I am trying to 
communicate it with  Axis2 Client with SWA enabled ( Soap with 
attachment).  Is this possible to do ?

Reason I need to do it as  I am using ALSB 2.6   in between which does not 
support MTOM.

If yes  Can any one tell me what is wrong in this SOAP response received 
at client. It fails with ClassCastException at client side.   I am having 
problem at client side .  I tried to debug found It try to cast 
getBuilder() to 
org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder which is not 
in actually for my binaryData node.
I am finding difficult why  it try to use MTOMstax event I enabled only 
SWA at client side.  If you can make anything out of SOAP message what is 
wrong let me know.

My Stub setting
EMISEPServiceStub serviceStub = new 
EMISEPServiceStub("http://localhost:8085/EMISProxyService");

serviceStub._getServiceClient().getOptions().setProperty(
        Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
serviceStub._getServiceClient().getOptions().setProperty(
 Constants.Configuration.ENABLE_SWA, Constants.VALUE_TRUE);



SOAP message response 

HTTP/1.1 200 OK
Date: Mon, 08 Oct 2007 14:32:13 GMT
Transfer-Encoding: chunked
Content-Type: multipart/related; type="application/soap+xml"; 
        start="0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org"; 
        boundary=MIME_Boundary; charset=UTF-8
X-Powered-By: Servlet/2.4 JSP/2.0

0670
--MIME_Boundary
Content-ID: 0.urn:uuid:A892DC0EC609F508D61191853934040@apache.org
Content-Type: application/soap+xml; charset=utf-8
Content-Transfer-Encoding: 8bit

<?xml version='1.0' encoding='utf-8'?>
   <soapenv:Envelope 
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
      <soapenv:Body>
         <ns1:getFileResponse 
xmlns:ns1="http://mizuho.com/emis/ep/paraminfo">
            <ns1:method>getFile</ns1:method>
            <ns1:parameters>
               <ns1:FileDataInfo>
                  <ns1:fileExtension>txt</ns1:fileExtension>
                  <ns1:wildCardIndicator>N</ns1:wildCardIndicator>
                  <ns1:fileName>test</ns1:fileName>
                  <ns1:folderName>c:\TEMP</ns1:folderName>
                  <ns1:scriptName>*</ns1:scriptName>
                  <ns1:attachment>
                     <ns1:size>1231</ns1:size>
                     <ns1:checksum>1231</ns1:checksum>
                  </ns1:attachment>
               </ns1:FileDataInfo>
            </ns1:parameters>
            <ns1:response>
               <ns1:attachment>
                  <ns1:binaryNode>
                     <xop:Include 
href="cid:1.urn:uuid:A892DC0EC609F508D61191853934041@apache.org" 
xmlns:xop="http://www.w3.org/2004/08/xop/include" />
                  </ns1:binaryNode>
                  <ns1:size>121</ns1:size>
                  <ns1:checksum>121</ns1:checksum>
               </ns1:attachment>
               <ns1:responseStatus>true</ns1:responseStatus>
               <ns1:hasAttachment>true</ns1:hasAttachment>
            </ns1:response>
            <ns1:EPInfo>
               <ns1:node>
                  <ns1:name>sasdf</ns1:name>
                  <ns1:id>12</ns1:id>
               </ns1:node>
               <ns1:system>
                  <ns1:name>sasdf</ns1:name>
                  <ns1:id>12</ns1:id>
               </ns1:system>
            </ns1:EPInfo>
            <ns1:currentInterface>
               <ns1:name>sdfa</ns1:name>
               <ns1:id>12</ns1:id>
            </ns1:currentInterface>
         </ns1:getFileResponse>
      </soapenv:Body>
   </soapenv:Envelope>--MIME_BoundaryContent-Type: 
text/plainContent-Transfer-Encoding: binaryContent-ID: 
   <1....@apache.org>Test Data 
created by 12:00 at 10/4/2007  to test attachment at 
ALSB0015--MIME_Boundary--0000


Exception stack trace.  I am getting.
java.lang.ClassCastException: 
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
        at 
com.mizuho.emis.ep.EMISEPServiceStub$Base64Binary$Factory.parse(
EMISEPServiceStub.java:2228)
        at com.mizuho.emis.ep.EMISEPServiceStub$Attachment$Factory.parse(
EMISEPServiceStub.java:6121)
        at 
com.mizuho.emis.ep.EMISEPServiceStub$ResponseData$Factory.parse(
EMISEPServiceStub.java:3595)
        at com.mizuho.emis.ep.EMISEPServiceStub$CommandInfo$Factory.parse(
EMISEPServiceStub.java:4698)
        at 
com.mizuho.emis.ep.EMISEPServiceStub$GetFileResponse$Factory.parse(
EMISEPServiceStub.java:4003)
        at com.mizuho.emis.ep.EMISEPServiceStub.fromOM(
EMISEPServiceStub.java:1684)
        at com.mizuho.emis.ep.EMISEPServiceStub.getFile(
EMISEPServiceStub.java:1221)
        at com.mizuho.yogesh.WebServiceControlImpl.getFile(
WebServiceControlImpl.java:89)
        at com.mizuho.yogesh.NoWeblogic.webServiceControlGetFile(
NoWeblogic.java:80)
        at com.mizuho.yogesh.NoWeblogic.main(NoWeblogic.java:42)
org.apache.axis2.AxisFault: 
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
        at com.mizuho.emis.ep.EMISEPServiceStub.fromOM(
EMISEPServiceStub.java:1752)
        at com.mizuho.emis.ep.EMISEPServiceStub.getFile(
EMISEPServiceStub.java:1221)


Thanks 

Regards
Yogesh Dhake
======================================================================================================
This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that you have received this transmittal and any attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd., Mizuho Corporate Bank (USA), Mizuho Securities USA Inc. or any other affiliates of Mizuho Financial Group (”Mizuho”). Mizuho accepts no responsibility for the accuracy or completeness of any information herein contained.
E-Mail received by or sent from officer of Mizuho Securities USA Inc. (which is a registered U.S. broker-dealer and the entity through which Mizuho generally conducts its investment banking, capital markets, and securities business in the United States) is electronically archived and recorded and is subject to review and monitoring by and/or disclosure to persons other than the recipient, including (but not limited to) Mizuho Securities USA Inc. supervisory personnel.  Such communications may be produced to regulatory authorities or others with legal rights to the information.