I am creating a web service that will authenticate login credentials of a website. In the web service, I am connecting to Cassandra through this code. This code works perfectly if I directly execute it through Java.
Below is the code I have used
Cluster cluster;
Session session;
cluster = Cluster.builder().addContactPoint("123.45.6.789").build();
session = cluster.connect("abcd");
When I run the Soap web service I get the below error
<faultstring>com/google/common/util/concurrent/AsyncFunction</faultstring>
My request message includes two parameters
<soapenv:Header/>
<soapenv:Body>
<tom:userAuthentication>
<!--Optional:-->
<arg0>user2</arg0>
<!--Optional:-->
<arg1>dtlworld</arg1>
</tom:userAuthentication>
</soapenv:Body>
Can anyone help me out where I am going wrong,
Thanks,
Raghu
Related
Using SoapUI, I send requests to a local Wifi device and get responses just fine. I would like to add a few of these to my Java/Android app just to do a simple check in the responses. For example, does the request below returns the string "apiVersion>1.1.4<" in the response? Everything I found so far is very old and I'm having a difficult time figuring it out. Any help is much appreciated!
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sdk="http://eero.lan/sdk/">
<soapenv:Header/>
<soapenv:Body>
<sdk:getVersion/>
</soapenv:Body>
</soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://eero.lan/sdk/">
<SOAP-ENV:Body>
<ns1:getVersionResponse>
<versionNumber>
<apiVersion>1.1.4</apiVersion>
<firmwareVersion>2.1.8</firmwareVersion>
</versionNumber>
</ns1:getVersionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Well, I finally found the perfect & simple solution at https://technology.amis.nl/soa/how-to-call-a-call-a-webservice-directly-from-java-without-webservice-library/
Only had to solve the "Cleartext HTTP traffic to eero.lan not permitted" because the equipment doesn't support HTTPS. Added this line to AndroidManifest.xml in the application tag: Android:usesCleartextTraffic="true"
I am using Jaxws to consume a webservice. while iam sending request i need to send an object in the request headers. When i am invoking the service from Soap-UI iam successfully getting the data. but the same in java i am unable to get it. I researched a lot on this any one know please help me how to do it.
Here is my java code
//getting the service
MyService servc = new MyService();
MyServiceSoap soap = servc.getMyServiceSoap();
//call the service
System.out.println(soap.SERVICE_A("123456789")); //getting null as response because i am not setting userid, password
I want to set the userid,password to the Authentication pojo object and set it to the soap headers and send the request. how i can do this.?
Here is my Soap-ui request screenshot
Please see the SoapUI request format
My Questions is : How to send a java object in the soap request headers.?
Thanks in Advance,
Praneeth.
From my understanding, what you're lacking is the Basic Authentication headers, where you pass the following in the HTTP header:
Authorization: Basic <Base64(username:password)>
Check in your SOAP-UI if the request sends this.
Here are some SO topics that may help you implement it:
Java Web Service client basic authentication
How do I consume a web service protected with HTTP basic authentication using the CXF framework?
Am using eclipse generated client classes(JAX bean class)..Any one please tell me how can set the request time out for a soap web service client?..
I have refered following links..
how to set request time out of web service client(java)
http://blogs.adobe.com/rohit/2013/04/30/configurable-request-timeout-for-client-side-soap-calls/
But i could not find a solution for this..
Thanks
1.I created web services in netbeans using jboss 7, n i testing by typing the url into the browser and it came up like this..
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>
No such operation: null (HTTP GET PATH_INFO: /UnitConversion11/UnitConversion11null)
</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
So does anybody knows what the problem is because I have no idea.Is there anything about the xml file? and where is the xml fil :(
I think this is because your SOAP request wasn't correctly formulated. You normally use this SOAP by posting ugly blobs of XML everywhere. Your simple GET request probably isn't handled by the application you wrote.
From my hazy memory, there is a field in the request called something like soap:operation that identifies which bit of code will end up processing the request and this is of course missing from the GET request.
You could try testing your app using something like SOAPUI, curl, httprequester (..etc) to send a properly formulated SOAP request via POST or you could adapt your code to properly handle the GET request (possibly identified by having a null soap:operation?)
HTH
I have created a WSDL and I wanted to make use of AXIS 2 as my web server.
I downloaded it into my C:\axis2-1.6.1 and set all the required installation parameters.
My question is, I deployed my *.aar file into the repository/services folder and the axis2server
was able to decompressed it and I see my web service when I navigate into the
http://localhost:8080
When I used SOAPUI to test my service, I am only getting this error.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>unknown</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Not sure but I do not see any error on the Axis console?
Where can I find any relevant info to solve this problem?
This link contains a couple of pieces of advice on configuring axis to include stacktraces in the fault message:
http://www.mail-archive.com/axis-user#ws.apache.org/msg41600.html
In case it gets removed, here's Keith Chapman's suggestion reproduced:
Try setting these two parameters in your axis2.xml
<parameter name="sendStacktraceDetailsWithFaults">true</parameter>
<parameter name="DrillDownToRootCauseForFaultReason">true</parameter>
It's not a replacement for knowing where your error output is going, but it may help with the immediate problem.