Dave Ehrlich

Greenhorn
+ Follow
since Nov 12, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Dave Ehrlich

I want to use the SelectSingleNode method of the XPathAPI class, but I don't understand how to set the contextNode input parameter which is of type Node.
The context of what I want to be searched is my XML document which is in a file. How do I get my XML document into a Node object so that I can pass it in as the contextNode parameter?
Any help would be appreciated.
Thanks,
Dave
I meant to write an &gt is being converted to a '>' by the XMLReader object.
Dave
Let's try this one more time. When I wrote the post and the last reply, the &lt got converted to '>'. The problem is that the XMLReader class is converting a &lt to a '>' and it thinks that the end of the tag value as been reached when in fact it hasn't.
Dave
When I made this post, I wrote '>' and it got converted to a '>'. The problem is that the XML reader is converted '>' to a '>' and thinking that the end of the tag has been reached when in fact, it hasn't.
Dave
I am using XMLReader.parse() method to parse the contents of a SOAP message. With a SOAP tag, there is an > which I believe is an escaped '>' symbol. The XMLReader.parse() method think that the > is the end of the tag even though it shows as > and not '>'.
Does anyone have any ideas on how do get around this. The data is being brought back in a faultstring tag and I don't have any control over what comes back.
Thanks,
Dave
I found this excellent Java Client download at
Java FTP Client
Both the source file and jar files are available for free download (although the author accepts donations through paypal). The code processes the FTP return codes and throws exceptions for bad return codes.
Dave
Does anyone know how to pass windows authentication information (userid/password) from a java client to a web service running on a web site under IIS that does not allow anonymous access and use Integrated Windows Authentication.
Thanks,
Dave
21 years ago
I want to add a userid and password to my HTTP header when I am using SOAPto call a web service.
I am sending my SOAP message (web service) using message.send(). This doesn't accept any arguments for user id and password. However, the send() method instantiates a SOAPHTTPConnection object which does have a setUserName() and setPassword() method. These end up in the HTTP Header collection. However, when message.send calls the SOAPHTTPConnection.send() method it sets the Headers parameter to null.
So I do I get the username and password in the SOAP message for Basic Authentication? I don't think that creating a SOAPHTTPConnection object in my code would work since message.send() creates a new one.
Any help would be appreciated.
Thanks,
Dave
21 years ago
Check out this link:
Calling a .NET web service from a Java client
It includes the Java code needed to invoke a .NET web service from Java. The only problem I had was on parsing the response. The article has xmlReader.parse(new InputSource(new StringReader(soapMsg.getContent().toString())));
That caused an error for me and I used soapMsg.getInputStream() which worked better.
I haven't gone the other way because I haven't needed to and because it is much easier to create a web service in .NET (using Visual Studio.NET) than in Java.
.NET uses document/literal encoing which means that the type information is not required on the SOAP element. I have only passed strings, but other types should also work.
It works well. I would suggest that you have the TcpTunnelGui monitor turned on so that you can see the SOAP request and response. This will help with debugging
Let me know if you have other questions.
HTH,
Dave
21 years ago
I want to run a java web service under IIS. This information on the web that I've been able to find discuss running java web services under Tomcat or an app server such as Websphere.
Can any point me to information showing how to set up and run a java web service under IIS.
Thanks,
Dave
21 years ago
This seems to be a problem with SOAP 2.3.1. I replaced it with soap.jar from the latest nightly build, 10/27/02, and it seems to work now.
21 years ago
I am calling a web service using message.send. As part of my testing, I have changed the host name in my URL to an invalid host. When I run the code, two error appear to be generated, an UnknownHostException and a SOAPException. I have catch logic for both errors as well as a general catch statement. The SOAPException is caught but the UnknownHostException is not.
Here is the error that is generated:

The line that generates this error is:

According to the message.send document at apache.org, the send method throws a SOAPException. This exception is being properly caught by my program and converted to a DCFException. DCFException is a custom exception that has ben created to handle all exceptions in the application. This can be see at the bottom of the eror message. A DCFException is thrown which states that there was a SOAPException. The SOAPEXCEPTION is being correctly handled.
A review of the module call chain shows that an UnknownHostException isn't thrown until InetAddress.getByName. This is the thrid module from the top.
This doesn't make sense to me. Shouldn't the only error that is returned be the SOAPException error since UnknownHostException is not defined in the signature of the message.send method?
If anyone knows why this is happening and how I can handle the UnknownHostException error, please let me know. Right now, my testing is failing because I am not handling the UnknownHostException error.
Here is my catch logic, so you can see that I am handling it and other errors that are in my code.

Thanks,
Dave
21 years ago
I solved the problem. See the related post in the javaranch SAX forum at
Resolving Java/.NET response problem
21 years ago
Solved!!!
Benoit,
Although I didn't need your code in the final result, it was crucial in making the breakthrough that determined the correct answer.
The original code below won't work because the parser wants a character string:

However, this code works:

It seems that the parser want a character stream and not an input stream.
If there are any comments on this, or how it could be done better, please let me know.
Thanks,
Dave
Rita,
The following commands:

produce the following result from the Windows command (DOS) window:
java.io.ByteArrayInputStream@66e815
I don't know if its a problem with how I'm trying to dump the input stream or something else. The strange thing is that TcpTunnelGui shows the SOAP response correctly.
Thanks,
Dave