Re: [AXIS2] Problem with MessageContext
Thanks, Deepal. I changed to set the property in OperationConetxt and it works. I noticed the OperationContext is copied from the in to the out memssageContext. Shaoguang Deepal Jayasinghe [EMAIL PROTECTED] wrote: Hi Shaoguang , Yes , you can not store property in req message context and access them using response message context. If you want to do so , then you need to store the property in OperationConetxt not in the message context. There will be two fresh message context for one in-out mep. Thanks Deepal On server side, I use a request and a response handler to log some data. In the request handler, I called messageContext.setProperty(myProperty, xyz). In the response handler, messageContext.getProperty(myProperty) returns null. It looks the properties in MessageContext (Options) are reset after invoking the web service. Should the messageContext carry around the custom properties through all server-side handlers? Shaoguang Ahhh...imagining that irresistible new car smell? Check out new cars at Yahoo! Autos. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: Apache Axis 2: how to get header? Options
In the generated Stub class, do a search for the method fromOM - you'll get the idea on how to get your UserInfo object from the OMElement (getHeader().getFirstChildWithName(QName of UserInfo) ). craig wickesser [EMAIL PROTECTED] wrote: so far I haven't found the parse method. On 4/23/07, craig wickesser [EMAIL PROTECTED] wrote: which class should have parse method? On 4/23/07, Davanum Srinivas [EMAIL PROTECTED] wrote: look for parse method in those classes. The parse method takes in a XMLStreamReader. If you see it it means you are using ADB based code. Next step is to use the AXIOM API to get the OMElement corresponding to your UserInfo element in the soap header. basically call getChildren on the header and iterate till you find UserInfo. When you get that OMElement, call getXMLStreamReader() and pass that to the parse method of your class -- dims On 4/23/07, craig wickesser [EMAIL PROTECTED] wrote: there is UserInfoImpl and UserInfoDocumentImpl. On 4/23/07, craig wickesser [EMAIL PROTECTED] wrote: yes On 4/23/07, Davanum Srinivas [EMAIL PROTECTED] wrote: Was this UserInfo class generated by WSDL2Java/ADB? -- dims On 4/23/07, craig wickesser [EMAIL PROTECTED] wrote: Ok, I put code into my Stub class so I could get the _returnMessageContext. Now that I have access to the org.apache.axiom.soap.SOAPHeader it gives me the XML, is there a way to get the actual JavaBean objects based on the header(s)? For example if my header looks like... soap12:Header ErrorResponse /ErrorResponse UserInfo ... Idstring/Id DOBstring/DOB /UserInfo /soap12:Header I have a UserInfo class which I would like to have populated with the information from the XMLis there a way for this to happen automatically or do I have to write my own XML Parser to parse the header XML? Thanks! -- Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: Apache Axis 2: how to get header? Options
Yes. I was speaking on the client side. -Shaoguang Martin Gainty [EMAIL PROTECTED] wrote: I didnt see any ability to run any of the axis operations on the server asychronously.. I assume you're speaking on the client side??? M- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Shaoguang Cong To: axis-user@ws.apache.org Sent: Sunday, April 22, 2007 7:20 PM Subject: Re: Apache Axis 2: how to get header? Options I observed the same thing: MessageContext.getCurrentMessageContext() returns null. I don't know what's the designer's intention with CurrentMessageContex, maybe that's for asynchronical calls. To get headers from the response, try MessageContext.getSoapEnvelope().getHeader(). I only do blocked call and it works for me. Shaoguang craig wickesser [EMAIL PROTECTED] wrote: yea so far I am not finding how to get headers from the response, am I missing something ? On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: Here is what it says at that link: org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS You might sometimes want to send your own custom HTTP headers. You can set an ArrayList filled with org.apache.commons.httpclient.Header objects using the above property. You must not try to override the Headers the Axis2 engine is setting to the outgoing message It seems to me this in regards to settings headers, I need to somehow get the headers from the response. Also, in my earlier post I mentioned that when I call MessageContext.getCurrentMessageContext() it returns null. What do you think? On 4/20/07, robert lazarski [EMAIL PROTECTED] wrote: You'll need to work with MessageContext. Here's the reference for the properties you're looking for: http://wso2.org/library/230#HTTP_HEADERS HTH, Robert On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: client side On 4/20/07, robert lazarski [EMAIL PROTECTED] wrote: Client or server side ? On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: any ideas? - Ahhh...imagining that irresistible new car smell? Check out new cars at Yahoo! Autos. - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: Apache Axis 2: how to get header? Options
Hi Thilina , I cannot find the method getLastOperationContext() in ServiceClient in Axis2.1.1.1. Should it be already in the released version since I was told it is in nightly build back in December last year? Craig, Sorry for the confusion - I wasn't with the code in hand when I wrote the reply. The line of code should be the one as given by Thilina (getEnvelope(), not getSoapEnvelope()). It's called from a messageContext instance, not the class. It's simple but it seems you cannot get to it because the MessageContext/OperationClient involved in the client call wasn't exposed by the generated Stub. I actually saw the response message by debugging into the generated Stub, from the line immediately after execute the call _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); Shaoguang Thilina Gunarathne [EMAIL PROTECTED] wrote: Refer to the earlier mail from Kamal Kang... OperationContext oprCtxt = stub._getServiceClient().getLastOperationContext(); MessageContext inMsgContext = oprCtxt.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); SOAPHeader header = inMsgContext.getEnvelope().getHeader(); Do the above after your service invocation... This works in the client side... ~Thilina On 4/23/07, José Antonio Sánchez wrote: You get this with: MessageContext.getCurrentMessageContext().getEnvelope() But remember, you cannot make this in your client code. You have to make it in the Stub code and then give the headers to your client code by other means (for example, returning a custom class instead of the generated class). On 4/23/07, craig wickesser wrote: Shaoguang, MessageContext does not have a getSoapEnvelope method, in fact the only getter method it has is getCurrentMessageContext (at least for Axis2). Any other ideas? I think I might switch to XFire to do what I need. I posted over there and it sounds like in the next day or so there will be support for getting the headers that I need. Thanks Craig On 4/22/07, Thilina Gunarathne wrote: Do we have a default envelope set in out message context in Axis2? In Step #1 what he does is set an envelope in out message context (with the out headers) first and then retrieve it. outMessageContext.setEnvelope (createSOAPEnvelope()); see https://issues.apache.org/jira/browse/AXIS2-2531 Thanka, Thilina So the Step# 2 suggestion is a performace improvement only if Axis2 set a default out Envelope. I am not sure whether Axis2 does this or not. if so I think we have to stop that since there is no reason to do that. Amila. thanks, dims On 4/19/07, Kang, Kamaljeet K. [EMAIL PROTECTED] wrote: These are the changes I did to get Response SOAP header. 1) Save header in the message context in the skeleton implementation. MessageContext inMsgContext = MessageContext.getCurrentMessageContext(); OperationContext operationContext = inMsgContext.getOperationContext(); MessageContext outMessageContext = operationContext .getMessageContext( WSDLConstants.MESSAGE_LABEL_OUT_VALUE); outMessageContext.setEnvelope (createSOAPEnvelope()); OMNode outHeaderNode = toOM(outHeader); outMessageContext.getEnvelope().getHeader().addChild(outHeaderNode); 2) Modified autogenerated *InOutReceiver classes to not create new Envelope if Envelope is already there in the context (modified whereever factory.getDefaultEnvelope() is called) 3) Modified Stub to save the return message context org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE ); org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); // Added this line _serviceClient.getServiceContext().setLastOperationContext(_operationClient.getOperationContext()); 4) Finally you can get the Response Header from stub OperationContext oprCtxt = stub._getServiceClient().getLastOperationContext(); MessageContext inMsgContext = oprCtxt.getMessageContext (WSDLConstants.MESSAGE_LABEL_IN_VALUE); SOAPHeader header = inMsgContext.getEnvelope().getHeader(); return Header_T.Factory.parse(header.getFirstElement ().getXMLStreamReaderWithoutCaching()); Not sure if there is any easier way but finally this worked for me. Let me know if you need more help with this. Kamal Kang -Original Message- From: José Antonio Sánchez [mailto: [EMAIL PROTECTED] Sent: Thursday, April 19, 2007 3:56 PM To: axis-user@ws.apache.org Subject: Re: Apache Axis 2: how to get header? Options
Re: Apache Axis 2: how to get header? Options
I observed the same thing: MessageContext.getCurrentMessageContext() returns null. I don't know what's the designer's intention with CurrentMessageContex, maybe that's for asynchronical calls. To get headers from the response, try MessageContext.getSoapEnvelope().getHeader(). I only do blocked call and it works for me. Shaoguang craig wickesser [EMAIL PROTECTED] wrote: yea so far I am not finding how to get headers from the response, am I missing something ? On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: Here is what it says at that link: org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS You might sometimes want to send your own custom HTTP headers. You can set an ArrayList filled with org.apache.commons.httpclient.Header objects using the above property. You must not try to override the Headers the Axis2 engine is setting to the outgoing message It seems to me this in regards to settings headers, I need to somehow get the headers from the response. Also, in my earlier post I mentioned that when I call MessageContext.getCurrentMessageContext() it returns null. What do you think? On 4/20/07, robert lazarski [EMAIL PROTECTED] wrote: You'll need to work with MessageContext. Here's the reference for the properties you're looking for: http://wso2.org/library/230#HTTP_HEADERS HTH, Robert On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: client side On 4/20/07, robert lazarski [EMAIL PROTECTED] wrote: Client or server side ? On 4/20/07, craig wickesser [EMAIL PROTECTED] wrote: any ideas? - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: [AXIS2] Remote debug not working for modules
I made a dummy mistake by pointed the client to a different Tomcat instance, not the one with my Axis2 services :( I'm happy I can debug into all Axis2 code now. Thanks. Shaoguang Deepal Jayasinghe [EMAIL PROTECTED] wrote: Have you attached you module classes into the IDE ? Thanks Deepal Shaoguang Cong wrote: I've been using remote debug for Axis and tomcat. With Axis 2, I can still debug into the service impl classes. But it seems my handler classes packaged in module aren't attached to the debugger. I verified that the handler classes are invoked. Anyone knows what could be wrong? I also have a problem with logging of module. The logging in the handler classes isn't written to the log file. The Log is created with a ServletContextListenter when Tomcat starts. Thx, Shaoguang Ahhh...imagining that irresistible new car smell? Check out new cars at Yahoo! Autos. -- Thanks, Deepal The highest tower is built one brick at a time - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
[AXIS2] Remote debug not working for modules
I've been using remote debug for Axis and tomcat. With Axis 2, I can still debug into the service impl classes. But it seems my handler classes packaged in module aren't attached to the debugger. I verified that the handler classes are invoked. Anyone knows what could be wrong? I also have a problem with logging of module. The logging in the handler classes isn't written to the log file. The Log is created with a ServletContextListenter when Tomcat starts. Thx, Shaoguang - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: [AXIS2] Remote debug not working for modules
Thanks for your response. Yes. I checked that page earlier. I use a different IDE and don't have problem to setup Tomcat JVM in debug mode. It's been working for me until now when I try to debug the handlers deployed as modules in the AXIS2 webapp. I can still debug into the code deployed in the aar. It only doesn't work for classes in the mar file. I don't have any clue about where the problem could be. Hope someone done debugging the modules may share some idea. We use a house-grown logging mechanism. The logging issue isn't so important since I can figure that out easily if the debug issue can be resolved. Shaoguang Martin Gainty [EMAIL PROTECTED] wrote: Did you see these instructions for setting up DEBUG option in the JVM? http://wso2.org/library/225 To config commons-logging via logging.properties please reference this site http://jakarta.apache.org/commons/logging/apidocs/org/apache/commons/logging/impl/SimpleLog.html Log4J is considerably more detailed and flexible as one can instantiate differing categories of Loggers, differing output destinations or appenders and differing layouts such as %r [%t] %-5p %c - %m%n http://logging.apache.org/log4j/docs/manual.html hope this helps, Martin-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Shaoguang Cong To: axis-user@ws.apache.org Sent: Friday, April 20, 2007 11:31 AM Subject: [AXIS2] Remote debug not working for modules I've been using remote debug for Axis and tomcat. With Axis 2, I can still debug into the service impl classes. But it seems my handler classes packaged in module aren't attached to the debugger. I verified that the handler classes are invoked. Anyone knows what could be wrong? I also have a problem with logging of module. The logging in the handler classes isn't written to the log file. The Log is created with a ServletContextListenter when Tomcat starts. Thx, Shaoguang - Ahhh...imagining that irresistible new car smell? Check out new cars at Yahoo! Autos. - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: Axis2 and existing client code
Sanjiva, I've tried similar thing and noticed a critical difference between Axis and Axis2 generated clients. I originally implement the web services with Axis 1.3, now looking to use Axis 2. My WSDLs are wrapped doc/literal in style, following WS-I profile for interoperability with .Net. My client is .net so ideally I don't want to change the WSDLs. The problem I found is the Axis 1 and Axis2 generated clients are using diffferent mechanism (required different EPRs) for invoking the services. With Axis1.3, the EPR is using the wsdl:port name, while Axis2 is using the wsdl:service name. If you named both with the same name, it works fine. But I happened to name the service different from the port name as many people do so. I don't know what others think, but I consider interoperability is the most important or driving feature web services provide. It would be desriable if the client won't be depending on how you implement the services. Why cannot we use Axis 1.3 client to talk to Axis2 services or use Axis2 client to talk to Axis1.3 services? If no interoperability between Axis1 and Axis 2, how would it work between Axis and .net? Thanks for your comments in advance. Shaoguang Jenn Chen [EMAIL PROTECTED] wrote: Thank you all for your replies. I'll give it a try. Jennifer - Original Message From: Sanjiva Weerawarana [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, April 16, 2007 3:09:24 AM Subject: Re: Axis2 and existing client code Thilina Gunarathne wrote: Axis2 and Axis1 to generate slightly different WSDL's for the same pojo service.. So the client's that depend on axis1 service (described by the wsdl) will not be able to communicate with the Axis2 service (described by Axis2 generated wsdl)... If the service is the same (i.e., it accepts the same XML and returns the same XML) then changes in how that XML is described should not affect the clients. That is, what Thilina is saying is that we generate doc/lit style WSDL 1.1 documents by default and Axis1 I believe generates rpc/encoded style ones for POJOs. However, if they're backed by the same POJO then the client should continue to work unmodified because its sending and receiving the same XML as before. Sanjiva. -- Sanjiva Weerawarana, Ph.D. Founder Director; Lanka Software Foundation; http://www.opensource.lk/ Founder, Chairman CEO; WSO2, Inc.; http://www.wso2.com/ Director; Open Source Initiative; http://www.opensource.org/ Member; Apache Software Foundation; http://www.apache.org/ Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible new car smell? Check out new cars at Yahoo! Autos. - Ahhh...imagining that irresistible new car smell? Check outnew cars at Yahoo! Autos.
Re: [Axis2] Using custom SSLSocketFactory or ssl connection
I'm trying to solve the same problem. Could you post your LenientSslSocketFactory class? I'd like to know how you associate it with the trustManagers. Thanks. Shaoguang aaron aston [EMAIL PROTECTED] wrote: I think I just did this to support self-signed certs ... Axis2 uses the Apache HttpClient instead of the 'normal' Java HttpURLConnection. You can configure a new 'https' protocol using the HttpClient API, specifying your own socket factory. Protocol protocol = new Protocol(https, new LenientSslSocketFactory(trustManagers), 443); Protocol.register(https, protocol); where LenientSslSocketFactory implements the HttpClient interface SecureProtocolSocketFactory. er ... SecureProtocolSocketFactory doesn't seem to be related to javax.net.SocketFactory at all though ... Aaron. On 5-Apr-07, at 4:39 PM, Mahesh Rachakonda wrote: I have been using Axis2 client with default JSSE to create ssl connections. Now I have a need to use Entrust certificate stores, so I can provide a JSSE SSLSocketFactory or a socket to Axis2. I am having a hard time figuring out how to go about it. I see that the previous versions (Axis) offered the following approach which is no longer available: org.apache.axis.AxisProperties.setProperty(axis.socketSecureFactory, mypackage.MySSLSocketFactory); Any help is sincerely appreciated. Thanks! Mahesh - Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit.
Re: [Axis2] Using custom SSLSocketFactory or ssl connection
Thanks, Mahesh. I looked at it and have my test http client talking to the Axis 2 server successfully. How do you plug it into the Axis 2 client? Are you using the WSDL2Java generated stub? Shaoguang Mahesh Rachakonda [EMAIL PROTECTED] wrote: Shaoguang, Take a look at this web page, this has three different examples on how to implement your own SecureProtocolSocketFactory. http://jakarta.apache.org/commons/httpclient/sslguide.html Mahesh On 4/6/07, Shaoguang Cong [EMAIL PROTECTED] wrote: I'm trying to solve the same problem. Could you post your LenientSslSocketFactory class? I'd like to know how you associate it with the trustManagers. Thanks. Shaoguang - Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
Re: [Axis2] Using custom SSLSocketFactory or ssl connection
Figured it out. I thought about it too much. All needed is to create a new Protocol using the custom factory and then call Protocol.registerProtocol. So missed Axis 1.x that handles this with just one simple property :) Thanks. Shaoguang Shaoguang Cong [EMAIL PROTECTED] wrote: Thanks, Mahesh. I looked at it and have my test http client talking to the Axis 2 server successfully. How do you plug it into the Axis 2 client? Are you using the WSDL2Java generated stub? Shaoguang Mahesh Rachakonda [EMAIL PROTECTED] wrote: Shaoguang, Take a look at this web page, this has three different examples on how to implement your own SecureProtocolSocketFactory. http://jakarta.apache.org/commons/httpclient/sslguide.html Mahesh On 4/6/07, Shaoguang Cong [EMAIL PROTECTED] wrote: I'm trying to solve the same problem. Could you post your LenientSslSocketFactory class? I'd like to know how you associate it with the trustManagers. Thanks. Shaoguang - Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. - TV dinner still cooling? Check out Tonight's Picks on Yahoo! TV.
[AXIS2] Issues in using WSDL2JAVA, AxisFault and SSL
I posted couple of my questions, but got no complete answer. I'd very appreciate if anyone of the Axis 2 dev can look at it. 1. The generated server skeleton interface doesn't have throws java.rmi.RemoteException anymore. So I cannot throw AxisFaut directly. Should I convert all server exception to RuntimeException? Is there any impact on how client consume the exception? 2. In Axis 1.3, EPR is defined like http://hostname:port/axis/services/WSDL:Port Now for Axis 2, EPR has to be something like http://hostname:port/axis2/services/WSDL:Service Why makes this change? Is there any configuration option on the server side to make it still work for clients using the Axis1.3 version of EPR? 3. SSL connection: Is there a way to trust all certificates - not need to add server certificates to client trustStore? I did that for Axis 1.3 by System.setProperty(axissocketSecureFactory, SunFakeTrustSocketFactory). It looks AXis 2 is asking to use SecureSocketFactory (or SSLProtocolSocketFactory). I wonder if there's a similar mechanism for Axis 2 that can let you bypass the validation. Or is there a way to access the HttpConnection from Axis 2 client stub? Thank you. Shaoguang Shaoguang Cong [EMAIL PROTECTED] wrote: Date: Tue, 3 Apr 2007 12:02:42 -0700 (PDT) From: Shaoguang Cong [EMAIL PROTECTED] Subject: [AXIS2] WSDL2JAVA generated interface code is missing RemoteException To: axis-user@ws.apache.org Anyone knows why the generated java skeleton interface doesn't have throws java.rmi.RemoteException anymore? Since AXIS 2 is still dealing with AxisFault which is a RemoteException, should the thows still be part of the method signature? The client stub does have the throws there. Thanks. Shaoguang - No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. - Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games.
Re: Axis2 wsdl2java : Overriding the existing generated files
I did that by adding an Ant task to delete all generated files or keep a specific one you want to keep. Here's an axample. target name=xyz-clean description=Clean output directories delete failonerror=false fileset dir=${src.dir}/generated include name=**/*.java/ exclude name=**/*Impl.java/ /fileset /delete /target target name=xyz-wsdl2java depends=xyz-clean description=generate stubs axis-wsdl2java output=src serverside=true testcase=false verbose=true /axis-wsdl2java /target Gul Onural [EMAIL PROTECTED] wrote: Is there any way to force the wsdl2java to override generated files even if they are already exists ? - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta.
RE: soap header in stub
http://issues.apache.org/jira/browse/AXIS2-1823 I filed a JIRA for this issue and it's closed now. But I haven't checked that yet. Shaoguang Kang, Kamaljeet K. [EMAIL PROTECTED] wrote: Thanks Charitha. Actually, I had read the earlier discussion regarding this topic. (http://marc.info/?l=axis-userm=116492371225455w=2) And I thought by now the following should be working. A stub uses an operation client inside each method. The life of the operation client is thus equal to the life of that method call. An option would be to add a method to ServiceClient() to get the last used operation client. Then one could get the last operation client, get the appropriate message context from that and grab whatever info needed. We could implement this fairly trivially by making operationClient an instance variable of ServiceClient and updating that whenever a new one is created. ServiceClient is already declared to be not thread safe so this should work ok (I think). Sanjiva Kamal -Original Message- From: Charitha Kankanamge [mailto:[EMAIL PROTECTED] Sent: Monday, April 02, 2007 11:06 PM To: axis-user@ws.apache.org Subject: Re: soap header in stub Hi Kang, AFAIK you won't be able to retrieve SOAP headers using serviceClient. Because, with service clients you can only access SOAP body or the pay load. Though you can add SOAP headers, you do not have a way to retrieve SOAP header from service client. Have a look at http://www-128.ibm.com/developerworks/webservices/library/ws-soa-axis2-1 / for more information on this. You can use operationClient to retrieve the SOAP headers. See http://wso2.org/library/290 Also, the same topic was discussed in the following url. http://marc.info/?l=axis-userm=116492371225455w=2 regards Charitha Kang, Kamaljeet K. wrote: Hi, I am trying to retrieve soap header of the response from stub using serviceClient.getLastOperationContext() but OperationContext is always null. Is this the right way to retrieve soap header in stub? Thanks Kamal The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reproduction, dissemination or distribution of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Tellabs - 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] The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reproduction, dissemination or distribution of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Tellabs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta.
[AXIS2] WSDL2JAVA generated interface code is missing RemoteException
Anyone knows why the generated java skeleton interface doesn't have throws java.rmi.RemoteException anymore? Since AXIS 2 is still dealing with AxisFault which is a RemoteException, should the thows still be part of the method signature? The client stub does have the throws there. Thanks. Shaoguang - No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started.
Is it possible to migrate from Axis1.3 to Axis 2 without a WSDL and client change?
Ideally we don't need to modify the WSDL or the client while migrating to AXIS 2. But I found that seems inevitable. Hope someone can verify this is indeed true. And I have to tell my .NET client for the change. In server-config.wsdd of Axis 1.3, the service tag has a name attribute that is using the WSDL port name (MyServicePort as in wsdl:port name=MyServicePort). In services.xml of AXIS 2, the service tag has a name attribute that is using the WSDL service name (MyService as in wsdl:service name=MyService). So an Axis 1.3 client will have the endpoint address specified with the port name (MyServicePort). This won't work for invoking the same service (same WSDL) implemented with an AXIS 2. Is this imcompatible feature just a little negligence or an improvement over 1.3? I do like the AXIS 2 approach (using WSDL:service name), though it's a bit headache for the migration effort. Thanks. Shaoguang - The fish are biting. Get more visitors on your site using Yahoo! Search Marketing.
[AXIS2] How to generate code from two or more WSDL files
Anybody knows how to generate code from two or more WSDL files? According to Deepal's article (http://www.wso2.net/articles/axis2/java/2006/09/13/working-with-axis2.;), this seems achieveable using service group introduced in AXIS 2. I want to know whether this is a future feature or already supported by the current code base of Axis2. Will very appreciate for an example of what the Ant task will look like and how to package the code into AAR files (one for each service?). I try to solve the problem in the following scenario. Say I have three WSDLs: foo.wsdl, bar.wsdl and sec.wsdl. The generated code should be packaged as -src -com.xyz.foo/ // code for FooService, depending on util and sec -com.xyz.bar/ // code for BarService, depending on util and sec -com.xyz.sec/ // code for SecService, depending on util -com.xyz.util/ // shared code Can this be done with WSDL2Java? Even the code can be generated the way I want, how to package the code for the AAR files (without duplicating the shared code)? I use XMLBean for data binding. Thanks. Shaoguang - Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster.
[AXIS2.1.1] Generate an Interface for the skeleton
Ajith, I've read your article on Contract-First Web Services with Apache Axis2. My question is how to connect to my service implementation class that implements the generated interface (generated using WSDL2Java -ssi option). Do I have to modify the generated services.xml to change the serviceClass to my own implementation class? Is there a way to avoid changing services.xml for this? If not, can WSDL2Java be enhanced so -ssi can take a user-specified impl class name as a parameter? Thanks. Shoaguang - Access over 1 million songs - Yahoo! Music Unlimited.
Re: [Axis2] AxisFault: java.lang.ExceptionInInitializerError / NoClassDefFoundError
Thanks, Robert! The problem is resolved. To adapt to my file structure, I only used the wsdl2java ant task from the Apache site. When I did re-build in my IDE, it wiped out the XML Bean resources generated. I re-generated the XML Beans resources before zipped the code in the aar file. Since the package name seems randomly generated each time, the older package name must have been used in the compiled classes. That's why the engine was looking for a different package name and definitely it cannot be found. Shaoguang robert lazarski [EMAIL PROTECTED] wrote: Classic error: http://ws.apache.org/axis2/tools/1_1/CodegenToolReference.html An important detail is that an XMLBean class file is also generated by WSDL2Java, TypeSystemHolder.class. That file is placed into build/classes by the above ant task and will be needed to compile the generated sources. A frequent problem is users get an error such as: ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54.TypeSystemHolder. Make sure the generated binary files are on the classpath. The TypeSystemHolder.class generated by WSDL2Java must be placed in your classpath in order to avoid this error. So one way to solve the issue is to follow the ant task in the tutorial. HTH, Robert - Everyone is raving about the all-new Yahoo! Mail beta.
[AXIS2] Class load error - org.apache.axis2.AxisFault: HTTP Transport error : '404'
I've a ServletContext listener class (WsServletContextListener) in my Axis2 project. The listenner class is packaged in the aar file. The aar file is deployed under axis2/WEB-INF/services. This makes tomcat fail to install the axis2 webapp because it fails to find the WsServletContextListener class (client is returned with org.apache.axis2.AxisFault: HTTP Transport error : '404'). It will work fine if I move the WsServletContextListener class to axis2/WEB-INF/classes. Do I need to deploy some of the customized classes (e.g. ServletContext listener class) separately from the classes in the aar file? I won't think so but it seems possible because those classes are loaded earlier by the tomcat boostrap process. Anyone can explain why or what could be wrong in my deployment? Thanks. Shaoguang - Access over 1 million songs - Yahoo! Music Unlimited.
[Axis2] AxisFault: java.lang.ExceptionInInitializerError / NoClassDefFoundError
Hi, I try to convert my axis1.3 projcet into axis2.1.1. After deployed the services on tomcat 5.0.5, I cannot get it to run due to some kind of initialization problem. Please help if you know what could cause the problem. My client calls the services at Service EPR: http://localhost:8080/axis2/services/ClaimService In the tomcat log, the exception from the first call: org.apache.axis2.transport.http.AxisServlet doPost SEVERE: java.lang.ExceptionInInitializerError For subsequent calls, it generates a different exception: org.apache.axis2.transport.http.AxisServlet doPost SEVERE: java.lang.NoClassDefFoundError Client log: First run, org.apache.axis2.AxisFault: java.lang.ExceptionInInitializerError at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:308) at com.xyz.wstubs.ClaimServiceStub.getClaimListByClaimNumber(ClaimServiceStub.java:585) Subsequent runs, org.apache.axis2.AxisFault: java.lang.NoClassDefFoundError at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:308) at com.xyz.claim.wstubs.ClaimServiceStub.getClaimListByClaimNumber(ClaimServiceStub.java:585) Thanks. Shaoguang - Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster.
Re: [Axis2] AxisFault: java.lang.ExceptionInInitializerError / NoClassDefFoundError
I've trouble with the mail server to reply to the message with Robert's response. Try again by removed original message. The default tomcat server log doesn't give much info about this exception. It only logs the exception name, without stack trace. With help from debug, my problem is narrowed down to the generated XMLBean resources class TypeSystemHolder cannot be found. The class is deployed in the aar file under the package sC22C But the AxisEngine on the tomcat is looking for the TypeSystemHolder class in a package s5808A. Why it does that? The generated and deployed XMLBean resources package isn't used. Do you know how the AxisEngine figure out the package name? Could this be a bug in axis2? I'm using tomcat 5.0.5. The real exception captured from debug: detailMessage: java.lang.String = Cannot load SchemaTypeSystem. Unable to load class with name schemaorg_apache_xmlbeans.system.s5808ATypeSystemHolder. Make sure the generated binary files are on the classpath. Thanks. Shaoguang robert lazarski [EMAIL PROTECTED] wrote: Um, could you paste the entire log(s)? Its not clear from your post which class is missing from your classpath. Robert - Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster.
Re: repost - error for soap HEADER in Axis documentation
Anne,We know from your postings and examples in the Axis (I use 1.3)release that we can specify the SOAP header in the WSDL. Butall examples I seenare not "wrapped" document/literal, thus not WS-I compliant. If I write the WSDL strictly follows the "wrapped" document/literal style and include the header in the input binding, Axiswsdl2java just ignores the header in the generated classes. Similar questions are posted several times, including one by myself. Since this is very important, I reallywant to get an answer.Do youknowif this is just not supported by Axis or is it a bug? Should we post this question to soap_dev?Thanks. Shaoguang Anne Thomas Manes [EMAIL PROTECTED] wrote: Susae,Most web services posted on xmethods.com are for demo purposes only. They don't require authentication, monitoring, auditing, routing, transformations, or any additional infrastructure functionality. As a best practice, business-oriented services should require authentication, and they should be monitored and audited. These functions don't require intermediation (you can use transport-level authentication [HTTP Auth or SSL mutual auth] for 1-to-1 connections), but many organizations choose to use an intermediary to implement this functionality. Routing, transformations, and acceleration typically require an intermediary. When using intermediaries, you typically also need to shift to application-level security (WS-Security). The "ultimate receiver" is the last SOAP node to receive the SOAP message. It comprises a SOAP engine and an application agent. The SOAP engine processes the SOAP message -- both Header and Body. Typically it uses handlers to processs the Header element, and serializers to convert the Body into language objects. The application agent is the application code that gets dispatched after the SOAP engine has processed the incoming message. If an response is required, the agent returns a language object return value to the SOAP engine, which then transforms it into a SOAP Response message, and then uses handlers to construct any necessary Header blocks. A handler and an intermediary are different things. A handler runs within the SOAP node. An intermediary is a separate SOAP node.Anne On 3/7/06, susae lee [EMAIL PROTECTED] wrote: you mention routing - if you sent soap to a host forrouting then it's not 1-to-1 and must be intermediated connection, correct?you mean most web services are very simple sample for demoonly and commerical implementations are much more complex? and you mention "application agent" are u mening Ultimate SOAP receiver?you mention "intermediary" is meaning same as "handler with the hosting SOAP engine." correct? Anne Thomas Manes [EMAIL PROTECTED] wrote: People typically use a SOAP Header to perform system-level functionality, such as authentication, session management, and routing. These functional requirements apply to both 1-to-1 and intermediated connections. Most web services on xmethods.com do not require these system-level functions.Typically header information is not passed to the application agent. Instead, the header is processed either by an intermediary or by a handler with the hosting SOAP engine. Anne On 3/5/06, susae lee [EMAIL PROTECTED] wrote: i just read through Axis user doc, but all sample app it mention doesn't show how to use the HEADER tag inside soap request / response. 1 -- is HEADER tag not much a use when doing 1 - 1 host to host request /response? 2 -- HEADER is only useful when soap massage need to pass multiple endpoints / hosts ?3 -- Why most of the web services at www.xmethods.net don't use HEADER tag on request / response xml? 4 -- Is that in most cases, BODY tag in soap is enough? no HEADER needed?5 -- Hosts in between web service client + provider process HEADER elements but not the content of BODY element? and the Ultimate SOAP receiver will process the BODY elements? Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze. Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze. Yahoo! Mail Use Photomail to share photos without annoying attachments.
Can and how .net client handle user-defined Web Services exceptions?
I defined a customizedexception called MyCustomException in the WSDL. I can catch this exception in Java client directly (using Axis1.3, JDK1.4). But I cannot find a way to do this for .net client. The "Add Web Reference" tool of .net seems not generate a class for MyCustomException. The.net client gets the MyCustomException as an xml string in faultDetail ofSoapException.Ideally we would expect .net will deserialize the custom exception into a VB or C# classs as Axis1.3 does for a Java client. Does anyone know if there's away in .Net to catch the user-defiend exception?Thanks. Shaoguang Yahoo! Mail Use Photomail to share photos without annoying attachments.
Re: SOAP:Header question - how wsdl2java or java2wsdl handle the soap header part
I have read an email chain betwen Tysnes Are Thobias, Terance Dias and Anne Thomas Manes on 2005-10-25, discussing the SOAP Header question. That'll answer George's question. I've added some new questions on the same issue below. I run into two problems with Axis1.3 wsdl2java. The firstproblem is the same as the one discussed by Anne etc. Anne provided asolution that is to define the input message with two parts. That's the same as an example given in the Axis 1.3 package. I tried it too. The WSDL2Java will generate the client stub with the soap header part being part of the method signature. That solutionwon't solve my problem because 1)it looks strange tohave the soap header as part of the method signature. 2) the WSDL defined that way isn't usingthe "wrapped" document/literal style and it isn't WS-I compliant either.Our client is .NET whereinteroperability is critical. So we need to make sure the WSDLs we defined are WS-I compliant. The second problem with using Axis1.3 wsdl2java is sometimes it's unpredictable.I added an annotation/documentation tag to a complex type, that makes the generator somehow switched from"wrapped" to "non-wrapped" style in the generated code. I wonder if these are something thatAxis 1.3doesn'tsupport, and will these be taken into consideration in new versions of Axis?Thanks. Shaoguangp.s. For George, you can search the mailing list archive to find the email chain mentioned. Try keyword "SAOP:Header question". Sueveges Gyoergy [EMAIL PROTECTED] wrote: Hi all,I'm now testing how axis works. I need a session based web service, so I test the SimpleSessionHandler.On the API site it is written, that it will check if there is a header with session_id, and when there is not, then is creates a session. So I would except that in the generated wsdl (http://localhost:8085/axis/services/ZagreusService?wsdl) there is a soap header info in the bining section. So now how will the WSDL2Java know how to create such a client that creates soap header with sessionid when sending request? Do I imagine the things in wrong way?Or Is it not a suggested way to create wsdl from the server classes, and then to create the client from wsdl?I deployed my test Servie on the server side with the following wsdd:xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"type="java:com.etixpert.zagreus.server.axis.SOAPMonitor"/type="java:org.apache.axis.handlers.SimpleSessionHandler"/type="java:org.apache.axis.handlers.SimpleSessionHandler"/type="java:com.etixpert.zagreus.server.axis.SOAPMonitor"/value="com.etixpert.zagreus.server.axis.TestService"/I have the following TestService:package com.etixpert.zagreus.server.axis;import org.apache.axis.transport.http.*;import org.apache.axis.handlers.SimpleSessionHandler;import org.apache.axis.session.*;import org.apache.axis.*;import java.util.*;public class TestService {public String test(String param) { MessageContext context = MessageContext.getCurrentContext();Session session = context.getSession();..}public void login(String user, String password) throws AxisFault {}}Generated wsdl. where there is no header info: