Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 45393 invoked from network); 2 Nov 2007 16:34:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2007 16:34:52 -0000 Received: (qmail 88875 invoked by uid 500); 2 Nov 2007 16:34:02 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 88857 invoked by uid 500); 2 Nov 2007 16:34:02 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 88839 invoked by uid 99); 2 Nov 2007 16:34:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 09:34:02 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [156.80.1.71] (HELO mclniron01-ext.bah.com) (156.80.1.71) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 16:34:03 +0000 x-SBRS: None X-REMOTE-IP: 156.80.7.152 X-IronPort-AV: E=Sophos;i="4.21,363,1188792000"; d="scan'208,217";a="289149296" Received: from bahmail.bah.com (HELO mclnexbh02.resource.ds.bah.com) ([156.80.7.152]) by mclniron01-int.bah.com with ESMTP; 02 Nov 2007 12:33:41 -0400 Received: from MCLNEXVS11.resource.ds.bah.com ([156.80.7.215]) by mclnexbh02.resource.ds.bah.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 2 Nov 2007 12:33:44 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C81D6E.231A42FF" Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) Date: Fri, 2 Nov 2007 12:33:29 -0400 Message-ID: <182BAD95D204CA409A7C088D9E5D96BC01F26BEF@MCLNEXVS11.resource.ds.bah.com> In-Reply-To: <8B0552BD5078074B87F6DC3A7EAB76EB035C3337@MSGMROCLS2WIN.DMN1.FMR.COM> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: CXF Mtom service and Axis2 Axiom client (FIX) Thread-Index: AcgdWUqeTMyUt4CmQZizIvuqRyq7CAAAJWFgAADBg/AAARkc8AAA1QnAAAB9aIAAAca4gA== From: "Barlotta, Michael [USA]" To: X-OriginalArrivalTime: 02 Nov 2007 16:33:44.0976 (UTC) FILETIME=[22EF1100:01C81D6E] X-Virus-Checked: Checked by ClamAV on apache.org ------_=_NextPart_001_01C81D6E.231A42FF Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable FYI: =20 I finally got it working. turns out it is a classpath issue. I have CXF and Axis2 in the same eclipse project and Java WS clients written with both frameworks. =20 I moved the Axis2 WS Client to its own project and now it works.=20 =20 I am not sure why when the CXF and JAR dependencies and Axis2 and JAR dependencies are in the classpath that the behavior results in "hanging" the Axis2 client but that seemed to be the case.=20 =20 Mike Barlotta Associate Booz | Allen | Hamilton =20 ________________________________ From: Walker, Jeff [mailto:Jeff.Walker@fmr.com]=20 Sent: Friday, November 02, 2007 12:03 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Then I leave you with the problem Mike, since I am not an Axis2 guru. Final suggestions:=20 1. Build a CXF client. Does the problem still exist? (I'd do this first to prove the CXF service is behaving properly as an MTOM server). 2. Then debug the Axis2 client src to see if it behaves the same way as the CXF client. 3. There is a CXF mailing list. They might be able to help. Regards, -jeff ________________________________ From: Barlotta, Michael [USA] [mailto:barlotta_michael@bah.com]=20 Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client =09 =09 Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug.=20 I have used the image (2kb) with CXF client through tcpmon w/o issues.=20 =20 I am using the tcpmon that comes with Axis1 version 1.4 =20 Mike Barlotta Associate Booz | Allen | Hamilton =20 ________________________________ From: Walker, Jeff [mailto:Jeff.Walker@fmr.com]=20 Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client =09 =09 I don't know the exact answer to your question, but a previous poster ( few days back) hinted at the fact that Apache's older tcpmon is not always an effective tool to use to debug an MTOM service. I think it was because tcpmon has limited buffering capabilities. (It might not be passing the complete stream back to your Axis2 client). Suggest if you wish to continue using tcpmon with MTOM, make the attachment very small to help out tcpmon. =20 (Where did you get tcpmon from? I use the older Axis 1.4 and that has tcpmon, but I don't think Axis2 has tcpmon in its distribution, does it? Try using Axis2's soapmonitor, you might have better luck). -jeff =20 ________________________________ From: Barlotta, Michael [USA] [mailto:barlotta_michael@bah.com]=20 Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client =09 =09 I have written a simple CXF WebService using MTOM as a proof of concept for future work. I have successfully written a CXF WS client, however I am now writing an Axis2 WS client and am having some trouble and was hoping someone could give some pointers. I am using Java 1.5, Axis2 1.3, and CXF 2.0.2 =20 I am using TCPMON to watch the SOAP requests and responses=20 Axis2 --> TCPMON --> CXF Service =20 and here is what seems to be happening... The request and response are successfully made (I see them both in TCPMON and both are using MIME/MTOM). The Axis2 client (running as a Junit test in eclipse) hangs and CPU spikes to 100% The State in TCPMON is Req and does not get set to Done =20 Let me know if any other information would be helpful =20 Here is my Axis2 client =20 =09 protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory =3D OMAbstractFactory.getOMFactory(); OMNamespace namespace =3D factory.createOMNamespace("http://hello.bah.com/", "ns1"); OMElement root =3D factory.createOMElement("sayHello", namespace); =20 OMElement arg0 =3D factory.createOMElement("arg0", null); root.addChild(arg0); =20 OMElement name =3D factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); =20 InputStream is =3D IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds =3D new ByteArrayDataSource(baos.toByteArray(),"content/type"); DataHandler dh =3D new DataHandler(ds); OMText binaryData =3D factory.createOMText(dh, true); =20 OMElement bd =3D factory.createOMElement("binaryData", null); bd.addChild(binaryData); arg0.addChild(bd); return root; } =20 =09 public void test_WS_sayHello(){ try { ServiceClient sc =3D new ServiceClient(); Options opts =3D new Options(); opts.setTo(new EndpointReference(SERVICE_ADDRESS)); =09 opts.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); sc.setOptions(opts); =20 OMElement requestElement =3D this.createPayload_SayHello("Axis2"); OMElement responseElement =3D sc.sendReceive(requestElement); System.out.println("Response: " + responseElement); =20 assertNotNull(responseElement); =09 assertEquals("sayHelloResponse",responseElement.getLocalName()); OMElement returnElement =3D responseElement.getFirstElement(); assertNotNull(returnElement); =09 assertEquals("return",returnElement.getLocalName()); =20 String responseXml =3D returnElement.getText(); assertNotNull(responseXml); assertEquals("Hello Axis2",responseXml); }=20 catch (AxisFault e) { System.out.println(e.getMessage()); fail("Unexpected AxisFault"); } catch (IOException e) { System.out.println(e.getMessage()); fail("Unexpected IOException"); } } } =20 TIA =20 Mike Barlotta Associate Booz | Allen | Hamilton =20 ------_=_NextPart_001_01C81D6E.231A42FF Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable
FYI:
 
I finally got it working. turns out it is a = classpath=20 issue.
I have CXF and Axis2 in the same eclipse = project and Java=20 WS clients written with both frameworks.
 
I moved the Axis2 WS Client to its own project = and now it=20 works.
 
I am not sure why when the CXF and JAR = dependencies and=20 Axis2 and JAR dependencies are in the classpath that the behavior = results in=20 "hanging" the Axis2 client but that seemed to be the case. =
 
Mike Barlotta
Associate
Booz | Allen | = Hamilton
 


From: Walker, Jeff = [mailto:Jeff.Walker@fmr.com]=20
Sent: Friday, November 02, 2007 12:03 PM
To:=20 axis-user@ws.apache.org
Subject: RE: CXF Mtom service and = Axis2 Axiom=20 client

Then I leave you with the problem Mike, since I = am not=20 an Axis2 guru.
Final suggestions:
1. Build a CXF client. Does the problem still = exist? (I'd=20 do this first to prove the CXF service is behaving properly as = an MTOM=20 server).
2. Then debug the Axis2 client src to see if it = behaves the=20 same way as the CXF client.
3. There is a CXF mailing list. They might be = able to=20 help.
Regards,
-jeff
=

From: Barlotta, Michael [USA]=20 [mailto:barlotta_michael@bah.com]
Sent: Friday, November = 02, 2007=20 11:28 AM
To: axis-user@ws.apache.org
Subject: RE: = CXF Mtom=20 service and Axis2 Axiom client

Thanks Jeff, the problem occurs with & = w/o tcpmon...=20 I am just using that to debug.
I have used the image (2kb) with CXF client = through=20 tcpmon w/o issues.
 
I am using the tcpmon that comes with Axis1 = version=20 1.4
 
Mike = Barlotta
Associate
Booz | Allen | = Hamilton
 


From: Walker, Jeff=20 [mailto:Jeff.Walker@fmr.com]
Sent: Friday, November 02, = 2007 11:13=20 AM
To: axis-user@ws.apache.org
Subject: RE: CXF = Mtom=20 service and Axis2 Axiom client

I don't know the exact answer to your=20 question,
but a=20 previous poster ( few days back) hinted at the fact that Apache's = older=20 tcpmon is not always an effective tool to use to debug an MTOM = service. I=20 think it was because tcpmon has limited buffering capabilities. (It = might not=20 be passing the complete stream back to your Axis2 client). = Suggest if you=20 wish to continue using tcpmon with MTOM, make the attachment very = small to=20 help out tcpmon.
 
(Where did you get tcpmon from? I use the = older Axis 1.4=20 and that has tcpmon, but I don't think Axis2 has tcpmon in its = distribution,=20 does it? Try using Axis2's soapmonitor, you might have better=20 luck).
-jeff
 

From: Barlotta, Michael [USA]=20 [mailto:barlotta_michael@bah.com]
Sent: Friday, November = 02, 2007=20 10:31 AM
To: axis-user@ws.apache.org
Subject: CXF = Mtom=20 service and Axis2 Axiom client

I have written a simple CXF WebService using MTOM as a = proof of=20 concept for future work.
I = have=20 successfully written a CXF WS client, however I am now writing an = Axis2 WS=20 client and am having some trouble and was hoping someone could give = some=20 pointers. I am using Java 1.5, Axis2 1.3, and CXF = 2.0.2
 
I = am using=20 TCPMON to watch the SOAP requests and responses
Axis2 -->=20 TCPMON --> CXF Service
 
and here is what=20 seems to be happening...
The request and=20 response are successfully made (I see them both in TCPMON and both = are using=20 MIME/MTOM).
The Axis2 client=20 (running as a Junit test in eclipse) hangs and CPU spikes to=20 100%
The State in=20 TCPMON is Req and does not get set to Done
 
Let me know if=20 any other information would be helpful
 
Here is my Axis2=20 client
 
protected OMElement =
createPayload_SayHello(String nameText) throws IOException{
OMFactory =
factory =3D OMAbstractFactory.getOMFactory();
OMNamespace =
namespace =3D factory.createOMNamespace("http://hello.bah.com/", =
"ns1");
OMElement root =3D factory.createOMElement("sayHello", =
namespace);
 
OMElement arg0 =3D =
factory.createOMElement("arg0", =
null);
root.addChild(arg0);
 
OMElemen=
t name =3D factory.createOMElement("name", =
null);
name.setText(nameText);
arg0.addChild(name);
 
InputStream is =3D =
IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif");
ByteArrayOutputStream baos =3D new =
ByteArrayOutputStream();
IOHelper.inputToOutput(is, =
baos);
DataSource ds =3D new =
ByteArrayDataSource(baos.toByteArray(),"content/type");
DataHan=
dler dh =3D new DataHandler(ds);
OMText binaryData =3D =
factory.createOMText(dh, true);
 
OMElement bd =
=3D factory.createOMElement("binaryData", =
null);
bd.addChild(binaryData);
arg0.addChild(bd);
return root;
}
 
public void test_WS_sayHello(){
try =
{
ServiceClient sc =3D new ServiceClient();
Options =
opts =3D new Options();
opts.setTo(new =
EndpointReference(SERVICE_ADDRESS));
opts.setProperty(Constants=
.Configuration.ENABLE_MTOM, =
Constants.VALUE_TRUE);
sc.setOptions(opts);
 
OMElement requestElement =3D =
this.createPayload_SayHello("Axis2");
OMElement =
responseElement =3D =
sc.sendReceive(requestElement);
System.out.println("Response: =
" + =
responseElement);
 
assertNotNull(responseElemen=
t);
assertEquals("sayHelloResponse",responseElement.getLocalNam=
e());
OMElement returnElement =3D =
responseElement.getFirstElement();
assertNotNull(returnElement)=
;
assertEquals("return",returnElement.getLocalName());
 
String responseXml =3D =
returnElement.getText();
assertNotNull(responseXml);
=
assertEquals("Hello Axis2",responseXml);
} 
catch =
(AxisFault e) =
{
System.out.println(e.getMessage());
fail("Unexpecte=
d AxisFault");
}
catch (IOException e) =
{
System.out.println(e.getMessage());
fail("Unexpecte=
d =
IOException");
}
}
}
 
TIA
 
Mike = Barlotta
Associate
Booz | Allen | = Hamilton
 
------_=_NextPart_001_01C81D6E.231A42FF--