Win a copy of Java Challengers this week in the Java in General forum!

Turian Vlad

Greenhorn
+ Follow
since Oct 17, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Turian Vlad

Hi all,

in another post: https://coderanch.com/t/525005/Web-Services/java/unexpected-XML-tag-JAX-WS , i tried to consume a web service and encountered that problem. it has been on hold since then and i tried some workarounds.
Nothing succesfull yet. My latest workaround was trying to develop a dispatch client like so :



when i run this code the folowing error appears



I've tried almost everything and any ideas will be greatly appreciated. If you need more info I will be happy to post it.

Thank you all,
Vlad
10 years ago
Hi Naren,

Thank you for your answer. Yes...i've tried to eliminate the namespace occurence from the wsdl and to generate the client code again. Unfortunately the problem still remains.

The wsdl generated by wsimport I presume, from the url that my web service provider gave me is:



attemting to remove the namespace from the top did not solved the problem.

if let's say i go over the generated classes and i remove all namespace occurences the problem is not solved either: it is just transformed into:



It is starting to drive me crazy. As i see things there are 2 things i could do:
1. modify the client so that it would not expect a certain namespace(i wasn't able to do that) and i don't believe it is a smart thing to do because when running wsimport again all the modifications will be lost
2. altering somehow the incoming soap message in order the add the namespace on the signOnResponse tag. i don't know how to do this either.

Any help will be appreciated.

Thank you all,
Vlad
10 years ago
Hi all,
I have fought today with a trully strange problem.

So I am trying to consume a web service using a jax-ws client. i do not have access to the web serviceimplementation because it is a third party.

My client code looks like this:



the following error appears:


i used soap-ui to test the the web service and it works like a charm.
also i used wireshark to see what xml messages are transmitted throught the wire and the messages are:
Request:


and response:



i could not figure out the problem. but a hint tells me that the problem is that the namespace ns2="http://www.onepoint-project.com/webService" is on the user tag and not on the signOnResponse tag.
i used wsimport to generate the necessary classes on the client.
if this is the problem are there any workarounds on it, something to do on the client (because i do not have access to the web service implementation)?
what is stranger is that the code works when using Axis 2

Thank you for your answers.
Vlad
10 years ago
Also when the add method fires the following soap is transmitted through the wire



it appears to me that the soap message is well formed. is the xmlns="" a problem?

Thank you for your answers

Vlad
10 years ago
Well this is what i have done so far:

Using the xsd generated by the jax-ws web service i've generated the required classes using the xjc command.

in the client:



my applicationContext.xml file looks like



i written also a main class to test:



The problem is that when i run the main class an error occures. i hate this error. a couple of hours have passed and i still don't know how to solve it

the stacktrace:

10 years ago
Recently i needed to work with webservices. I've studied them (contract first vs. contract last) and i've:

- implemented a Spring-WS web service
- implemented a JAX-WS web service
- consumed the first one using a Spring-ws client and a normal JAX-WS client
- consumed the second one using a normal jax-ws client

I wan't now to be able to consume a JAX-WS web service from a Spring-WS client.

I assume that this is something that can be done. but i don't know how.

Do you have experience with such a thing or do you saw tutorials on it, because I didn't find any!

Thank you,
Vlad
10 years ago

kri shan wrote:While we use Axis 2 for a contract last web service(that means that you write your business code, annotate it and the contract is generated least),

We can use Axis for contract first web service too and Spring-WS for contract-last web service too.



Is this a question or an affirmation because the Spring-WS developers clearly state that "Spring-WS only supports the contract-first development style", affirmation that you will find in chapter 2, subchapter 2.1 of the spring-ws 2.0.0-RC2 reference manual that comes with the above mentioned distribution of spring-ws.

You can download the distribution from: http://www.springsource.com/download/community

Cheers,
Vlad
10 years ago

kri shan wrote:I am trying to expose already existing operations as Web Services. Axis 2 stack will create stub and skeleton classes / Spring Web Services will create Endpoints based on XSD - top-down approach. Which is the best web services stack based on performance / features / ease of use ?



Hi kri shan,
Axis 2 and Spring WS are very different things.
While we use Axis 2 for a contract last web service(that means that you write your business code, annotate it and the contract is generated least), Spring WS is used for contract first ws (the business code comes at the end).

the contract last web services are easier to implement but have some drawbacks.
on the other hand spring ws is really powerfull stuff. you will find more of it's advantages at: http://static.springsource.org/spring-ws/sites/1.5/reference/html/why-contract-first.html

recently th 2.0.0-RC2 version of spring-ws was released which has some important features (including but not restricted to annotation features , oxm features).

Cheers,
Vlad
10 years ago
Hi guys.
I hope this is the right place to post a question about log4j. if not please redirect me to the appropriate thread.

So...what i want to do is to write a logging implementation that uses log4j to log to a database.
i use an the jdbc appender from http://www.mannhaupt.com/danko/projects/index.html

it all goes well when i use it to log from a single class, but when i try to instantiate another class that logs something in the database, that log doesn't end up in the database.

my code is:












in the database only the log that LogTest made arrives i.e logger.debug("debug")

is there a way to capture the logs of all the classes that i'm instantiating in my class?

i need this because i need to log messages that come from a third party tool to which's source code i do not have access.

Thank you very much,
Vlad Turian
11 years ago

Peter Johnson wrote:In Eclipse, the additional JAR files are placed into the .classpath file in the project's base directory. Could can always manually (outside of Eclipse using a text editor) copy the contents of the .classpath from an old project to a new project and then in Eclipse do a refresh on the project to pick up the new entries.

If you are using Maven and m2eclipse, you can accomplish a similar thing by, within Eclipse, copying the dependencies form the pom.xml in the old project to the pom.xml in the new project and saving the pom.xml. Or you could create your own archetype that already contains the necessary dependencies and use that to create new projects.



Thanks Peter. I applied your first idea and it works.
Have a nice day!

Vlad
-------------------------------------------------------------------------
"Freedom cannot be bought. Do you say the price is small?...do not fool yourselves.....it will get bigger continously till one day the price of freedom will be freedom itself."(Vlad The Impailer)
I feel that my question is very moronic but here it is.

I am using Pellet, a java ontology-reasoner (it does more than reasoning but that is not the point here ). The Pellet API consists of a large number of .jar files.
Please tell me a way to put this .jar's directly into eclipse(or netbeans) because adding those jar's to every's project classpath is time consuming and frankly a little frustrating.

Thanks for Your answers,
Vlad

-------------------------------------------------------------------------
"Freedom cannot be bought. Do you the price is small?...do not fool yourselfs.....it will get bigger continuosly till one day the price of freedom will be freedom itself."(Vlad The Impailer)
Hy guys,
i was trying to build an application to communicate with a database.
the connection is not the problem.
the problem is that in the bean i have the method below

public static String cauta()
{
PreparedStatement pstmt = null;
ResultSet rs=null;
String numm=null;
String prenumm=null;

try{
// Create a statement
//Statement stmt = conn.createStatement();


String sql = "Select * FROM Users WHERE Username=? ";
pstmt = con.prepareStatement(sql);
// Set the value
pstmt.setString(1, username);
rs= pstmt.executeQuery();
if (rs.next()) {

numm=rs.getString("Name");
prenumm=rs.getString(3);

System.out.println(numm+" "+prenumm);
System.out.println("SQL statement is executed!");
rez= "S-a gasit userul cautat. Se numeste: "+numm+" "+prenumm;
return rez;
}
else {
rez= "User-ul cautat nu a fost gasit";
return rez;
}

}
catch (SQLException s){
System.out.println("SQL statement is not executed!");
s.printStackTrace();
}

catch (Exception e){
e.printStackTrace();
}
return null;
}

the method works just fine and return the appropriate string

but in the jsp file i can't manage to acces this method in order to display that string in my page.
i've tried even javascript but it won't work

<h:outputText value="Username"/>
<h:inputText id="user" value="#{Bean.username}" autocomplete="on"/>

<h:commandButton onclick="alert(Core.JSPBean.getRez().toString())" action="#{Bean.cauta}" id="submit" value="Cauta" />


are there any other ways in which i can display this damn message on my page?

Thanks for your help!
11 years ago
JSF