|
Hi all,
It's been few days I have interoperability issue with service WCF(MICROSOFT FRAMEWORK.NET 3.5)deployed in IIS 7.5 and Java client Unit Testing Spring Framework. The service uses a MTOM property to send attached file in the SOAP Header request.
To check if my WebService works well, I developed a C# client and it works, my client .net can communicate with my service .net.
But the goal is to call this service with Java client.
I've done two test, one with SOAPUI and I get this error message :
"IIS 7.5 Erreur détaillée - 400.0 - Bad Request"
and the other one is with a Java client I got the same error message.
I do not have any clue about where does it might come from?
Moreover, I enable Java client and server side, the MTOM property even in SOAPUI.
If anyone got an idea or a solution, I will really appreciate.
Thank you.
My Configuraion Binding Java client Side (Context File) :
<pre lang="HTML">
<jaxws:client id="myService"
serviceClass="myServiceSoapBinding">
<jaxws:outFaultInterceptors>
<ref bean="clientWSOutFaultInterceptor" />
</jaxws:outFaultInterceptors>
<jaxws:binding>
<soap:soapBinding version="1.1" mtomEnabled="true" />
</jaxws:binding>
<jaxws:features>
<cxf:fastinfoset />
</jaxws:features>
</jaxws:client>
|
|
|
|
|
Hi. Sorry, I am fairly new to Java. I am trying to read data from an XML file into an ArrayList. Here is the code:
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
public class XmlParser {
public void UserListParser() throws ParserConfigurationException{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
builder = dbfactory.newDocumentBuilder();
XPathFactory xpfactory = XPathFactory.newInstance();
path = xpfactory.newXPath();
}
public ArrayList<User> parse() throws SAXException, IOException, XPathExpressionException {
File f = new File("../../../../../users.xml");
Document doc = builder.parse(f);
ArrayList<User> users = new ArrayList<User>();
int count = Integer.parseInt(path.evaluate("count(/users/user)", doc));
for (int i = 1; i <= count; i++) {
String username = path.evaluate("users/user/[" + i + "]username", doc);
String password = path.evaluate("users/user/[" + i + "]password", doc);
String perms = path.evaluate("users/user/[" + i + "]permissions", doc);
User u = new User(username, password, perms);
users.add(u);
}
return users;
}
}
I keep getting 7 errors, each error is one of the following and they are on lines 20, 22, 31, 34, 37, 38 and 39.
"Cannot find symbol"
symbol : variable builder
"Cannot find symbol"
symbol : variable path
Appreciate any help and thanks in advance. The XML file is below:
<?xml version="1.0" encoding="ISO-8859-1"?>
<users>
<user>
<username>User1</username>
<password>Password1</password>
<permissions>axxx</permissions>
</user>
<user>
<username>User2</username>
<password>Password2</password>
<permissions>xsxx</permissions>
</user>
<user>
<username>User3</username>
<password>Password3</password>
<permissions>xxbx</permissions>
</user>
<user>
<username>User4</username>
<password>Password4</password>
<permissions>xxxm</permissions>
</user>
</users>
|
|
|
|
|
You are trying to use some variables without declaring them so the compiler has no idea what they are supposed to be. Having given you the source line number and name of the variable you can go to that line and correct it by adding the type declaration before the variable name. See this tutorial[^] for some more detail.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
Intialize the builder and path variables , It will work..
Like mentoined below
public class XmlParser {
DocumentBuilder builder =null;
XPath path=null;
public void UserListParser() throws ParserConfigurationException{
DocumentBuilderFactory dbfactory = DocumentBuilderFactory.newInstance();
builder = dbfactory.newDocumentBuilder();
XPathFactory xpfactory = XPathFactory.newInstance();
path = xpfactory.newXPath();
}
|
|
|
|
|
Hey!
I'm searching for a proper way to create serial numbers for use with one of our Apps.
I've also found some tutorials etc, but none that really tickled me.
Some even seem to be a bit "home made" with wild String operations and stuff like that.
Do you use serial numbers? If yes - what system do you use
|
|
|
|
|
Is it server based?
A reasonable approach would be to use a cryptographically secure pseudorandom number generator[^] with the seed generated from the machine's MAC address. A similar approach would be the same with the registered e-mail address's hash-code as a seed.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
thanks for the link, I'll see how I can integrate that...
|
|
|
|
|
Depends what you want it for. Identification of users or versions for support queries? 'Locking'/registration-required hard to break ones? Machine-unique ones? Is it a client/server app or a standalone one?
|
|
|
|
|
Stand alone - with a small service at server side...
I think I'll try to create some using the MAC Address, that is a good idea and should work on all OS.
Let's find some wild ideas...
|
|
|
|
|
Hai Guys,
Can anybody help me to develop a telephone interface application in java.I am a beginner in this Voip type application.I need the algorithm for that.
|
|
|
|
|
muhammed_k wrote: Can anybody help me to develop a telephone interface application in java.
No, but we can help with specific technical questions. The basic research into a subject is something you have to do for yourself. Look at the Java articles here on CodeProject and try searching with Google for other resources.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
K ,I am collecting the basic document for this project.Thanks for the reply
|
|
|
|
|
hi, guys.
i want to make an application which can set the permission file (many file),and this application can detect the file automatically based on the ip address from active ip address client side.
then, server just click one button to set these file become read only. this aplication will developed use java RMI.
i need your help, to solve it. i had looking for some of information about it, and i had tried to start it too, but i'm still confused with it.
|
|
|
|
|
dnafrinsi wrote: i want to make an application which can set the permission file (many file)
OK, have you checked which Java class you can use to accomplish this?
dnafrinsi wrote: this application can detect the file automatically based on the ip address from active ip address client side.
Do you know of some method whereby a client will notify a server of file changes?
dnafrinsi wrote: then, server just click one button to set these file become read only.
Who will click the button?
dnafrinsi wrote: this aplication will developed use java RMI.
Right, at least you have one subject that you can spend time studying.
dnafrinsi wrote: but i'm still confused with it.
Try breaking your project into its constituent parts (I've had a go based on your questions) and address each part in turn. When you have one piece working you can move on to the next part.
There is not a lot more we can do to help at this time since you have not really explained which part you are stuck on.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
maybe , first, i want to set file become read only.
i think it's the first step which shoud i do.
u can give some help, probably.
oya, thanks for your advice.
|
|
|
|
|
dnafrinsi wrote: u can give some help, probably.
Of course, see here[^].
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
|
|
|
|
|
I have this code below! I use this line
list.add(new Employee(1, "A","Delhi"));
to add elements. I want to remove the index element and I don´t know how to.
pleaese help me to solve this. Want an simple instrution to it, somewhink like list.remove( Emplyee(1, "A","Delph"))
import java.io.*;
import java.util.*;
class Employee{
public int id;
public String name;
public String address;
public static int count = 0;
public Employee(){}
public Employee(int id, String name,String address) {
super();
this.id = id;
this.name = name;
this.address=address;
count++;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
}
public class DisplayArrayList {
public static void main(String[] args) throws Exception {
List<Employee> list = new ArrayList<Employee>();
list.add(new Employee(1, "A","Delhi"));
list.add(new Employee(2, "B","Mumbai"));
list.add(new Employee(3, "C","Chennai"));
list.add(new Employee(4, "D","Kolkata"));
System.out.println(" ");
System.out.print("Enter Employee Id: ");
Scanner input=new Scanner(System.in);
int id = input.nextInt();
for (Employee s : list){
if(id == s.getId())
{
System.out.println("Name and Address of employee is: ");
System.out.print(s.getName()+" " +s.getAddress());
}
}
}
}
|
|
|
|
|
You probably need to use the indexOf() [^] method, followed by remove() [^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Thanks for you reply.
I tried to use this
list.indexOf(list.remove(d));
this
list.remove(d);
and this
list.remove(list.indexOf(d));
But nothing worked!
|
|
|
|
|
B.Bryce wrote: But nothing worked!
Well that really does not tell us a lot. What is the value of d in all the above calls, and what is returned from calls to list.indexOf() ? Have you tried stepping through the code with your debugger to see what is actually happening?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
That can not work - even if "d" is an object of type Employee.
Because "d" is probably another, on the fly created object and not a part of the ArrayList "list".
You need to search for the entry, compare the index number "id" and if you find the correct one you can delete it.
Do not ask the ArrayList for the object at position "id" - that only works one time as the gap in the ArrayList is closed and on a second request a wrong object is delivered.
|
|
|
|
|
It should work if the equals method is implemented correctly.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
That one is not in and I bet the teacher doesn't tell.
|
|
|
|
|
There's two options: Either write some code to traverse the list and look at the ID, and if you get a match, remove that entry; or have your Employee's equals() method just use the ID. You should only do the second if you only ever want to compare Employees based on their ID (i.e. the ID is the only thing that identifies one), as it will make [2, "Joe", "Bangkok"] and [2, "Mary", "NYC"] match.
|
|
|
|
|
Your code could almost work.
First find the element, then remove it. Good practice is to never remove items from list while iterating through it and once you locate the required item to break.
public class DisplayArrayList {
public static void main(String[] args) throws Exception {
List<Employee> list = new ArrayList<Employee>();
list.add(new Employee(1, "A","Delhi"));
list.add(new Employee(2, "B","Mumbai"));
list.add(new Employee(3, "C","Chennai"));
list.add(new Employee(4, "D","Kolkata"));
System.out.println(" ");
System.out.print("Enter Employee Id: ");
Scanner input=new Scanner(System.in);
int id = input.nextInt();
Employee del = null;
for (Employee s : list) {
if(id == s.getId()) {
del = s;
break;
}
}
if (del != null) {
System.out.println("Name and Address of employee is: ");
System.out.print(s.getName()+" " +s.getAddress());
list.remove(del);
}
}
}
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|