wood burning stoves 2.0*
The moose likes Web Services and the fly likes java web service stub  error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "java web service stub  error" Watch "java web service stub  error" New topic
Author

java web service stub error

gigi span
Greenhorn

Joined: Jul 31, 2011
Posts: 2
Hi,

I have created a dynamic project with eclipse SDK, generated the stubs from a wsdl file (http://83.244.237.143:9595/jethrobridge/server?wsdl) and wrote the following code to request the service:

import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.axis.types.URI.MalformedURIException/Exception/Server/ServerPortBindingStub/ServerProxy/ServerServiceLocator...

public class consume
{

public static void main(String[] args) throws RemoteException, ServiceException {
// TODO Auto-generated method stub
org.jpos.isobridge.ServerService tmp = new org.jpos.isobridge.ServerServiceLocator();
org.jpos.isobridge.Server s = tmp.getServerPort();

System.out.print(s.request("1", "2", 1000000000));
}
}

I am running a tomcat server on the localhost.
When i run the application i get a stack of errors, mainly(bottom):

I don't have much practice with web services/soap libraries so that the error message doesn't reveal me much.
Any suggestion or a different approach to make the request. (signature is: public String request (String destination, String s, long timeoutInMillis) )

Thank you
ion


Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in prolog.
faultActor:
faultNode:
faultDetail:
{http://jax-ws.dev.java.net/}exception:<message>org.xml.sax.SAXParseException: Content is not allowed in prolog.</message><ns2:stackTrace><ns2:frame class="org.jpos.iso.packager.XMLPackager" file="XMLPackager.java" line="136" method="unpack"/><ns2:frame class="org.jpos.iso.ISOMsg" file="ISOMsg.java" line="420" method="unpack"/><ns2:frame class="org.jpos.isobridge.Server" file="Server.java" line="61" method="request"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="39" method="invoke"/><ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="25" method="invoke"/><ns2:frame class="java.lang.reflect.Method" file="Method.java" line="597" method="invoke"/><ns2:frame class="com.sun.xml.ws.api.server.InstanceResolver$1" file="InstanceResolver.java" line="246" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="146" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="257" method="invoke"/><ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="598" method="__doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="557" method="_doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="542" method="doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="439" method="runSync"/><ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="243" method="process"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="471" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="244" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="135" method="handle"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="129" method="doGet"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="160" method="doPost"/><ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServlet" file="WSServlet.java" line="75" method="doPost"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/><ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service"/><ns2:frame class="org.eclipse.jetty.servlet.ServletHolder" file="ServletHolder.java" line="534" method="handle"/><ns2:frame class="org.eclipse.jetty.servlet.ServletHandler" file="ServletHandler.java" line="476" method="doHandle"/><ns2:frame class="org.eclipse.jetty.server.handler.ScopedHandler" file="ScopedHandler.java" line="119" method="handle"/><ns2:frame class="org.eclipse.jetty.security.SecurityHandler" file="SecurityHandler.java" line="517" method="handle"/><ns2:frame class="org.eclipse.jetty.server.session.SessionHandler" file="SessionHandler.java" line="226" method="doHandle"/><ns2:frame class="org.eclipse.jetty.server.handler.ContextHandler" file="ContextHandler.java" line="935" method="doHandle"/><ns2:frame class="org.eclipse.jetty.servlet.ServletHandler" file="ServletHandler.java" line="404" method="doScope"/><ns2:frame class="org.eclipse.jetty.server.session.SessionHandler" file="SessionHandler.java" line="184" method="doScope"/><ns2:frame class="org.eclipse.jetty.server.handler.ContextHandler" file="ContextHandler.java" line="870" method="doScope"/><ns2:frame class="org.eclipse.jetty.server.handler.ScopedHandler" file="ScopedHandler.java" line="117" method="handle"/><ns2:frame class="org.eclipse.jetty.server.handler.ContextHandlerCollection" file="ContextHandlerCollection.java" line="247" method="handle"/><ns2:frame class="org.eclipse.jetty.server.handler.HandlerCollection" file="HandlerCollection.java" line="151" method="handle"/><ns2:frame class="org.eclipse.jetty.server.handler.HandlerWrapper" file="HandlerWrapper.java" line="116" method="handle"/><ns2:frame class="org.eclipse.jetty.server.Server" file="Server.java" line="346" method="handle"/><ns2:frame class="org.eclipse.jetty.server.HttpConnection" file="HttpConnection.java" line="596" method="handleRequest"/><ns2:frame class="org.eclipse.jetty.server.HttpConnection$RequestHandler" file="HttpConnection.java" line="1068" method="content"/><ns2:frame class="org.eclipse.jetty.http.HttpParser" file="HttpParser.java" line="807" method="parseNext"/><ns2:frame class="org.eclipse.jetty.http.HttpParser" file="HttpParser.java" line="220" method="parseAvailable"/><ns2:frame class="org.eclipse.jetty.server.HttpConnection" file="HttpConnection.java" line="426" method="handle"/><ns2:frame class="org.eclipse.jetty.io.nio.SelectChannelEndPoint" file="SelectChannelEndPoint.java" line="520" method="handle"/><ns2:frame class="org.eclipse.jetty.io.nio.SelectChannelEndPoint$1" file="SelectChannelEndPoint.java" line="40" method="run"/><ns2:frame class="org.eclipse.jetty.util.thread.QueuedThreadPool$3" file="QueuedThreadPool.java" line="528" method="run"/><ns2:frame class="java.lang.Thread" file="Thread.java" line="619" method="run"/></ns2:stackTrace>

org.xml.sax.SAXParseException: Content is not allowed in prolog.





Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
If you are to develop a web service client, do try the following tutorial: http://netbeans.org/kb/docs/websvc/client.html
I feel the Eclipse web service tooling is complicating things, especially for beginners.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
gigi span
Greenhorn

Joined: Jul 31, 2011
Posts: 2
Ivan Krizsan wrote:Hi!
If you are to develop a web service client, do try the following tutorial: http://netbeans.org/kb/docs/websvc/client.html
I feel the Eclipse web service tooling is complicating things, especially for beginners.
Best wishes!


Dear Ivan,

Thanks a lot for the reply.
Should i be worried if i get the same erroneous output when testing the web service with an online tool like this: http://www.soapclient.com/soaptest.html
The service is down for the moment

Thanks once more

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I suggest using soapUI http://www.soapui.org/ (free version available) to test your web service.
The computer to which you deployed your web service may not be accessible from the internet and thus you will not be able to use the web service testing webpage you supplied a link to.
With soapUI you can test your own web service deployed on your own machine with a minimum of effort.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java web service stub error