Getting faultCode=WSDL4JWrapper When Executing WS Client - web-services

I needed some help fixing this issue that i am facing currently with WS class. When i execute the client i get this exception. I googled for a solution, but done seem to find anything that would help.
The exception that i see is this:
Exception in thread "main" javax.xml.ws.WebServiceException: The following WSDL exception occurred: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9090/TimeServiceWS/services/TimeServerImplService
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1202)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:249)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.<init>(ServiceDescriptionImpl.java:172)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:134)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:78)
at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:218)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:83)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:79)
at javax.xml.ws.Service.<init>(Service.java:77)
at javax.xml.ws.Service.create(Service.java:707)
at ch01.ts.TimeServerConsumer.main(TimeServerConsumer.java:47)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9090/TimeServiceWS/services/TimeServerImplService
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:234)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>(WSDL4JWrapper.java:156)
at org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.setupWsdlDefinition(ServiceDescriptionImpl.java:1182)
... 11 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=WSDL4JWrapper : : java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9090/TimeServiceWS/services/TimeServerImplService
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:203)
... 13 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:9090/TimeServiceWS/services/TimeServerImplService
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
at org.apache.axis2.jaxws.util.WSDL4JWrapper$14.run(WSDL4JWrapper.java:974)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.getInputStream(WSDL4JWrapper.java:971)
at org.apache.axis2.jaxws.util.WSDL4JWrapper.commonPartsURLConstructor(WSDL4JWrapper.java:189)
... 13 more
I have deployed my WS in Tomcat. If you need the code and the WSDL, let me know, I would provide it. I asked this on some other forums as well without any help. So some help would be appreciated.

This one in particular looks like your path
http://localhost:9090/TimeServiceWS/services/TimeServerImplService
is having some sort of internal error. I would look at your logs but without any other code it is impossible to tell.

Related

I get a 302 error when I use websocket in my code

I made an alarm system by using websockets.
It worked on localhost.
But after I put my project on AWS and the domain that I bought, I got an 302 error message with details as below:
login.htm:125 WebSocket connection to 'ws://52.79.243.89:8080/Apollo/socket.htm' failed: Error during WebSocket handshake: Unexpected response code: 302
And this is my code:
var wsocket;
function connect() {
wsocket = new WebSocket("ws://52.79.243.89:8080/Apollo/socket.htm");
}
Can someone please help me?

The MessageContext does not have an associated SOAPFault

