sam barker

Ranch Hand
+ Follow
since Apr 26, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sam barker

Is my code faulty?.Does anyone have any suggestions
15 years ago
Hi All,
I am trying to connect to IIS server and trying to get an ASPX page.
But I always get the error Error in HTTP operation.
I tried a similar code(I had set the user agent) for getting a JSP page on Tomcat,but that seems to work fine.

I have pasted my code below.It always throws an IO exception at c.flush()

Any suggestion would be greatlt appreciated.


HttpConnection c = (HttpConnection) Connector.open("http://localhost:2021/test.aspx");
String rawData = "orders="+"none"+"&cust="+"cus1"+"&mob="+"none";

String type = "application/x-www-form-urlencoded";
c.setRequestMethod(HttpConnection.POST);

c.setRequestProperty( "Content-Type", type );
c.setRequestProperty("Content-Language","en-US");
c.setRequestProperty( "Content-Length", Integer.toString(rawData.length()));

OutputStream os = c.openOutputStream();
os.write( rawData.getBytes() );
os.flush();

if ((i=c.getResponseCode()) == HttpConnection.HTTP_OK)
{

sb = new StringBuffer();
int ch;

is = http.openInputStream();
while ((ch = is.read()) != -1)
sb.append((char) ch);

reply=sb.toString();
}

c.close();




Cheers,
Sam
15 years ago
Hi,

I am having the following problem.

From class1(which extends Canvas) depending on the key pressed,
I change the display and try to change the font colour(in the new display).

The problem is that when the repaint has no effect and only when I exit keyPressed function I see the final colour change for image created by paint for class2

public void keyPressed(int keyCode)
{
if(keyCode == Canvas.KEY_POUND)
{
Display.getDisplay(this).setCurrent(class2_obj);//class2 extends canvas
repaint();//Should call class2 paint()
.....
.....
repaint();//Should call class2 paint()
}
}
15 years ago
If you are using axis ,
youcan do the following(provided you are running the server on your machine)
http://localhost:8080/axis

And then choose "List services"
16 years ago
Hi,
I was trying to deploy a webapp.When I ran the java deploy.wsdd,I got the Http return code 500.While I was looking up the error log ,I found that it couldnot find
java.lang.NoClassDefFoundError: org/apache/axis/encoding/Deserializer
But I have copied the axis,jar into tomcat/common/lib folder.Infact I have copied all the jar files from axis/WEB-INF/lib into tomcat/common/lib folder.
Still the error persists.Has anyone faced this problem before

The error log
===============================================================

