R Srini

Ranch Hand
+ Follow
since Feb 19, 2010
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by R Srini

Hello Bhaskar, Have you tried turning on debug mode to see what is going on?

Please see here for an example: http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/ReadDebug.html

And here for options: http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#Debug

When running your application, start it with -Djavax.net.debug=all or or one of the other allowed options. You will
be able to figure out the problem yourself.

Best regards,
11 years ago
Hi, I have used tcpmon with http and it does the job - but I haven't used with https though. Some other interesting open source tools that I have heard good things about but not used:

1. Wireshark
2. Membrane SOAP/HTTP Monitor

All the best!
13 years ago
Hi. If its the old Axis 1.4, then I can't be of much help. A few thoughts;

1. The stub contains the classes you need to use in your client. I don't think its meant to be modified.

qName = new javax.xml.namespace.QName("urn:PosadasMailSender", "ArrayOf_xsd_string");

2. I don't know if the above is valid, but I am not sure.

For this type:
<complexType name="RequestMailVO">
<element name="attachmentByte" nillable="true" type="xsd:string"/>
<element name="attachmentName" nillable="true" type="xsd:string"/>
<element name="code" nillable="true" type="xsd:string"/>
<element name="datosPlantillas" nillable="true" type="apachesoap:Map"/>
<element name="idioma" nillable="true" type="xsd:string"/>
<element name="mailFormat" type="xsd:int"/>
<element name="to" nillable="true" type="impl:ArrayOf_xsd_string"/>

RequestMailVO mail = new RequestMailVO();
final String[] policies=new String[]{"POLICY1","POLICY2"};

******************Why are you doing this:*******************
*****************Instead of:**********************
mail.setTo(new ArrayOf_xsd_string().set(policies)) or something like that

3. In the above example you have shown, per the wsdl, in RequestMailVO:
-- to is of type ArrayOf_xsd_string
-- datosPlantillas is of type Map.
So then why are you adding the string array to datosPlantillas? Maybe I am missing something. Shouldn't the string array be added to the "to" property?

Can you try this approach:
- use the generated stub
- in the stub, take a look at the public inner classes that can be accessed from your client code
- For a service called "Your", you should be able to say something like this:
yourUrl = "http://yoururl/";
QName myQname = new QName("http://yournamespaceurl/", "YourService");
YourService service = new YourService(yourUrl, myQname);
binding = service.getYourPort();
RequestMailVO mail = new RequestMailVO();
final String[] policies=new String[]{"POLICY1","POLICY2"};
mail.setTo(policies in string array type)
mail.set other values also

Best of luck! Please do post your solution once you have it.
13 years ago
When I run this in Axis2 1.5.1:
I get:

Compared to your generated class, mine implements ADBBean instead of Serializable and looks quite different.

- Are you using the old Axis or Axis2?
- You probably need to construct an ArrayOf_xsd_string object from your string array, and then put that object in your map. How are you passing a string array in your client code? Please post the code fragment.

I hope this is making sense.
13 years ago
Well, that is good. So you are on your way now.

SO...header is null, which as I read the tutorial site posted I have to register each header and assign it to a qname.

What is it you are trying to do? Obtain/get the headers in an incoming SOAP message? Or add a header to an outgoing message?
For an incoming message with a header, I would expect the header to not be null. The link you posted is meant for adding a header to a SOAP message before its sent on its way to the destination.
13 years ago
The wsdl is not valid when copy/pasted. Please edit your post, and wrap your wsdl inside a codetag by selecting the wsdl text and pressing the code button above, and click Preview to make sure that its readable. I'll try to look at it soon.
13 years ago
Can you post a very small wsdl that is representative of the problem, and also mention what you are trying to do? I can then run wsdl2java and try to duplicate the issue. If you already have a solution, kindly post it!
13 years ago
LOL. Ok. So back to the problem. A few questions:

1. Can you briefly mention the overall context of what you are doing and the software being used?
2. Looks like you are developing a client that consumes a security-enabled web service. Is that correct?
3. Also, what other software are you using, dev environment, etc.
4. Have you looked at this thread that I mentioned earlier? Maybe it will help.
13 years ago
Ok. Back to square one then Now, if you look at the sample handler code in that documentation, it is a bit different. For example:

- your getHeaders method returns QName[0]. Is this valid though? I don't know if its even populated with values.
- your init method doesn't do anything, but its probably critical to the rest of it working.

So: can you try using the sample code instead and implement some of it, including init(), destroy(), getHeaders(), formLogMessage() and handleRequest? In order words, all of it I think it will work if you try it.
13 years ago
Ohhh. So you are developing in J2EE 1.4? Sorry I don't have experience developing web services in 1.4. However:

1. This may be of help to you.
2. Go to your app server documentation site, and search for "web service handler". Some of the results should be of help, including this one on how to create handlers.

All the best!
13 years ago
Hello Gunther. Of course I am sure it is possible. Unfortunately I don't know how to do this manually, but I am sure someone out there knows. Maybe this will help with some more information.

In case you already have the header constructed (I couldn't tell by looking at your code), you can look here on how to add a header to the SOAP envelope. Maybe this is what you were looking for?

But I think it must be complicated enough to handle all aspects of the WS-Security specification that a separate product (Rampart) exists. And with it, the whole security handling becomes a matter of complicated configuration, rather than complicated programming
13 years ago
Yes, I think that is correct. Once you have the basic web service, you need to:

- develop the handler implementing SOAPHandler
- wire it up into the handler chain in an XML file
- And annotate your web service class with "@HandlerChain(file = "MyMessage_handler.xml")".

My guess is that wiring the handler chain depends on the JAX-WS implementation that you use. So the way to incorporate the handler chain XML into the system may be different in Glassfish than when using Axis. So you may have to look up the documentation for that.

I have tried this in Netbeans/Glassfish, and this is easy to do.
13 years ago
Hi. Are you using version 1.4 of the older Axis or the newer Axis2 version 1.4?

For Axis1, see here for how marshalling works, and for Axis2, please read this article.

If its JAX-RPC, the web service classes will typically implement java.rmi.Remote in your code. Please see the J2EE 1.4 tutorial for an overview.
If its JAX-WS, you will see the web service classes annotated with @WebService in the code. And the Java EE 5 tutorial has an overview.

Hope this is the information you are looking for.
13 years ago
Hi. I see that you are implementing Handler. Nothing wrong with that, but its at a lower level and requires more work I presume, when compared with using SOAPHandler.

The handlers that I have created implement javax.xml.ws.handler.soap.SOAPHandler<SOAPMessageContext> (http://download.oracle.com/javaee/5/api/javax/xml/ws/handler/soap/SOAPHandler.html), and this method "public boolean handleMessage(SOAPMessageContext messageContext)" is overridden to provide the handler functionality.

So In Netbeans/Glassfish, I have


13 years ago