Re: MTOM Support
Thanks Thilina. I am just printing the AXIOM message on the server. I was expecting to see the XOP include inside the SOAP body. Many thanks Meeraj On 11/3/07, Thilina Gunarathne <[EMAIL PROTECTED]> wrote: > > Hi, > I could not find any obvious mistakes in your code.. > > What is the tool you are using to trace the messages.. In case you are > using SOAPMonitor, it does not show attachments.. Try using TCPMON > (http://ws.apache.org/commons/tcpmon).. > > thanks, > Thilina > > On 11/2/07, Meeraj Kunnumpurath <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have been looking at wiriting a client using AXIOM for sending > > binary attachments. The code is shown below, > > > >public void testExchange() throws Exception { > > > >DataHandler dataHandler = new DataHandler(new FileDataSource(" > > Picture.jpg")); > > > >OMFactory fac = OMAbstractFactory.getOMFactory(); > > > >OMElement request = fac.createOMElement("data", null); > > > >OMText binaryData = fac.createOMText(dataHandler, true); > >binaryData.setOptimize(false); > > > >request.addChild(binaryData); > > > >OMElement method = fac.createOMElement("exchange", null); > >method.addChild(request); > > > >Options options = new Options(); > >options.setTo(new > > EndpointReference("http://localhost:8900/axis2/exchange";)); > > > > options.setProperty(Constants.Configuration.ENABLE_MTOM, > > Constants.VALUE_TRUE ); > > > >ServiceClient sender = new ServiceClient(); > >sender.setOptions(options); > > > >sender.sendReceive(method); > > > >} > > > > Unfortunately, the message is being sent to the server inlined without > > any mime parts. I have tried SWA instead of MTOM, but the same result. > > Any pointers would be highly appreciated. The message trace for > > request is shown below, > > > > > > > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > > > > > > /9j/4RBZRXhpZgA.38z/2Q== > > > > > > > > > > Kind regards > > Meeraj > > > > > -- > Thilina Gunarathne - http://thilinag.blogspot.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Java2wsdl :methods from super class/interface are not reflecting in WSDL
Hi, I am trying to generate wsdl from an interface using java2wsdl tool in Axis2 1.3, but it is not picking up method of the super interface. Though in Axis 1.4 it is quiet possible. I checked documentation, mail list for Axis2 users but could not find any solution as how to include super interface method in the WSDL. The Classes are of following format public Interface InterfaceA{ public void m1(); public void m2(); } public Interface InterfaceB extends InterfaceA{ } And I am trying to generate WSDL out of InterfaceB and want the method from InterfaceA to be there in WSDL Thanks in advance. -- Regards, -Shrish Mishra -- Regards, -Shrish Mishra
Re: BPEL, XSD, and WSDL Generation Libraries
Hi, You can generate the WSDL's and XSD's using java2WSDL as Anne mentioned.. I'm currently using the Eclipse BPEL editor (http://www.eclipse.org/bpel/) to design my processes.. It's still on Milestone versions, but proved useful to me.. One another alternative for your BPEL engine would be Apache ODE (http://ode.apache.org/)... ODE web service layer runs using Axis2.. thanks, Thilina On 11/2/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > You can use a WSDL generator, such as Axis2 java2wsdl, to generate > both a WSDL and embedded XSDs from your Java objects. You might also > consider using an XML binding framework, such as XMLbeans or JAXB, to > generate just the XSD files from your Java objects. (You can also use > a binding framework in conjunction with the WSDL generator.) > > I don't know of any tool that generates BPEL from Java -- that's not > what you would normally do -- you typically specify the process flow > using a modeling notation (UML, BPMN, etc) and generate the BPEL > execution script from the model. (i.e., you write the processing logic > in BPEL rather than in Java). I suggest you look at ActiveBPEL > (http://www.active-endpoints.com/active-bpel-engine-overview.htm) for > your BPEL engine. > > Anne > > On 11/2/07, Leif Singer <[EMAIL PROTECTED]> wrote: > > Hello, > > > > I know this is quite off-topic, but since the list I suppose would be > > most fitting for my question didn't respond at all, so I thought I'd > > give it a shot here. > > > > I have a model of a business process available as java objects. Out of > > this, I want to generate BPEL, WSDL, and XSD files. I have tried > > several libraries for these tasks: > > > > XSD: XmlSchema by Apache Commons, Eclipse's XSD library > > WSDL: WSDL4J > > BPEL: my own lacking implementation, planning to try Eclipse's BPEL > > library > > > > To make sure I'm understood, I need these libraries to > > - provide a mechanism to construct an object graph representing an XSD/ > > WSDL/BPEL file > > - be able to write this object graph to a file > > > > I also need them to read in existing files, but only for XSD and WSDL. > > > > My questions: > > > > 1. Can anyone recommend which libraries to use for these tasks? > > 2. Using XmlSchema from Apache Commons, I was able to build the > > structure just fine, but when trying to write it out, I only find an > > empty element -- is there anything tricky that I am > > obviously doing wrong and should know, e.g. setting a flag for each > > object that needs to be added or something like that? > > > > Again, sorry for the off-topic post, but I thought the audience of > > this list might contain some indiviuals who know these things. If > > someone can point me to the proper list where to ask this, I'd of > > course be interested, too. > > > > Thanks in advance > >Leif Singer > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MTOM Support
Hi, I could not find any obvious mistakes in your code.. What is the tool you are using to trace the messages.. In case you are using SOAPMonitor, it does not show attachments.. Try using TCPMON (http://ws.apache.org/commons/tcpmon).. thanks, Thilina On 11/2/07, Meeraj Kunnumpurath <[EMAIL PROTECTED]> wrote: > Hi, > > I have been looking at wiriting a client using AXIOM for sending > binary attachments. The code is shown below, > >public void testExchange() throws Exception { > >DataHandler dataHandler = new DataHandler(new FileDataSource(" > Picture.jpg")); > >OMFactory fac = OMAbstractFactory.getOMFactory(); > >OMElement request = fac.createOMElement("data", null); > >OMText binaryData = fac.createOMText(dataHandler, true); >binaryData.setOptimize(false); > >request.addChild(binaryData); > >OMElement method = fac.createOMElement("exchange", null); >method.addChild(request); > >Options options = new Options(); >options.setTo(new > EndpointReference("http://localhost:8900/axis2/exchange";)); > > options.setProperty(Constants.Configuration.ENABLE_MTOM, > Constants.VALUE_TRUE ); > >ServiceClient sender = new ServiceClient(); >sender.setOptions(options); > >sender.sendReceive(method); > >} > > Unfortunately, the message is being sent to the server inlined without > any mime parts. I have tried SWA instead of MTOM, but the same result. > Any pointers would be highly appreciated. The message trace for > request is shown below, > > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > > > /9j/4RBZRXhpZgA.38z/2Q== > > > > > Kind regards > Meeraj > -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BPEL, XSD, and WSDL Generation Libraries
You can use a WSDL generator, such as Axis2 java2wsdl, to generate both a WSDL and embedded XSDs from your Java objects. You might also consider using an XML binding framework, such as XMLbeans or JAXB, to generate just the XSD files from your Java objects. (You can also use a binding framework in conjunction with the WSDL generator.) I don't know of any tool that generates BPEL from Java -- that's not what you would normally do -- you typically specify the process flow using a modeling notation (UML, BPMN, etc) and generate the BPEL execution script from the model. (i.e., you write the processing logic in BPEL rather than in Java). I suggest you look at ActiveBPEL (http://www.active-endpoints.com/active-bpel-engine-overview.htm) for your BPEL engine. Anne On 11/2/07, Leif Singer <[EMAIL PROTECTED]> wrote: > Hello, > > I know this is quite off-topic, but since the list I suppose would be > most fitting for my question didn't respond at all, so I thought I'd > give it a shot here. > > I have a model of a business process available as java objects. Out of > this, I want to generate BPEL, WSDL, and XSD files. I have tried > several libraries for these tasks: > > XSD: XmlSchema by Apache Commons, Eclipse's XSD library > WSDL: WSDL4J > BPEL: my own lacking implementation, planning to try Eclipse's BPEL > library > > To make sure I'm understood, I need these libraries to > - provide a mechanism to construct an object graph representing an XSD/ > WSDL/BPEL file > - be able to write this object graph to a file > > I also need them to read in existing files, but only for XSD and WSDL. > > My questions: > > 1. Can anyone recommend which libraries to use for these tasks? > 2. Using XmlSchema from Apache Commons, I was able to build the > structure just fine, but when trying to write it out, I only find an > empty element -- is there anything tricky that I am > obviously doing wrong and should know, e.g. setting a flag for each > object that needs to be added or something like that? > > Again, sorry for the off-topic post, but I thought the audience of > this list might contain some indiviuals who know these things. If > someone can point me to the proper list where to ask this, I'd of > course be interested, too. > > Thanks in advance >Leif Singer > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis1/1.4 Client to MTOM WebService
You could try interfacing using SwA rather than MTOM. You would have to convert the WSDL to one that defines the attachment explicitly. Anne On 11/2/07, Barlotta, Michael [USA] <[EMAIL PROTECTED]> wrote: > Thanks Thilina, > > I thought I read MTOM support was added in Axis1... > > If I understand correctly I need to base64 encode the bytes that are > read from a file and pass that to the JAFDataHandlerSerializer. Right? > > What are my other options in Axis1 to get this to work given the WS > input required? > > Thanks again, > > Mike Barlotta > Associate > Booz | Allen | Hamilton > > -Original Message- > From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] > Sent: Friday, November 02, 2007 4:12 PM > To: axis-user@ws.apache.org > Subject: Re: Axis1/1.4 Client to MTOM WebService > > Hi, > I"m not sure about the level of support for MTOM in Axis 1.4.. IIRC DIms > added some basic support some time back.. > > Looking at your code, you seems to be trying to send the binary data > inline only.. You need to make sure to base64 encode the binary data > when putting them inline... > > But this approach will only work for smaller binary data only... > > > Serializer jafs = new JAFDataHandlerSerializer(); jafs.serialize(new > > QName("binaryData"), null, data.getBinaryData(), context); > Make sure to base64 encode the above data... > > ~Thilina > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Result Structure / wsdl file
Upgrade to Axis2. Anne On 11/2/07, Roman Schönbichler <[EMAIL PROTECTED]> wrote: > Hey guys! > > I'm trying to build a webservice which is used by a Flash (Flex) > Client. > > I've set up a running service, and client, but I've got some > problems with the xml which is returned by the server. > > The result (in Firefox) looks like: > > new > > > The Problem is, that the "return" word is reserved in Flex, and so the > client can't access the value of it. > I've changed the wsdl file to: > > > > type="xs:string"/> > > > > > expecting the returned xml file to look like: > > new > > > but it didn't work! I'm still getting the old "return" xml. > > Do I have to change something different to get the ouput changed? > I Would be glad to get some Ideas! > > Greets > Roman > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
migrating custom dispatch from Axis 1 to Axis 2
I have this scenario working in Axis 1, which I want to migrate to Axis2: 1. A class extending AxisServlet replaces AxisServlet to provide some additional initialization (via Servlet.init()). 2. There are two services deployed in server-config.wsdd, each using a java:MSG provider. Each of these services is handled by a specific provider plugin of mine, which is initialized in #1 above. The plugin determines from the request url which of an arbitrary set of web services that it implements should process a request that is dispatched to it (see #4). Similarly, it is also responsible for providing wsdl in response to http GET requests for urls pertinent to it ending with ?wsdl. 3. The http transport spec in server-config.wsdd has a custom class specified for the parameter qs:wsdl to handle ?wsdl requests and 4. a custom handler in the request flow for URL mapping. Each of these latter two does something special for requests with urls intended for the two MSG services, and has the default behavior otherwise. The special treatment is that a certain prefix part of the url specifies one of the two MSG services, and the rest specifies additional dispatching information handled by the plugin. This seems to be how to do the same thing in Axis2, with some questions: As there is still an AxisServlet, presumably there is a straightforward analog of #1. Presumably #2 is handled by creating service archive files which specify some kind of raw MessageReceiver (or perhaps an adaptation that uses Element rather than OMElement). The analog of #4 seems to be a custom RequestURIBasedDispatcher in the Transport phase and/or Dispatch phase of the Inflow phaseOrder and perhaps custom versions of its releated Service and Operation dispatchers. Should it be one of these phases or both? Regarding #3, this article http://www.developer.com/open/article.php/3589126 suggests that in Axis2 there isn't a way to customize the provision of wsdls in response to ?wsdl requests. It claims (and the source agrees with the claim) that wsdls are generated from the service implementation class unless there is a file in the META-INF directory of the service repository. Am I out of luck in attempting to hook the wsdl query process and provide wsdl descriptors from outside the META-INF directory? The only obvious way to do that I found would involve modifying the doGet method of AxisServlet in my extension class. Thanks for any help you can provide. Jeff Greif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: MTOM Support
Hi, I have been looking at wiriting a client using AXIOM for sending binary attachments. The code is shown below, public void testExchange() throws Exception { DataHandler dataHandler = new DataHandler(new FileDataSource(" Picture.jpg")); OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement request = fac.createOMElement("data", null); OMText binaryData = fac.createOMText(dataHandler, true); binaryData.setOptimize(false); request.addChild(binaryData); OMElement method = fac.createOMElement("exchange", null); method.addChild(request); Options options = new Options(); options.setTo(new EndpointReference(" http://localhost:8900/axis2/exchange";)); options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); ServiceClient sender = new ServiceClient(); sender.setOptions(options); sender.sendReceive(method); } Unfortunately, the message is being sent to the server inlined without any mime parts. I have tried SWA instead of MTOM, but the same result. Any pointers would be highly appreciated. The message trace for request is shown below, http://schemas.xmlsoap.org/soap/envelope/";> /9j/4RBZRXhpZgA.38z/2Q== Kind regards Meeraj
Re: CXF Mtom service and Axis2 Axiom client (FIX)
not sure what you mean by *painful* if you have a better algorithm which better identifies either version mismatching and or duplicate scenarios we should look at it Mike-- When you get a chance could you provide us a quick listing of the CXF Jars that caused the error I'm thinking we should update the AXIS FAQ.. Thanks Mike Martin - Original Message - From: Hu, Mary - ITG To: axis-user@ws.apache.org Sent: Friday, November 02, 2007 11:40 AM Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) I've just gone through those conflict jars issues. It was really painful in XML world. -- From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 12:33 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) FYI: 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. I moved the Axis2 WS Client to its own project and now it works. 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. Mike Barlotta Associate Booz | Allen | Hamilton -- From: Walker, Jeff [mailto:[EMAIL PROTECTED] 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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{OMFactory factory = OMAbstractFactory.getOMFactory();OMNamespace namespace = factory.createOMNamespac
RE: Axis1/1.4 Client to MTOM WebService
Thanks Thilina, I thought I read MTOM support was added in Axis1... If I understand correctly I need to base64 encode the bytes that are read from a file and pass that to the JAFDataHandlerSerializer. Right? What are my other options in Axis1 to get this to work given the WS input required? Thanks again, Mike Barlotta Associate Booz | Allen | Hamilton -Original Message- From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 4:12 PM To: axis-user@ws.apache.org Subject: Re: Axis1/1.4 Client to MTOM WebService Hi, I"m not sure about the level of support for MTOM in Axis 1.4.. IIRC DIms added some basic support some time back.. Looking at your code, you seems to be trying to send the binary data inline only.. You need to make sure to base64 encode the binary data when putting them inline... But this approach will only work for smaller binary data only... > Serializer jafs = new JAFDataHandlerSerializer(); jafs.serialize(new > QName("binaryData"), null, data.getBinaryData(), context); Make sure to base64 encode the above data... ~Thilina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis1/1.4 Client to MTOM WebService
Hi, I"m not sure about the level of support for MTOM in Axis 1.4.. IIRC DIms added some basic support some time back.. Looking at your code, you seems to be trying to send the binary data inline only.. You need to make sure to base64 encode the binary data when putting them inline... But this approach will only work for smaller binary data only... > Serializer jafs = new JAFDataHandlerSerializer(); > jafs.serialize(new QName("binaryData"), null, data.getBinaryData(), > context); Make sure to base64 encode the above data... ~Thilina On 11/2/07, Barlotta, Michael [USA] <[EMAIL PROTECTED]> wrote: > > > Looking for some guidance on Axis1 version 1.4 help building a WS Client > that can interact with a MTOM WebService. > > I am building the client using the Service and Call objects > The input to the service is a String and a Base64 encoded element - looks > like this > > > TEST > base64 stuff here > > > > I have successfully called the service with null binaryData but I get the > following error when I pass actual data. > > The output is the String sent back in a SOAP Fault > > Unmarshalling Error : null > > > In this example I have a class HelloWorldMtom (JavaBean) with a String and a > DataHandler attributes that I use as input. > HelloWorldMtom hwMtom = new HelloWorldMtom(); > hwMtom.setName(name); > hwMtom.setBinaryData(dh); > > > Here is the client code: > Service service = new Service(); > Call call = (Call) service.createCall(); > call.setTargetEndpointAddress(ADDRESS); > call.setOperationName(new QName(HELLO_NAMESPACE, "sayHello")); > call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS); > call.setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, > Call.ATTACHMENT_ENCAPSULATION_FORMAT_MTOM); > call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); > call.setReturnType(org.apache.axis.Constants.XSD_STRING); > call.setOperationStyle(Style.WRAPPED); > call.setOperationUse(Use.LITERAL); > QName qnameHelloMtom = new QName(HELLO_NAMESPACE, "helloMtom"); > call.registerTypeMapping(hwMtom.getClass(), qnameHelloMtom, new > HelloWorldMtomSerializerFactory(), new > BeanDeserializerFactory(hwMtom.getClass(), qnameHelloMtom)); > call.addParameter("arg0", qnameHelloMtom, ParameterMode.IN); > String ret = (String) call.invoke( new Object[] { hwMtom } ); > > I built a custom Serializer as follows: > public class HelloWorldMtomSerializer implements Serializer { > > public void serialize(QName name, Attributes attributes, Object value, > SerializationContext context) throws IOException { > > if (value!=null){ > > HelloWorldMtom data = (HelloWorldMtom)value; > context.startElement(new QName("arg0"), null); > context.serialize(new QName("name"), null, data.getName(), null, > Boolean.TRUE, Boolean.FALSE); > if (data.getBinaryData()!=null){ > Serializer jafs = new JAFDataHandlerSerializer(); > jafs.serialize(new QName("binaryData"), null, data.getBinaryData(), > context); > } > else { > > context.serialize(new QName("binaryData"), null, null, null, Boolean.TRUE, > Boolean.FALSE); > } > context.endElement(); > } > } > public String getMechanismType() { return Constants.AXIS_SAX; } > public Element writeSchema(Class javaType, Types types) throws Exception { > > return null; > } > } > > Am I on the right track? > > Thanks for any help with this. > > Note: > A CXF and an Axis2 WS client have already been successfully built against > this WS (I am testing interop with different Java SOAP stacks) > > Mike Barlotta > Associate > Booz | Allen | Hamilton > -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ExceptionInInitializerError when trying to create a new ServiceClient
Hi all, Has anyone seen this? It was working for me till I tried removing some of the jar files that are part of axis2. After that I added the removed ones back in and still get this error. I am using Axis2 1.3 and it is generating this error when trying to create a ServiceClient. Exception in thread "main" java.lang.ExceptionInInitializerError at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:564) at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilde r.java:96) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigB uilder.java:79) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(D eploymentEngine.java:615) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration( FileSystemConfigurator.java:115) at org.apache.axis2.context.ConfigurationContextFactory.createConfiguration Context(ConfigurationContextFactory.java:64) at org.apache.axis2.context.ConfigurationContextFactory.createConfiguration ContextFromFileSystem(ConfigurationContextFactory.java:180) at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClie nt.java:146) at org.apache.axis2.client.ServiceClient.(ServiceClient.java:139) at org.apache.axis2.client.ServiceClient.(ServiceClient.java:228) at com.bmc.arsys.ws.client.WebServiceSoapClient.call(WebServiceSoapClient.j ava:178) at com.bmc.arsys.ws.client.WebServiceSoapClient.getTestWS(WebServiceSoapCli ent.java:795) at com.bmc.arsys.ws.client.WebServiceSoapClient.main(WebServiceSoapClient.j ava:616) Caused by: java.lang.IllegalStateException: No valid ObjectCreator found. at org.apache.axiom.om.util.StAXUtils$Pool.(StAXUtils.java:64) at org.apache.axiom.om.util.StAXUtils.(StAXUtils.java:88) ... 13 more Any help is appreciated. Thanks -kumar
BPEL, XSD, and WSDL Generation Libraries
Hello, I know this is quite off-topic, but since the list I suppose would be most fitting for my question didn't respond at all, so I thought I'd give it a shot here. I have a model of a business process available as java objects. Out of this, I want to generate BPEL, WSDL, and XSD files. I have tried several libraries for these tasks: XSD: XmlSchema by Apache Commons, Eclipse's XSD library WSDL: WSDL4J BPEL: my own lacking implementation, planning to try Eclipse's BPEL library To make sure I'm understood, I need these libraries to - provide a mechanism to construct an object graph representing an XSD/ WSDL/BPEL file - be able to write this object graph to a file I also need them to read in existing files, but only for XSD and WSDL. My questions: 1. Can anyone recommend which libraries to use for these tasks? 2. Using XmlSchema from Apache Commons, I was able to build the structure just fine, but when trying to write it out, I only find an empty element -- is there anything tricky that I am obviously doing wrong and should know, e.g. setting a flag for each object that needs to be added or something like that? Again, sorry for the off-topic post, but I thought the audience of this list might contain some indiviuals who know these things. If someone can point me to the proper list where to ask this, I'd of course be interested, too. Thanks in advance Leif Singer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating Stub from WSDL on HTTPS
I created a stub from wsdl from HTTPS port but the uri in the stub shows http with port 80. Am I doing something wrong or do I have to make changes in tomcat settings or axis settings? I am using axis2 1.3 with tomcat 6. set JAVA_OPTS=-Djavax.net.ssl.trustStore="c:/program files/java/jre1.6.0_01/lib/security/cacerts" wsdl2java.bat -or -uw --noBuildXML -uri https://openapi.strands.com:443/services/Api?wsdl * Default Constructor */ public ApiStub( org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { this(configurationContext, "http://openapi.strands.com:80/services/Api";); } /** * Default Constructor */ public ApiStub() throws org.apache.axis2.AxisFault { this("http://openapi.strands.com:80/services/Api";); } - Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis1/1.4 Client to MTOM WebService
Looking for some guidance on Axis1 version 1.4 help building a WS Client that can interact with a MTOM WebService. I am building the client using the Service and Call objects The input to the service is a String and a Base64 encoded element - looks like this TEST base64 stuff here I have successfully called the service with null binaryData but I get the following error when I pass actual data. The output is the String sent back in a SOAP Fault Unmarshalling Error : null In this example I have a class HelloWorldMtom (JavaBean) with a String and a DataHandler attributes that I use as input. HelloWorldMtom hwMtom = new HelloWorldMtom(); hwMtom.setName(name); hwMtom.setBinaryData(dh); Here is the client code: Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(ADDRESS); call.setOperationName(new QName(HELLO_NAMESPACE, "sayHello")); call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS); call.setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT, Call.ATTACHMENT_ENCAPSULATION_FORMAT_MTOM); call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); call.setReturnType(org.apache.axis.Constants.XSD_STRING); call.setOperationStyle(Style.WRAPPED); call.setOperationUse(Use.LITERAL); QName qnameHelloMtom = new QName(HELLO_NAMESPACE, "helloMtom"); call.registerTypeMapping(hwMtom.getClass(), qnameHelloMtom, new HelloWorldMtomSerializerFactory(), new BeanDeserializerFactory(hwMtom.getClass(), qnameHelloMtom)); call.addParameter("arg0", qnameHelloMtom, ParameterMode.IN); String ret = (String) call.invoke( new Object[] { hwMtom } ); I built a custom Serializer as follows: public class HelloWorldMtomSerializer implements Serializer { public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { if (value!=null){ HelloWorldMtom data = (HelloWorldMtom)value; context.startElement(new QName("arg0"), null); context.serialize(new QName("name"), null, data.getName(), null, Boolean.TRUE, Boolean.FALSE); if (data.getBinaryData()!=null){ Serializer jafs = new JAFDataHandlerSerializer(); jafs.serialize(new QName("binaryData"), null, data.getBinaryData(), context); } else { context.serialize(new QName("binaryData"), null, null, null, Boolean.TRUE, Boolean.FALSE); } context.endElement(); } } public String getMechanismType() { return Constants.AXIS_SAX; } public Element writeSchema(Class javaType, Types types) throws Exception { return null; } } Am I on the right track? Thanks for any help with this. Note: A CXF and an Axis2 WS client have already been successfully built against this WS (I am testing interop with different Java SOAP stacks) Mike Barlotta Associate Booz | Allen | Hamilton
RE: CXF Mtom service and Axis2 Axiom client (FIX)
I did not move to (or from) any of the frameworks. I built my MTOM service using CXF. I wanted to test interop with CXF client, Axis2 client, and Axis1 client (still in progress...) Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 1:07 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) Hey Mike, what is the compelling reason that impelled you to move to CXF (presumably from Axis2, or XFire)? -jeff From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 12:33 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) FYI: 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. I moved the Axis2 WS Client to its own project and now it works. 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. Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] 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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 a
RE: CXF Mtom service and Axis2 Axiom client (FIX)
Hey Mike, what is the compelling reason that impelled you to move to CXF (presumably from Axis2, or XFire)? -jeff _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 12:33 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) FYI: 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. I moved the Axis2 WS Client to its own project and now it works. 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. Mike Barlotta Associate Booz | Allen | Hamilton _ From: Walker, Jeff [mailto:[EMAIL PROTECTED] 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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton _ From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory();
RE: CXF Mtom service and Axis2 Axiom client (FIX)
I've just gone through those conflict jars issues. It was really painful in XML world. _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 12:33 PM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client (FIX) FYI: 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. I moved the Axis2 WS Client to its own project and now it works. 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. Mike Barlotta Associate Booz | Allen | Hamilton _ From: Walker, Jeff [mailto:[EMAIL PROTECTED] 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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton _ From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/Pensi
RE: CXF Mtom service and Axis2 Axiom client (FIX)
FYI: 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. I moved the Axis2 WS Client to its own project and now it works. 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. Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] 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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds = new ByteArrayDataSource(baos.toByteA
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: 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:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:28 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton _ From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds = new ByteArrayDataSource(baos.toByteArray(),"content/type"); DataHandler dh = new DataHandler(ds); OMText binaryData = factory.createOMText(dh, true); OMElement bd = factory.createOMElement("binaryData", null); bd.addChild(binaryData); arg0.addChild(bd); return root; } public void test_WS_sayHello(){ try { ServiceClient sc = new ServiceClient(); Options opts = new Options(); opts.setTo(new EndpointReference(SERVICE_ADDRESS)); opts.setProperty(Co
Re: [Axis2] How Do I Set mustUnderstand="0"?
I just love having these conversations with myself, but for anybody who is interested I didn't want to leave the impression that the correct solution was to modify the wsdl2java generated code. Here is a better solution. All calls to modify the mustUnderstand flag are made before the call to the stub. ServiceStub stub = new ServiceStub(ctx, endpoint); stub._getServiceClient().getOptions().setProperty(WSDL2Constants.ATTRIBUTE_MUST_UNDERSTAND,"0"); response = stub.GetData(request); Jon Hanshew wrote: > > Here is the solution. I had to make changes in the code generated by > WSDL2Java. > > /* Here is the call I make from TestClient.java */ > > response = stub.GetData(request); > > /* End of call I make from TestClient.java */ > > /* Control transfers here in ServiceneStub.java, the code generated by > WSDL2java. */ > > public Service.client.ServiceStub.ResponseMessage GetData( > Service.client.ServiceStub.RequestMessage requestMessage) > throws java.rmi.RemoteException { > try { > org.apache.axis2.client.OperationClient _operationClient = > > _serviceClient.createClient(_operations[0].getName()); > _operationClient.getOptions().setAction("urn:GetData"); > > _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); > > addPropertyToOperationClient(_operationClient, > > org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, > "&"); > /* End of WSDL2Java generated code > > /* Added this code to generated stub code to get "mustUnderstand" > > > to disappear from SOAP header */ > > addPropertyToOperationClient(_operationClient, > > org.apache.axis2.description.WSDL2Constants.ATTRIBUTE_MUST_UNDERSTAND,"0"); > > /* WSDL2Java Generated code restarts here and continues on ... */ > > > > > > Jon Hanshew wrote: >> >> I am using Axis2 1.3 and Rampart 1.3 basic security. My non-Axis service >> requires that mustUnderstand be set to zero. It seems to be permanently >> set to "1". I have looked everywhere in forums, documentation and source >> code but have failed to find a solution. I do know that the >> AddressingConstant parameters do not work in my case. I am not using >> Addressing. >> >> Jon >> > > -- View this message in context: http://www.nabble.com/-Axis2--How-Do-I-Set-mustUnderstand%3D%220%22--tf4722713.html#a13550008 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] WS-policy client code
Rampart policy sample 01 demonstrates how to do a UT token. Note that it uses a "Signed Supporting Token", but since it uses a TransportBinding the token doesn't get signed. Feng Lu wrote: > > Hi gurus, > > I am wondering whether anybody have some sample codes for WS-policy > support with Axis2? Here is our situation: we have a WS service WSDL > (attached bellow) with WS-policy. We used Axis2 to generate the stub and I > am able to see the setPolicy is called in the stub source code. However, I > am not sure what I should do to write some client code with Axis2 to > support the policy. Our WSDL policy is very simple, just with user name > and password: > - > - http://www.bea.com/wls90/security/policy";> > - > - TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken";> >Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"; > /> > > > > > > Any help is greatly appreciated! > > Thanks > > Frank > > __ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- View this message in context: http://www.nabble.com/-Axis2--WS-policy-client-code-tf4722125.html#a13549924 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: CXF Mtom service and Axis2 Axiom client
Thanks Jeff, the problem occurs with & w/o tcpmon... I am just using that to debug. I have used the image (2kb) with CXF client through tcpmon w/o issues. I am using the tcpmon that comes with Axis1 version 1.4 Mike Barlotta Associate Booz | Allen | Hamilton From: Walker, Jeff [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 11:13 AM To: axis-user@ws.apache.org Subject: RE: CXF Mtom service and Axis2 Axiom client 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. (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 From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds = new ByteArrayDataSource(baos.toByteArray(),"content/type"); DataHandler dh = new DataHandler(ds); OMText binaryData = factory.createOMText(dh, true); OMElement bd = factory.createOMElement("binaryData", null); bd.addChild(binaryData); arg0.addChild(bd); return root; } public void test_WS_sayHello(){ try { ServiceClient sc = new ServiceClient(); Options opts = new Options(); opts.setTo(new EndpointReference(SERVICE_ADDRESS)); opts.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); sc.setOptions(opts); OMElement requestElement = this.createPayload_SayHello("Axis2"); OMElement responseElement = sc.sendReceive(requestElement); System.out.println("Response: " + responseElement); assertNotNull(responseElement); assertEquals("sayHelloResponse",responseElement.getLocalName()); OMElement returnElement = responseElement.getFirstElement(); assertNotNull(returnElement); assertEquals("return",returnElement.getLocalName()); String responseXml = returnElement.getText(); assertNotNull(responseXml); assertEquals("Hello Axis2",responseXml); } catch (AxisFault e) { System.out.println(e.getMessage()); fail("Unexpected AxisFault"); } catch (IOException e) { System.out.println(e.getMessage()); fail("Unexpected IOException");
RE: CXF Mtom service and Axis2 Axiom client
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. (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 _ From: Barlotta, Michael [USA] [mailto:[EMAIL PROTECTED] Sent: Friday, November 02, 2007 10:31 AM To: axis-user@ws.apache.org Subject: CXF Mtom service and Axis2 Axiom client 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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds = new ByteArrayDataSource(baos.toByteArray(),"content/type"); DataHandler dh = new DataHandler(ds); OMText binaryData = factory.createOMText(dh, true); OMElement bd = factory.createOMElement("binaryData", null); bd.addChild(binaryData); arg0.addChild(bd); return root; } public void test_WS_sayHello(){ try { ServiceClient sc = new ServiceClient(); Options opts = new Options(); opts.setTo(new EndpointReference(SERVICE_ADDRESS)); opts.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); sc.setOptions(opts); OMElement requestElement = this.createPayload_SayHello("Axis2"); OMElement responseElement = sc.sendReceive(requestElement); System.out.println("Response: " + responseElement); assertNotNull(responseElement); assertEquals("sayHelloResponse",responseElement.getLocalName()); OMElement returnElement = responseElement.getFirstElement(); assertNotNull(returnElement); assertEquals("return",returnElement.getLocalName()); String responseXml = returnElement.getText(); assertNotNull(responseXml); assertEquals("Hello Axis2",responseXml); } catch (AxisFault e) { System.out.println(e.getMessage()); fail("Unexpected AxisFault"); } catch (IOException e) { System.out.println(e.getMessage()); fail("Unexpected IOException"); } } } TIA Mike Barlotta Associate Booz | Allen | Hamilton
Re: Accessing security header from service
Ciao, Quoting Todd Allen <[EMAIL PROTECTED]>: This link may help: http://wso2.org/library/169 This might be outdated. Try this code: Vector results = null; String username = null; if ((results = (Vector) inMsgCtx .getProperty(WSHandlerConstants.RECV_RESULTS)) == null) throw new RuntimeException("No security results!!"); else { for (int i = 0; i < results.size(); i++) { // Get hold of the WSHandlerResult instance WSHandlerResult rResult = (WSHandlerResult) results.get(i); Vector wsSecEngineResults = rResult.getResults(); for (int j = 0; j < wsSecEngineResults.size(); j++) { // Get hold of the WSSecurityEngineResult instance WSSecurityEngineResult wser = (WSSecurityEngineResult) wsSecEngineResults.get(j); // Extract the principal Collection values = wser.values(); Iterator valuesIt = values.iterator(); while (valuesIt.hasNext()) { Object o = valuesIt.next(); if (o instanceof WSUsernameTokenPrincipal) { WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal) o; username = principal.getName(); } // Todo: to see if it is instance of kerberos token // etc. } } } } This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing security header from service
This link may help: http://wso2.org/library/169 At 10:05 AM 11/2/2007, John Doe wrote: Hi, I successfully deployed Axis2+Rampart together and I'm using simple username/password authentication. Service is simple, it takes few parameters and it needs to store them in database along with username of user that made the request. I have username/password information in PwdCallbackHandler that Rampart calls, but I don't know how to pass that information to service. Is there a way to access security header from service or somehow append username/password info to the body of the request when it passes through Rampart? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wsdl2java not including new function
I'm kinda discouraged that I didn't get a response to my question. It's hard to support open source tools when the community isn't there to help. I hacked at my problem yesterday and here's the work-around. I downloaded the axis2 plugin to do the stub Java code generation for me. And that also was missing the function from the stub. I added a parameter to my service class and then the function appeared in the service stub. My question now is that does using Axis2 require an input parameter? Is it possible to just have a Web Service which will just respond without having to have an input parameter? Thanks, Jim James Neff wrote: Greetings, I added a function to an existing working axis2 web service. The new function works when I call it directly from my browser: http://appserver2:8080/axis2/services/DataLoaderService/GetProcessorStatus I get the correct response: 1 I tried using the following command to generate the service stub: /usr/share/axis2-1.3/bin/./wsdl2java.sh -uri http://localhost:8080/axis2/services/DataLoaderService?wsdl -o . But the new function is not in the class file DataLoaderServiceStub. What am I doing wrong? Here is the wsdl: http://ws.apache.org/axis2";> DataLoaderService − − elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2";> − − − − − − − − − type="xs:string"/> − − element="ns0:GetRetrieverParametersResponse"/> − − − wsaw:Action="urn:GetRetrieverParameters"/> wsaw:Action="urn:GetRetrieverParametersResponse"/> − wsaw:Action="urn:GetProcessorStatus"/> wsaw:Action="urn:GetProcessorStatusResponse"/> − type="ns0:DataLoaderServicePortType"> http://schemas.xmlsoap.org/soap/http"; style="document"/> − style="document"/> − − − − − − type="ns0:DataLoaderServicePortType"> http://schemas.xmlsoap.org/soap/http"; style="document"/> − style="document"/> − − − − − − type="ns0:DataLoaderServicePortType"> − − − − − − − − binding="ns0:DataLoaderServiceSOAP11Binding"> location="http://appserver2:8080/axis2/services/DataLoaderService"/> − binding="ns0:DataLoaderServiceSOAP12Binding"> location="http://appserver2:8080/axis2/services/DataLoaderService"/> − binding="ns0:DataLoaderServiceHttpBinding"> location="http://appserver2:8080/axis2/services/DataLoaderService"/> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CXF Mtom service and Axis2 Axiom client
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 I am using TCPMON to watch the SOAP requests and responses Axis2 --> TCPMON --> CXF Service 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 Let me know if any other information would be helpful Here is my Axis2 client protected OMElement createPayload_SayHello(String nameText) throws IOException{ OMFactory factory = OMAbstractFactory.getOMFactory(); OMNamespace namespace = factory.createOMNamespace("http://hello.bah.com/";, "ns1"); OMElement root = factory.createOMElement("sayHello", namespace); OMElement arg0 = factory.createOMElement("arg0", null); root.addChild(arg0); OMElement name = factory.createOMElement("name", null); name.setText(nameText); arg0.addChild(name); InputStream is = IOHelper.getStreamFromClassPathFile("com/bah/hello/PensiveDuke.gif"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); IOHelper.inputToOutput(is, baos); DataSource ds = new ByteArrayDataSource(baos.toByteArray(),"content/type"); DataHandler dh = new DataHandler(ds); OMText binaryData = factory.createOMText(dh, true); OMElement bd = factory.createOMElement("binaryData", null); bd.addChild(binaryData); arg0.addChild(bd); return root; } public void test_WS_sayHello(){ try { ServiceClient sc = new ServiceClient(); Options opts = new Options(); opts.setTo(new EndpointReference(SERVICE_ADDRESS)); opts.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE); sc.setOptions(opts); OMElement requestElement = this.createPayload_SayHello("Axis2"); OMElement responseElement = sc.sendReceive(requestElement); System.out.println("Response: " + responseElement); assertNotNull(responseElement); assertEquals("sayHelloResponse",responseElement.getLocalName()); OMElement returnElement = responseElement.getFirstElement(); assertNotNull(returnElement); assertEquals("return",returnElement.getLocalName()); String responseXml = returnElement.getText(); assertNotNull(responseXml); assertEquals("Hello Axis2",responseXml); } catch (AxisFault e) { System.out.println(e.getMessage()); fail("Unexpected AxisFault"); } catch (IOException e) { System.out.println(e.getMessage()); fail("Unexpected IOException"); } } } TIA Mike Barlotta Associate Booz | Allen | Hamilton
Accessing security header from service
Hi, I successfully deployed Axis2+Rampart together and I'm using simple username/password authentication. Service is simple, it takes few parameters and it needs to store them in database along with username of user that made the request. I have username/password information in PwdCallbackHandler that Rampart calls, but I don't know how to pass that information to service. Is there a way to access security header from service or somehow append username/password info to the body of the request when it passes through Rampart? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Result Structure / wsdl file
Hey guys! I'm trying to build a webservice which is used by a Flash (Flex) Client. I've set up a running service, and client, but I've got some problems with the xml which is returned by the server. The result (in Firefox) looks like: new The Problem is, that the "return" word is reserved in Flex, and so the client can't access the value of it. I've changed the wsdl file to: expecting the returned xml file to look like: new but it didn't work! I'm still getting the old "return" xml. Do I have to change something different to get the ouput changed? I Would be glad to get some Ideas! Greets Roman - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis2 WSDL2Java error during service skeliton/stub generation
If you are using "wrapped" style (which is what happens when you specify "-uw"), then your output message must return an empty wrapper element (e.g., "Set_PortalVariableResponse"). This is how it is supposed to work. Anne On 11/1/07, Kiran Sriram <[EMAIL PROTECTED]> wrote: > > Hi Anne, > > If I define void types as complex types then it is generating server > skeleton/client stubs properly with out any errors. > but then if you see the method signatures of the methods with void return > types there is an object by name "Set_PortalVariableResponse" as return type > instead of void. That object is not having any properties inside though. > This is happening even though i use "-uw" (for unwrapping) as an option for > Axis2 WSDL2Java tool. > > Thanks, > Kiran > > > > Date: Wed, 31 Oct 2007 21:29:04 -0400 > > From: [EMAIL PROTECTED] > > To: axis-user@ws.apache.org > > Subject: Re: Axis2 WSDL2Java error during service skeliton/stub generation > > > > > You should define a void like this: > > > > > > > > > > > > If you don't define the type, then the element can contain anything. > > This definition specifies that the element contains nothing. > > > > Anne > > > > On 10/31/07, Kiran Sriram <[EMAIL PROTECTED]> wrote: > > > > > > Hi Anne, > > > > > > this basically for void return type of a method. .Net is not having any > > > problem with that. > > > > > > but Axis2 WSDL2Java is not generating client or server side code. > > > > > > Kiran > > > > > > > > > > Date: Tue, 30 Oct 2007 08:28:03 -0400 > > > > From: [EMAIL PROTECTED] > > > > To: axis-user@ws.apache.org > > > > Subject: Re: FW: Axis2 WSDL2Java error during service skeliton/stub > > > generation > > > > > > > > > > > What I meant to say is: > > > > > > > > You have an _element_ defined in the schema: > > > > > > > > > > > > > > > > As the message says, it has no type defined. You need to specify its > > > > schema type. > > > > > > > > Anne > > > > > > > > On 10/29/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > > > > > You have a type defined in the schema: > > > > > > > > > > > > > > > > > > > > As the message says, it has no type defined. You need to specify its > > > > > schema type. > > > > > > > > > > Anne > > > > > > > > > > On 10/26/07, Kiran Kumar Sriram <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > Here is the WSDL file attached with this mail. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > From: [EMAIL PROTECTED] > > > > > > To: axis-user@ws.apache.org > > > > > > Subject: Axis2 WSDL2Java error during service skeliton/stub > generation > > > > > > Date: Fri, 26 Oct 2007 10:34:30 -0400 > > > > > > > > > > > > > > > > > > Hello All > > > > > > > > > > > > I am getting this error when i try to generate Service Skeleton > code > > > from a > > > > > > WSDL file. This is a new service and we are trying to go in WSDL > first > > > > > > approach. We need wsdl to be in Document/literal Wrapped style in > > > order to > > > > > > be interoperable with .Net framework. .Net generated client stubs > with > > > out > > > > > > any problem but Axis2 WSDL2Java is giving this exception during > > > service > > > > > > skeleton and client generation times. This is pretty simple WSDL > file > > > with > > > > > > just two methods in it. We are trying to generate skeleton and > clients > > > in > > > > > > UNWrapped mode. > > > > > > > > > > > > > C:\Code\Axis14ClientTest\Axis14ClientTest1>java.exe > > > > > > -Djava.ext.dirs=C:\Softwares > > > > > > \axis2-1.3-bin\axis2-1.3\lib; org.apache.axis2.wsdl.WSDL2Java -s > -ss > > > -uw -sd > > > > > > -d > > > > > > adb -uri PCMConnection.wsdl > > > > > > log4j:WARN No appenders could be found for logger > > > > > > (org.apache.axis2.description. > > > > > > WSDL11ToAllAxisServicesBuilder). > > > > > > log4j:WARN Please initialize the log4j system properly. > > > > > > Exception in thread "main" > > > > > > > org.apache.axis2.wsdl.codegen.CodeGenerationException > > > > > > : > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: > > > > > > Can not determine the s > > > > > > chema type for the set_PortalVariableResponse > > > > > > at > > > > > > > > > > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener > > > > > > ationEngine.java:265) > > > > > > at > > > > > > > > > org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35) > > > > > > at > > > > > > > > > org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24) > > > > > > Caused by: > > > > > > > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: > Can > > > > > > not determ > > > > > > ine the schema type for the set_PortalVariableResponse > > > > > > at > > > > > > > > > > org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.walk > > > > > > > > > > > > > > > > > > I have attached WSDL file with this mail. Just to let you know > .Net is > > > fine > > > > > > with this WSDL b
RE: Axis2: howto handle custom mustUnderstand Headers
Erratum: Return InvocationResponse.CONTINUE if the header is OK, return InvocationResponse.ABORT if you want Axis to ignore the request. Throw an Exception if you want the client to receive a SOAP Fault -Message d'origine- De : ROSSILLE Samuel [mailto:[EMAIL PROTECTED] Envoyé : vendredi 2 novembre 2007 10:37 À : axis-user@ws.apache.org Cc : [EMAIL PROTECTED] Objet : RE: Axis2: howto handle custom mustUnderstand Headers Hi No, you must not change the MustUnderstandChecker. You must add a handler that will process your custom header. You have two things to do: 1/ Write the handler class The simplest way to do so is to write a class that extends the AbstratHandler provider by Axis (look up in the API docs for fully qualified name). Override the invoke method. In it's body you will proceed the header the way you have to. Return InvocationResponse.CONTINUE if the header is OK, InvocationResponse.ABORT in other cases. 2/ Declare your handler class in axis configuration. Edit the conf/axis2.xml file, and declare your handler in the inflow declaration (tag ), where the comments tells you to do it , like thos for example: after the comment like this: Tell me if you need more help. Regards, Samuel Rossille -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : jeudi 1 novembre 2007 16:57 À : ROSSILLE Samuel Objet : RE: Axis2: howto handle custom mustUnderstand Headers Hi Samuel, I saw your response in the newsgroup below. I still don't quite understand how to configure it. Did you modify the MustUnderstandChecker or did you extend the class and put the code in below? If the latter, did you then configure that class in the axis2.xml handlers? Is there a document that talks about this? Thanks in advance for all your help, Thanks, Rob ROSSILLE Samuel wrote: > > Hi > > messageContext.getEnvelope().getHeader().examineAllHeaderBlocks() > gives you an Iterator over all the SOAPHeaderBlock of the message > > hb.getMustUnderstand() > tells you if a the SOAPHeaderBlock hb must be understood. > > hb.setProcessed() > tells Axis that your program understands a the SOAPHeaderBlock hb and has > correctly completed it's processing. > > Regards > Samuel Rossille > > -Message d'origine- > De : Andreas Schultz [mailto:[EMAIL PROTECTED] > Envoyé : mardi 16 octobre 2007 15:54 > À : axis-user@ws.apache.org > Objet : Axis2: howto handle custom mustUnderstand Headers > > Hi all, > > I need to handle custom header fields that have the mustUnderstand > attribute set to true(1). > Currently such an invocation triggers a fault: > org.apache.axis2.AxisFault: Must Understand check failed for header : MyID > > Searching the maillinglist has turned up a references to a > MustUnderstandChecker, but i don't understand how i tell it what > header elements are supported. > > Is there a magic trick to tell axis which headers my service likes? > > Regards > Andreas > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > Quoted from: http://www.nabble.com/Axis2%3A-howto-handle-custom-mustUnderstand-Headers-tf4634363.html#a13235540 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Axis2: howto handle custom mustUnderstand Headers
Hi No, you must not change the MustUnderstandChecker. You must add a handler that will process your custom header. You have two things to do: 1/ Write the handler class The simplest way to do so is to write a class that extends the AbstratHandler provider by Axis (look up in the API docs for fully qualified name). Override the invoke method. In it's body you will proceed the header the way you have to. Return InvocationResponse.CONTINUE if the header is OK, InvocationResponse.ABORT in other cases. 2/ Declare your handler class in axis configuration. Edit the conf/axis2.xml file, and declare your handler in the inflow declaration (tag ), where the comments tells you to do it , like thos for example: after the comment like this: Tell me if you need more help. Regards, Samuel Rossille -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : jeudi 1 novembre 2007 16:57 À : ROSSILLE Samuel Objet : RE: Axis2: howto handle custom mustUnderstand Headers Hi Samuel, I saw your response in the newsgroup below. I still don't quite understand how to configure it. Did you modify the MustUnderstandChecker or did you extend the class and put the code in below? If the latter, did you then configure that class in the axis2.xml handlers? Is there a document that talks about this? Thanks in advance for all your help, Thanks, Rob ROSSILLE Samuel wrote: > > Hi > > messageContext.getEnvelope().getHeader().examineAllHeaderBlocks() > gives you an Iterator over all the SOAPHeaderBlock of the message > > hb.getMustUnderstand() > tells you if a the SOAPHeaderBlock hb must be understood. > > hb.setProcessed() > tells Axis that your program understands a the SOAPHeaderBlock hb and has > correctly completed it's processing. > > Regards > Samuel Rossille > > -Message d'origine- > De : Andreas Schultz [mailto:[EMAIL PROTECTED] > Envoyé : mardi 16 octobre 2007 15:54 > À : axis-user@ws.apache.org > Objet : Axis2: howto handle custom mustUnderstand Headers > > Hi all, > > I need to handle custom header fields that have the mustUnderstand > attribute set to true(1). > Currently such an invocation triggers a fault: > org.apache.axis2.AxisFault: Must Understand check failed for header : MyID > > Searching the maillinglist has turned up a references to a > MustUnderstandChecker, but i don't understand how i tell it what > header elements are supported. > > Is there a magic trick to tell axis which headers my service likes? > > Regards > Andreas > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > Quoted from: http://www.nabble.com/Axis2%3A-howto-handle-custom-mustUnderstand-Headers-tf4634363.html#a13235540 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [AXIS2] custom https handler : Transport out has not been set
I did. I've tried every combination. I've tried registering the protocol (Protocol.register) as a global handler - same error. I then unregistered the protocol and added it to the service client - same error. It all works fine if I use: Protocol authhttps = new Protocol("https", new FedoraProtocolSocketFactory(keystoreLocation, keystorePassword, truststoreLocation, truststorePassword, 443); Options options = serviceClient.getOptions(); optoins.|setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, authhttps); if I use "secure" instead of "https" I get the error. Even if I Protocol.register("secure", authhttps), the service client doesn't pick it up and I get the error. I wanted to use "secure" as I don't want to handle all HTTPS in this way. However, if I don't register the handler but pass it direct to the service client, it works fine, though only if I create the handler for "https". I was doing what it says on this page: http://wso2.org/library/1646 So I think the issue is the service client not picking up Protocol.register or not understanding anything other than "https" as a protocol designator? thanks, Alistair -- mov eax,1 mov ebx,0 int 80h > Alistair Young wrote: >> typo, it should be: >> >> Protocol authhttps = new Protocol("https", new >> FedoraProtocolSocketFactory(keystoreLocation, keystorePassword, >> truststoreLocation, truststorePassword, 443); >> Protocol.registerProtocol("secure", authhttps); >> >> Axis2 uses HttpClient but doesn't seem to understand "secure" instead >> of "https". Registering "secure" as a protocol is enough for >> HttpClient but not Axis2. Is there another step I need to do to get >> Axis2 to work with "secure" protocol designator? >> >> thanks, >> >> Alistair >> >> >> >> -- >> mov eax,1 >> mov ebx,0 >> int 80h >> >> >> >> >> On 1 Nov 2007, at 11:29, Alistair Young wrote: >> >>> I'd like to remap https to another "name", e.g. "secure" as I want to >>> use custom ssl handling with it. I've done this: >>> >>> Protocol authhttps = new Protocol("secure", new >>> FedoraProtocolSocketFactory(keystoreLocation, keystorePassword, >>> truststoreLocation, truststorePassword, 443); >>> Protocol.registerProtocol("secure", authhttps); > > try setting the following property in MessageContext or in Options and see > whether you are getting the same error. > > e.g. > Options options = serviceClient.getOptions(); > optoins.|setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, > myProtocolHandler); > > > | > >>> >>> it works fine using "https" but when I change it to "secure" I get >>> the error: >>> >>> "Transport out has not been set" >>> >>> when connecting to secure://service.url >>> >>> is there a way to tell Axis2 how to handle "secure" - it's really >>> https in disguise >>> >>> thanks, >>> >>> Alistair >>> >>> >>> >>> -- >>> mov eax,1 >>> mov ebx,0 >>> int 80h >>> >>> >>> >>> >> > > > -- > Sanka Samaranayake > WSO2 Inc. > > http://www.bloglines.com/blog/sanka > http://www.wso2.org/ > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] (Long) Ws-Policy: problem with SAMLtoken and WSAS example
Hi, Quoting Massimiliano Masi <[EMAIL PROTECTED]>: Hi All, I'm very frustrated: I'm developing policies for getting a SAML 2 token from a WS-Trust STS implemented using Rahas. Another doubt is: in the rampart policy examples, the sample05 shows how to obtain a SAML Token, but are there any examples that shows how to use the SAML Token issued? Since rampart implements security policy 1.1, do I have to implement my own code, that extends the RampartPolicy to handle the saml2.0 token (maybe, based on token reference?) In this case, could you point me on what I've to extend? The WSAS sample IMHO, has an error: he puts the TokenType in the RequestSecurityTokenTemplate, that is, an error: the content of this policy element should be copied directly in the SecondaryParameters of the wst:RequestSecurityToken, and TokenType is a brother of SecondaryParameters. Am I wrong? Thanks, Massimiliano This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [AXIS2] custom https handler : Transport out has not been set
Alistair Young wrote: typo, it should be: Protocol authhttps = new Protocol("https", new FedoraProtocolSocketFactory(keystoreLocation, keystorePassword, truststoreLocation, truststorePassword, 443); Protocol.registerProtocol("secure", authhttps); Axis2 uses HttpClient but doesn't seem to understand "secure" instead of "https". Registering "secure" as a protocol is enough for HttpClient but not Axis2. Is there another step I need to do to get Axis2 to work with "secure" protocol designator? thanks, Alistair -- mov eax,1 mov ebx,0 int 80h On 1 Nov 2007, at 11:29, Alistair Young wrote: I'd like to remap https to another "name", e.g. "secure" as I want to use custom ssl handling with it. I've done this: Protocol authhttps = new Protocol("secure", new FedoraProtocolSocketFactory(keystoreLocation, keystorePassword, truststoreLocation, truststorePassword, 443); Protocol.registerProtocol("secure", authhttps); try setting the following property in MessageContext or in Options and see whether you are getting the same error. e.g. Options options = serviceClient.getOptions(); optoins.|setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER, myProtocolHandler); | it works fine using "https" but when I change it to "secure" I get the error: "Transport out has not been set" when connecting to secure://service.url is there a way to tell Axis2 how to handle "secure" - it's really https in disguise thanks, Alistair -- mov eax,1 mov ebx,0 int 80h -- Sanka Samaranayake WSO2 Inc. http://www.bloglines.com/blog/sanka http://www.wso2.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]