Exception: AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (500)Internal Server Error
faultActor:
faultNode:
faultDetail:
{}:return code: 500
<html><head><title>Apache Tomcat/5.5.9 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>javax.servlet.ServletException: Servlet.init() for servlet AxisServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:534)
</pre></p><p><b>root cause</b> <pre>java.lang.NoClassDefFoundError: org/apache/axis/encoding/Deserializer
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:219)
org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
java.security.AccessController.doPrivileged(Native Method)
org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDDTypeMapping.java:183)
org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:542)
org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:253)
org.apache.axis.deployment.wsdd.WSDDService.&lt;init&gt;(WSDDService.java:233)
org.apache.axis.deployment.wsdd.WSDDDeployment.&lt;init&gt;(WSDDDeployment.java:192)
org.apache.axis.deployment.wsdd.WSDDDocument.setDocument(WSDDDocument.java:139)
org.apache.axis.deployment.wsdd.WSDDDocument.&lt;init&gt;(WSDDDocument.java:65)
org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179)
org.apache.axis.AxisEngine.init(AxisEngine.java:172)
org.apache.axis.AxisEngine.&lt;init&gt;(AxisEngine.java:156)
org.apache.axis.server.AxisServer.&lt;init&gt;(AxisServer.java:88)
org.apache.axis.server.DefaultAxisServerFactory.createServer(DefaultAxisServerFactory.java:109)
org.apache.axis.server.DefaultAxisServerFactory.getServer(DefaultAxisServerFactory.java:73)
org.apache.axis.server.AxisServer.getServer(AxisServer.java:73)
org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:185)
org.apache.axis.transport.http.AxisServletBase.getOption(AxisServletBase.java:396)
org.apache.axis.transport.http.AxisServletBase.init(AxisServletBase.java:112)
org.apache.axis.transport.http.AxisServlet.init(AxisServlet.java:156)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:534)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/5.5.9</h3></body></html>
{http://xml.apache.org/axis/}HttpErrorCode:500

-
=========================================================
Cheers,
Sam
16 years ago
Hi,
I have designed a test.wsdl and mine.xsd.
A part of my wsdl and xsd doc is as below

xsd:schema targetNamespace="http://www.example.org/test/" xmlns:Q1="http://www.example.org/resource/Iternary">
<xsd:import schemaLocation="mine.xsd" namespace="http://www.example.org/resource/Iternary"></xsd:import>
<xsd:element name="OperationResponse"
type="Q1:booking_request">

</xsd:element>
<xsd:element name="OperationResponse"
type="Q1:reply_details">

</xsd:element>


</xsd:schema>

============================================================
A part of my .xsd document is..

<element name="booking_request" type="c:booking_request"></element>

<complexType name="booking_request">
<sequence>
<element name="card_details type="c:credit_card"></element>
.......
.......
.......
//There are some more complex types here

</sequence>
</complexType>

=====================================================================
When I used this to generate the client code
SOAPImpl.java has the request as

public void newOperation(org.example.www.resource.Iternary.Credit_card card_details,
.....
.....
org.example.www.resource.Iternary.holders.Flight_iternaryHolderflight2, org.example.www.resource.Iternary.holders.Personal_descriptionHolder newElement) throws java.rmi.RemoteException {
flight2.value = new org.example.www.resource.Iternary.Flight_iternary();
newElement.value = new org.example.www.resource.Iternary.Personal_description();
}


What are these new holder parameters generated?
Shouldnt I get a interface like

public void newOperation(org.example.www.resource.Iternary.booking_request)
since I have specified only one complex element as the input

Cheers,
Sam
16 years ago
Solved the problem.I should have been using the service locator to connect.
16 years ago
Yeah I had regenerated the client and server side.
But the SOAP operation is still
wsdlsoap peration soapAction="http://www.example.org/MyFirstWSDLFile/MyFirst"/>

Is that alright
16 years ago
No but I have changed it now.
I changed the SOAP:address in my WSDL file

<soap:address location="http://localhost:8080/axis/services/MyFirstWSDLFileSOAP"/>

But after compiling the server and client code I am still getting the same error..
16 years ago
My bad ....you are correct.I ran that,then wrote a client.it looks like something like this...

MyWSDLFileSOAPStub x= new MyWSDLFileSOAPStub();
String z=x.myFirst("ho", "srte");//garbage arguments
System.out.println(z);



But when I run this I am getting an exception.....


Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoEndpoint
faultSubcode:
faultString: No endpoint
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}exceptionName rg.apache.axis.NoEndPointException
{http://xml.apache.org/axis/}stackTrace:No endpoint
at org.example.www.MyFirstWSDL.MyFirstWSDLSOAPStub.myFirst(MyFirstWSDLSOAPStub.java:94)
at MyFirstClient.main(MyFirstClient.java:10)
at org.example.www.MyFirstWSDL.MyFirstWSDLFileSOAPStub.myFirst(MyFirstWSDLSOAPStub.java:94)

=========================================================================
The exception is thrown because super.cacheendpoint is null

public java.lang.String myFirst(java.lang.String time, java.lang.String loc) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("http://www.example.org/MyFirstWSDLFile/MyFirst");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://www.example.org/MyFirstWSDLFile/", "MyFirst"));

setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {time, loc});

if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (java.lang.String) _resp;
} catch (java.lang.Exception _exception) {
return (java.lang.String) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}

Cheers,
Sma
16 years ago
Hi,
I am trying to develop a web service(my first) using the top down approach.
I was able to develop,validate and deploy the service.
How do I create a client the working of the service.

I know that at first you get an instance of the service locator..ie
MyWSDLFile_ServiceLocator test=new MyWSDLFile_ServiceLocator();

But after that I couldnt get the stub of the service as ServiceLocator does not have the appropriate get.... function..I hope I am clear.

Cheers,
Sam
16 years ago
Finally got something working.
But still I am getting an exception when I run the client.Now I am using exmaple from the javaranch tutorial

http://www.javaranch.com/journal/2002/05/axis.html

When I run the client I get the error

c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath %AXISCLASSPATH%;. HelloClient -p8080 barker
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectR
esourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/OperationT
ype
at org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java
:59)
at org.apache.axis.client.Call.addParameter(Call.java:968)
at org.apache.axis.client.Call.addParameter(Call.java:1003)
at HelloClient.main(HelloClient.java:30)

Where am I going wrong?
16 years ago
sorry about that.I had found another program and I was testing that.
the command is

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath .;"%AXISCLASSPATH%" TestClient -p8080 getQuote 1 2
16 years ago
I have changed the AXISCLASSPATH to
"%AXIS_LIB%\axis.jar";"%AXIS_LIB%\commons-discovery.jar";"%AXIS_LIB%\commons-logging.jar";"%AXIS_LIB%\jaxrpc.jar";"%AXIS_LIB%\saaj.jar";"%AXIS_LIB%\log4j-1.2.8.jar";"%AXIS_LIB%\xml-apis.jar";"%AXIS_LIB%\xercesImpl.jar"

but when i run the command..I still get the error
Exception in thread "main" java.lang.NoClassDefFoundError: HotelClient
16 years ago
Hi,
I have placed the ClientTest in the axis folder.
When I included it in the class path
I gt the error
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath .;%AXISCLASSPATH% HotelClient -p8080 getQuote 1 2
Exception in thread "main" java.lang.NoClassDefFoundError: Files/Apache


Thats weird..
16 years ago