aspose file tools*
The moose likes Web Services and the fly likes Webservice runtime error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice runtime error" Watch "Webservice runtime error" New topic
Author

Webservice runtime error

Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
I am new to webservices and this is my first webservice impl... My requirement is to send xml files to weblogic server.

I get this error when I try to call the webservice

403 Forbidden Error: The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

I wrote a wsdl and generated java classes from wsdl and created an ear file and deployed it in weblogic 10.1 I did not get any error during deployment.

My wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://com.web/webservices/HWebServiceHandler/"
xmlns:ns2="http://java.sun.com/jax-rpc-ri/internal"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
name="HWebServiceHandler"
targetNamespace="http://com.web/webservices/HWebServiceHandler/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://java.sun.com/jax-rpc-ri/internal"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://java.sun.com/jax-rpc-ri/internal">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

<simpleType name="text_xml">
<restriction base="hexBinary"/>
</simpleType>
</schema>
</wsdl:types>
<wsdl:message name="HWebService_storeDocumentXML">
<wsdl:part name="Source_1" type="ns2:text_xml"/>

</wsdl:message>
<wsdl:message name="HWebService_storeDocumentXMLResponse">
<wsdl:part name="result" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="HWebServiceHandler">
<wsdlperation name="storeDocumentXML" >
<wsdl:input message="tns:HWebService_storeDocumentXML"/>
<wsdlutput message="tns:HWebService_storeDocumentXMLResponse"/>
</wsdlperation>
</wsdl:portType>
<wsdl:binding name="HWebServiceBinding" type="tns:HWebServiceHandler">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<wsdlperation name="storeDocumentXML">
<soapperation soapAction="http://com.web/webservices/HWebServiceHandler/storeDocumentXML"/>
<wsdl:input>
<mime:multipartRelated>

<mime:part name="Cas">
<mime:content part="Source_1" type="text/xml"/>
</mime:part>
</mime:multipartRelated>
<soap:body
use="literal"
namespace="http://com.web/webservices/"/>
</wsdl:input>
<wsdlutput>
<soap:body
use="literal"
namespace="http://com.web/webservices/"/>
</wsdlutput>
</wsdlperation>
</wsdl:binding>
<wsdl:service name="HWebServiceHandler">
<wsdl:port name="HWebServicePort" binding="tns:HWebServiceBinding">
<soap:address xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
location="http://localhost:7001/HWebService/HWebServiceHandlerImpl"/>
</wsdl:port>

</wsdl:service>
</wsdl:definitions>


Please give me some guidance to resolve this error. Please do suggest me if there are any other alternatives to do the same.

Thanks in advance,

Preethi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
The SOAP location mentions "http://localhost:7001/...", so the server should be running on your own machine - maybe the log files of the server have more information?


Ping & DNS - my free Android networking tools app
Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
The error stack trace is [JAM] Warning: failed to resolve class com.web.webservices.hwebserviceh
andler.HWebServiceHandlerImpl
<04-Dec-2009 10:04:02 o'clock GMT> <Warning> <netuix> <BEA-423420> <Redirect is
executed in begin or refresh action. Redirect url is /console/console.portal?_nf
pb=true&_pageLabel=WebServiceModuleOverviewPage&WebServiceModuleOverviewPortleth
andle=com.bea.console.handles.ModuleHandle%28%22com.bea%3AName%3DHWebServiceEa
r%2CType%3DAppDeployment%3BHWebServiceHandlerImpl.war%3BHWebService%3Bcom.web
.webservices.hwebservicehandler.HWebServiceHandlerImpl%3BWEBSERVICE%
22%29.>
java.lang.NullPointerException
at com.web.webservices.hwebservicehandler.HWebServiceHandlerI
mpl.storeDocumentXML(Ljavax.xml.transform.Source;)Ljava.lang.String;(Unknown Sou
rce)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
I)Ljava.lang.Object;(Unknown Source)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassCompo
nent.java:99)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(Compo
nentHandler.java:64)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.j
ava:123)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDisp
atcher.java:85)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.j
ava:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java
:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseW
SServlet.java:257)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java
:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3370)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.ac
l.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSub
ject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2117)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2023)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
java.lang.NullPointerException
at com.web.webservices.hwebservicehandler.HWebServiceHandlerI
mpl.storeDocumentXML(Ljavax.xml.transform.Source;)Ljava.lang.String;(Unknown Sou
rce)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
I)Ljava.lang.Object;(Unknown Source)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassCompo
nent.java:99)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(Compo
nentHandler.java:64)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.j
ava:123)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDisp
atcher.java:85)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.j
ava:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java
:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseW
SServlet.java:257)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java
:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3370)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.ac
l.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSub
ject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2117)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2023)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
java.lang.NullPointerException
at com.web.webservices.hwebservicehandler.HWebServiceHandlerI
mpl.storeDocumentXML(Ljavax.xml.transform.Source;)Ljava.lang.String;(Unknown Sou
rce)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
I)Ljava.lang.Object;(Unknown Source)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassCompo
nent.java:99)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(Compo
nentHandler.java:64)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.j
ava:123)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDisp
atcher.java:85)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:80)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.j
ava:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java
:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseW
SServlet.java:257)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java
:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:226)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:124)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3370)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.ac
l.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSub
ject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:2117)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:2023)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)



But in my ear I have com.web.webservices.hwebserviceh
andler.HWebServiceHandlerImpl in classes directory. Is there anything else that I need to do while creating ear file using weblogic ant task to generate java from wsdl and then build the ear??

Thanks
Preethi

Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
In my client I get this error:

2009-12-04 11:35:00.613 WARNING OWS-03005 Unable to connect to URL: http://111.1
.9.21:7001/HWebService/HWebServiceHandlerImpl due to java.security.Privileg
edActionException: javax.xml.soap.SOAPException: Error serializing message: Unab
le to write XML attachment null
09/12/04 11:35:00 java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.Privil
egedActionException: javax.xml.soap.SOAPException: Error serializing message: Un
able to write XML attachment null
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
The actual problem seems to be this:

java.lang.NullPointerException
at com.web.webservices.hwebservicehandler.HWebServiceHandlerImpl.storeDocumentXML
(Ljavax.xml.transform.Source;)Ljava.lang.String

That's where I would start looking - which object is null, and why might it be.
Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
The Source_1 object is null.....I tried to test the webservices from weblogic test client and when I pass xml in Source_1 object it prints the soap message with my xml as request object but in my console I get the error I posted before.... I see request which comes has the xml in Source_1 but when I try to read it my webservices method it throws NullPointerException.
Preethi Krishna
Greenhorn

Joined: May 13, 2009
Posts: 11
any inputs on why I get this error:

[JAM] Warning: failed to resolve class com.web.webservices.hwebservicehandler.HWebServiceHandlerImpl
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webservice runtime error