i am call web service with axis2 plugin .The methodology used is rpc.
the code main is :
GetPayIDBillIDStub stub = new GetPayIDBillIDStub("http://80.91.4.113:8088/services/GetPayIDBillID_Proxy");
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
GetPayIDBillIDStub.PaymentInput input = new GetPayIDBillIDStub.PaymentInput();
input.setPassword("123456");
input.setTelephone(2111111111);
input.setUsername("test");
paymentTelOPR.setPaymentTelOPRRequest(input);
org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
paymentTelOPRResponseE = stub.paymentTelOPR(paymentTelOPRE.setPaymentTelOPRRequest(paymentTelOPR.getOMElement(GetPayIDBillIDStub.PaymentTelOPR.MY_QNAME, factory)));
error is :
Exception in thread "main" java.lang.IllegalArgumentException: The MessageContext does not have an associated SOAPFault.
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:556)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at mypackage.GetPayIDBillIDStub.paymentTelOPR(GetPayIDBillIDStub.java:182)
at Run.main(Run.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
help for me.
We recently had this Problem because the response contained no SOAPFault (in fact was the expected answer to the service call) but the http status code of the response was 5xx (500 in our case).
Maybe something similar in your case.
You can verify this by using an generic Webservice client like SoapUI which can also display the raw hhtp response.
I know it is a late answer, but I can help the new engineers with my experience.
I got the same error where I was using SOAP UI with my API. The problem started when I replaced my mocked response by a fault response just for testing it. But once I retried to use the correct code, it didn't work and it gave me this error.
The solution was: that I have to delete the response because it is considered as a fault response and missing the fault code, When I created a new response and deleted the old one, it worked without getting this exception

How can I configure http basic auth in a web service accessed through Talend Open Studio?

As an example, I have an About web-service, which only method getVersion return the application version.
I can easily call it through SoapUI :
But, accessing it through a Job in Talend seems impossible.
I tried the simplest one :
Configured with authentication checked and admin/**** as user/password.
however, each time I run my job, it ends with the following error
Démarrage du job About a 14:04 18/10/2013.
[statistics] connecting to socket on port 4025
[statistics] connected
Exception in component tWebService_1
org.apache.ws.commons.schema.XmlSchemaException: Server returned HTTP response code: 401 for URL: http://localhost:8080/digital-express-soap/AboutService?xsd=1
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:710)
at org.apache.ws.commons.schema.SchemaBuilder.resolveXmlSchema(SchemaBuilder.java:706)
at org.apache.ws.commons.schema.SchemaBuilder.handleImport(SchemaBuilder.java:538)
at org.apache.ws.commons.schema.SchemaBuilder.handleSchemaElementChild(SchemaBuilder.java:1513)
at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:659)
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:540)
at org.talend.webservice.helper.ServiceDiscoveryHelper.getSchemaCollection(ServiceDiscoveryHelper.java:363)
at org.talend.webservice.helper.ServiceDiscoveryHelper.init(ServiceDiscoveryHelper.java:130)
at org.talend.webservice.helper.ServiceDiscoveryHelper.<init>(ServiceDiscoveryHelper.java:90)
at org.talend.webservice.helper.ServiceInvokerHelper.<init>(ServiceInvokerHelper.java:98)
at test_lct.about_0_1.About.tWebService_1Process(About.java:300)
at test_lct.about_0_1.About.runJobInTOS(About.java:559)
at test_lct.about_0_1.About.main(About.java:425)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/digital-express-soap/AboutService?xsd=1
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at org.apache.ws.commons.schema.XmlSchemaCollection$2.run(XmlSchemaCollection.java:738)
at org.apache.ws.commons.schema.XmlSchemaCollection$2.run(XmlSchemaCollection.java:737)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.ws.commons.schema.XmlSchemaCollection.parseDoPriv(XmlSchemaCollection.java:736)
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:705)
... 12 more
[statistics] disconnected
So it appears my server don't accept the provided auth. What is really strange, given that debugging my realm reveals that some authenticated calls are made. However, it also seems the last call is unauthorized. Why ?
EDIT
I did some more tests by enabling HTTP logging in Glassfish, then perform one test for each tool.
Using soapui, I get
"127.0.0.1" "NULL-AUTH-USER" "07/Nov/2013:10:45:51 +0100" "POST /digital-express-soap/AboutService HTTP/1.1" 401 1069
"127.0.0.1" "admin" "07/Nov/2013:10:45:51 +0100" "POST /digital-express-soap/AboutService HTTP/1.1" 200 247
And using Talend Open Studio for Data Integration 5.3.1, I get
"127.0.0.1" "NULL-AUTH-USER" "07/Nov/2013:11:03:27 +0100" "POST /digital-express-soap/AboutService HTTP/1.1" 401 1069
"127.0.0.1" "admin" "07/Nov/2013:11:03:27 +0100" "POST /digital-express-soap/AboutService HTTP/1.1" 200 247
which, as far as I know, is exactly the same. So the order in which queries are made to my server is the same, but the way the client interprets it change.
So my question can now be changed to "why Talend can't interpret correctly the 401 return from server when soapui can, considering both are based upon similar open-source web-services stacks ?"

Uncaught Oauth Exception

I have a php application calling the Graph API. It's been working for almost a year and stopped working today with the following error:
Fatal error: Uncaught OAuthException: This IP can't make requests for that application. thrown in /mnt/var/vcap.local/dea/apps/nn-6-38e7eee3a80186c674057d8c08ede661/app/vendor/facebook/php-sdk/src/base_facebook.php on line 1133
The server is through appfog and the hostname is: nn.aws.af.cm
I've looked through posts suggesting that I add the IP to a whitelist. This did not solve the problem. (54.236.159.122)
I'd appreciate it if someone could provide the correct answer. Thanks in advance for your time.

Restful Webservices javax.servlet.ServletException: An error occurred performing resource injection on managed bean itemController

I'm trying out an Jax-RS example that involves EJB+JPA+JSF. i can normally run the example but when i remove the comments below in Stateless EJB bean;
// #Context
// private UriInfo uriInfo;
/* #POST
#Path("book")
#Consumes(MediaType.APPLICATION_JSON)
public Response createJaxbBook(JAXBElement<Book> bookJaxb) {
Book book = bookJaxb.getValue();
book.setIsbn(numberGenerator.generateNumber());
em.persist(book);
em.flush(); // to get the id
URI bookUri = uriInfo.getAbsolutePathBuilder().path(book.getId().toString()).build();
Response resp = Response.created(bookUri).build();
logger.fine("ItemEJB.createJaxbBook():" + resp.toString());
return resp;
} */
when i run the example with uncommented version, i get error so that ;
HTTP Status 500 -
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: An error occurred performing resource injection on managed bean itemController
root cause
com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean itemController
root cause
com.sun.faces.spi.InjectionProviderException: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting invoke lifecycle method private void org.beginningee6.training.web.ItemController.initList()
root cause
com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting invoke lifecycle method private void org.beginningee6.training.web.ItemController.initList()
root cause
java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
root cause
java.lang.reflect.InvocationTargetException
root cause
javax.ejb.EJBException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
root cause
javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
root cause
javax.ejb.CreateException: Could not create stateless EJB
root cause
java.lang.NullPointerException
note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.
GlassFish Server Open Source Edition 3.1.1
When i insert a record to database with curl ;
curl -X POST --data-binary "{ \"title\":\"book333\", \"price\":\"24.0\", \"description\":\"3rd Scifi IT book\", \"illustrations\":\"false\", \"isbn\":\"134-234\", \"nbOfPage\":\"241\" }" -H "Content-Type: application/json" -H "Accept: application/json" http://localhost:8080/Lab17-REST/rs/items/book
then refresh the page, project is normally running. How can i candle this issue.