RE: HTTP transport error:

From: Potter, Brian L <>
Date: Fri, 1 Oct 2004 12:57:37 -0500

thanks for the quick reply. by standalone jaxrpc, do you mean the
dynamicproxy and helloservice examples? that's a good idea, i'll try them
on his machine.
here's my client code (it's based on j2ee tutorial dynamicproxy example):
package procnetService;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import com.edms.utils.*;
public class ProcnetClient {
 public static void main (String args[]) {
  try {
   String nameSpaceUri = "urn:EDIS";
   String serviceName = "ProcnetService";
   String portName = "ProcnetServiceIFPort";
   String adminDir = GenString.appendSlash (args[0]);
   String pron = args[1];
   String version = args[2];
   String open = args[3];
   String close = args[4];
   String loginRequired = args[5];
   String username = GenConfig.getConfigParam (adminDir, "ProcnetUsername");
   String password = GenConfig.getConfigParam (adminDir, "ProcnetPassword");
   String keyStore = GenConfig.getConfigParam (adminDir, "keyStore");
   String keyStorePassword = GenConfig.getConfigParam (adminDir,
   String trustStore = GenConfig.getConfigParam (adminDir, "trustStore");
   String trustStorePassword = GenConfig.getConfigParam (adminDir,
   System.setProperty("", keyStore);
   System.setProperty("", keyStorePassword);
   System.setProperty("", trustStore);
   SocketConfig socketConfig = new SocketConfig (adminDir);
   if (socketConfig.getConfig ("ProcnetService") < 0) {
    System.out.println (socketConfig.results);
    System.exit (-1);
   StringBuffer url = new StringBuffer ("http");
   if (socketConfig.flag) url.append ("s");
   url.append ("://");
   url.append (socketConfig.server);
   url.append (":");
   url.append (socketConfig.port);
   url.append ("/procnetService/procnetService?WSDL");
   URL loginWsdlUrl = new URL (url.toString());
   ServiceFactory serviceFactory = ServiceFactory.newInstance();
   Service procnetService = serviceFactory.createService(loginWsdlUrl, new
QName(nameSpaceUri, serviceName));
   ProcnetServiceIF procnetServiceIF = (ProcnetServiceIF)
procnetService.getPort(new QName(nameSpaceUri, portName),
   JaxRpcResult result = procnetServiceIF.publish (pron, version, open,
close, loginRequired, username, password);
   System.out.println (result.text);
   if (result.status < 0) System.exit (-1);
  } catch (Exception e) {
   System.out.println ("ProcnetClient exception: " + e.getMessage());
   System.exit (-1);
  System.exit (0);
here's my IF (it's based on j2ee tutorial helloservice example):
package procnetService;
import java.util.*;
import java.rmi.Remote;
import java.rmi.RemoteException;
import com.edms.utils.*;
Two things make this work:
1 - add \EdisDev\Generic;\EdisDev\EdisJSP\web-inf\classes to the system
2 - edit C:\j2eetutorial14\examples\jaxrpc\common\targets.xml and add
/EdisDev/Generic to the generate-wsdl target's classpath
public interface ProcnetServiceIF extends Remote {
 public JaxRpcResult publish (String pron, String version, String open,
String close, String loginRequired,
  String username, String password) throws RemoteException;

and here's Impl:
package procnetService;
import java.util.*;
import java.text.SimpleDateFormat;
import com.edms.utils.*;
import com.edis.utils.*;
public class ProcnetServiceImpl implements ProcnetServiceIF {
 private String adminDir, tempDir = "/Temp";
 public ProcnetServiceImpl() {
  adminDir = GenConfig.getAdminDir ("c:/", "procnetService");
  String str = GenConfig.getConfigParam (adminDir, "TempDirectory");
  if (str != null) tempDir = GenString.appendSlash (str);
 public static void main (String args[]) {
  ProcnetServiceImpl procnetServiceImpl = new ProcnetServiceImpl();
// procnetServiceImpl.publish ("ABCDEF", "5", "blpotter", "aub617");
 public JaxRpcResult publish (String pron, String version, String open,
String close, String loginRequired,
  String username, String password) {
  System.out.println ("ProcnetServer.publish: PRON - " + pron + ", Version -
" + version);
  CdArchive cdArchive = new CdArchive (adminDir, tempDir);
  EdisJdbc edisJdbc = new EdisJdbc (adminDir, tempDir);
  EdisUser edisUser = new EdisUser (adminDir);
  if (edisUser.edisLogin (username, password) != 0)
   return new JaxRpcResult (-1, edisUser.results);
  int status = cdArchive.toProcnet (pron, version, open, close,
loginRequired, edisJdbc, edisUser);
  return new JaxRpcResult (status, cdArchive.results);

-----Original Message-----
From: kathy walsh [mailto:Kathleen.Walsh_at_Sun.COM]
Sent: Friday, October 01, 2004 12:48 PM
Subject: Re: HTTP transport error:

do you note this problem using standalone jaxrpc?
I will look into this and let you know what I find-
It would be helpful if you could send me the clients dynamic proxy
example so that I can check for any problem I might see-

Potter, Brian L wrote:

i've used J2EE 1.4 sdk to write a JAXRPC web service based on the
dynamicproxy example in the J2EE 1.4 tutorial. it works great on my
development machines, but when my customer deploys the service and makes a
request, the client crashes with:
HTTP transport error: JohnDoe
 at com.sun.xml.rpc.client.StreamingSender._send(
 at com.sun.xml.rpc.client.dii.BasicCall.invoke(
 at $Proxy0.login(Unknown Source)

apparently the request is sent using the hostname (JohnDoe) instead of the
IP address (which is what i used in the WSDL URL when i created the proxy).
the client can ping the server using the IP address, but not using JohnDoe
(for some network configuration reason i'm not entirely clear on).
my question is: why is the request sent to the server by hostname instead of
IP address?
i found this after doing a google search on my error at
<> :
If your RMI application throws an UnknownHostException, you can look at the
resulting stack trace to see if the hostname that the client is using to
contact its remote server is incorrect or not fully-qualified. If necessary,
you can set the java.rmi.server.hostname property on the server to the
correct IP address or hostname of the server machine and RMI will use this
property's value to generate remote references to the server.
but i don't know where i can set the hostname property in my server code,
since it's not executed until after the request is made.
btw, my development machines are running windows XP and NT, my customer is
strictly NT.

Brian L. Potter
Software Scientist
Solutions Group
Intergraph Corporation (NASDAQ:INGR)
170 Graphics Drive, Madison, AL 35758
P 1.256.730.8219 F 1.256.730.7514 <> < <> >, <>