J
Jbjones
I just wrote a simple java program that uses a web service call from
the internet, and attempts to save it to a file.
I have run a very similar program (actually used the same code) from a
different machine, and it worked fine, though for somereason running it
now is giving me errors. I have never seen this type of message
before, so I am a bit confused.
Here is the error:<error>
Exception in thread "main" AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
org.xml.sax.SAXParseException:
Content is not allowed in prolog.
</error>
I use this almost exact same code in another program that is running on
a web server that is running fine right now, so am not sure what to do.
I have all the axis libraries and the xerces libraries in my jre ext's
folder. Below I will include the pertinent code:
I assume this is an error from axis and not from the code that I am
running, but am lost.
**Assume this is the only code used. I use other code, but it is
provided in the packages. Any suggestions?
<code>
String xmlFile;
// Needed for the web service with NOAA
WeatherParametersType typeArray;
typeArray = new WeatherParametersType();
typeArray.setMaxt(true); //works
typeArray.setMint(true); //works
typeArray.setPop12(true);
typeArray.setWspd(true);
typeArray.setWx(true); //works
typeArray.setIcons(true);
String[] argst={"here","there"};
//I assume this constructor has no bearing on anything
Options opts=new Options(argst);
NdfdXML ndfd = new NdfdXMLLocator();
opts.setDefaultURL(ndfd.getndfdXMLPortAddress());
URL serviceURL = new URL(opts.getURL());
NdfdXMLPortType info = null;
if(serviceURL!=null)
{
info = ndfd.getndfdXMLPort(serviceURL);
}
Calendar now = new GregorianCalendar();
now.add(Calendar.DAY_OF_YEAR,0);
Calendar next = new GregorianCalendar();
next.add(Calendar.DAY_OF_YEAR,+7);
//<latitude>38.84N</latitude>
//<longitude>077.03W</longitude> is for zip 20001
BigDecimal lat = new BigDecimal(38.84);
BigDecimal lon = new BigDecimal(77.03);
info.NDFDgen(lat,lon,(ProductType.value1),(now),(next),(typeArray));
</code>
I know this probably seems vague, so I will add any other code or help
needed. Thanks for the help.
J
the internet, and attempts to save it to a file.
I have run a very similar program (actually used the same code) from a
different machine, and it worked fine, though for somereason running it
now is giving me errors. I have never seen this type of message
before, so I am a bit confused.
Here is the error:<error>
Exception in thread "main" AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
org.xml.sax.SAXParseException:
Content is not allowed in prolog.
</error>
I use this almost exact same code in another program that is running on
a web server that is running fine right now, so am not sure what to do.
I have all the axis libraries and the xerces libraries in my jre ext's
folder. Below I will include the pertinent code:
I assume this is an error from axis and not from the code that I am
running, but am lost.
**Assume this is the only code used. I use other code, but it is
provided in the packages. Any suggestions?
<code>
String xmlFile;
// Needed for the web service with NOAA
WeatherParametersType typeArray;
typeArray = new WeatherParametersType();
typeArray.setMaxt(true); //works
typeArray.setMint(true); //works
typeArray.setPop12(true);
typeArray.setWspd(true);
typeArray.setWx(true); //works
typeArray.setIcons(true);
String[] argst={"here","there"};
//I assume this constructor has no bearing on anything
Options opts=new Options(argst);
NdfdXML ndfd = new NdfdXMLLocator();
opts.setDefaultURL(ndfd.getndfdXMLPortAddress());
URL serviceURL = new URL(opts.getURL());
NdfdXMLPortType info = null;
if(serviceURL!=null)
{
info = ndfd.getndfdXMLPort(serviceURL);
}
Calendar now = new GregorianCalendar();
now.add(Calendar.DAY_OF_YEAR,0);
Calendar next = new GregorianCalendar();
next.add(Calendar.DAY_OF_YEAR,+7);
//<latitude>38.84N</latitude>
//<longitude>077.03W</longitude> is for zip 20001
BigDecimal lat = new BigDecimal(38.84);
BigDecimal lon = new BigDecimal(77.03);
info.NDFDgen(lat,lon,(ProductType.value1),(now),(next),(typeArray));
</code>
I know this probably seems vague, so I will add any other code or help
needed. Thanks for the help.
J