A Warning Error of Response with BEPL SOAP Connection with SAAJ - java

I am trying to consume IBM BPEL web service, which is published on a live server and consumer using core java, working fine but the code have a warning message:
Dec 10, 2013 10:18:31 AM
com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
WARNING: SAAJ0014: Invalid reply message. Content length of reply was
zero.
NOTE: As designed this web service does not reply anything (response is empty). How can I disable calling party SAAJ client not to expecting a reply from the web service response?

I suppose that BPEL has nothing to do with the web service part. From your message I understand that when you call the web service from your client, the response is empty. Therefore, the probable cause could be in the following points:
The specific web service function gets nothing from the business logic layer to return.
You have to debug using breakpoints to find if this is true.
The web service function gets something from the business logic layer but it returns nothing due to an error in the specific function. You have to debug using breakpoints to find if this is true. Maybe the flow control of the function has a bug. Or maybe a data serialization exception throws and gets lost.
The web service endpoint is not configured properly. Double check the web service endpoint configuration. IP, port, credentials, authorization. Perhaps the web service is configured to return nothing when an anonymous user is calling it.
The client calls another endpoint. Double check that the client executes the correct request. Try using another client (eg SOAP UI) to see if it gets the same response. If the response is not the same, then the problem is on the client side.
You have the setup and the code, so you have to find out what is going wrong.
Hope I helped!

Related

Glassfish request compression

We have a legacy app that uses Java Web Services (JAX-WS) and runs on Glassfish 4.1.1. We want to implement compression of both the response and request. (We know that compressed requests can be a security risk but we are willing to accept this because the clients are all internal.) Turning on the GF setting for compression only compresses the response. If I send a compressed request body I get an error that indicates the SOAP message contained an invalid character, which tells me that GF did not decompress the request body.
Since GF won't automatically decompress the request I have been trying to modify the legacy app itself to do the decompression. I have tried the following:
A SOAP message handler. This does not work because the handler is invoked too late; at that point the unmarshalling of the SOAP message has already failed, because the unmarshaller received binary data.
A servlet filter. I tried setting up one that was invoked on any URL, but it never trips for the web service calls. I am not too familiar with the plumbing here, but it does not appear that the web service is implemented as a servlet.
My next option is to try setting up a proxy server that takes the raw request, unzips it, and forwards it to the web service.
Before I go down that path, does anyone have a simpler recommendations? Is what I'm try to do even possible? Much thanks in advance!

Jersey JAX-RS 1.0 request not completed with client timesout

We are using Jersey 1.6 on a RESTful Server, when a request is started, but takes to long and the client timesout (can be replicated with postman and cancelling request) the request is only partially completed and some but not all database calls are done, leaving the database in a inconsistant state. I thought REST servers, always complete the calls no matter what happens to the client, but this does not seem to be true here. No exceptions are logged in our logging system, what does Jersey do to a request if the client timesout?
I thought REST servers, always complete the calls no matter what happens to the client, but this does not seem to be true here.
This is incorrect assumption. REST describes just the way of
interaction, it is still under service developer's responsibility to
make the database changes consistent(transactional) if needed.
No exceptions are logged in our logging system, what does Jersey do to a request if the client timesout?
It will still send the response, but the client will ignore it due to timeout.

RUN code after sending SOAP response in java

My web service get a SOAP request from user. After doing all the stuff in service could I send back the user response and then run some code ?
Actually I want to log the output of my service. If I run the code that logs the output and if that logging service fails, I could not send back any response due to that error.
IS there a way that I send user response of my service and then run logging service after that ?
I tried close method of SOAP handler but it runs before my service has returned response.
Essentially you need to find a callback (http://cleancodedevelopment-qualityseal.blogspot.co.uk/2012/10/understanding-callbacks-with-java.html) you can hook into after the http response has been accepted back from the server.
See here for a similar question: SOAP web service callback architecture? that was answered.
You should use callback function to sure that responsing is finished
Use try-catch to control the errors in your code. For your case you can control if your logging service fails or not and send the response to user.
Exceptions try
If you want to use something more complex you can use an async approach using queues or events.
in JEE you can use "#Asynchronous" annotation for the method that need to log. It will run asynchronously, so it will not block the return of the webservice.
If you need the result of that method, you will need manage to store the reference of the Future, for example in a singleton, then get the esult in a second Webservice call.

Java Jersey - Rest connections through a proxy

I developed an application in java that needs to consume a set of webservices provided by a provider.
Basically I need to call a first rest webservice to connect to the system, in which I pass username and password in the body of the post rest call.
Without using proxies I can make a second rest call without passing username and password, the webservice provider recognises me.
But when I use a proxy this second call does not work any more, I get an HTTP 401 error.
Notice that the first connect call works well also with the proxy.
Is there something conceptual that I'm missing?
Anyone knows what is happening?
Thank you
If you're making only a single login request and then making follow up requests which do not supply credentials, the service you are consuming probably is using cookies to track a user session.
When you put a proxy between yourself and that service, if the proxy is not forwarding all of your HTTP header information (where the cookie is probably being exchanged with the service), then the service will no longer recognize your session and consider you unauthorized
You may need to better understand how the service is maintaining your session (is it using Set-Cookie headers that it expects you to send back?) And you need to understand if the proxy you are using is forwarding all of your headers to the service

Inspecting request/response from Java/spring web service client

I have a client written in Java using the Springsource toolkit (that is, the #Service attribute) that is talking to an external webservice (completely seperate, nothing to do with my company) via HTTPS. I'm getting an exception on the marshalSendAndReceive step, which states that the content-type is coming back as text/html instead of the expected text/xml - with the message "could this be an error message?"
The webservice itself is the public test for the next version of the service, and calling the live service from the same code works fine. This particular method I am calling works fine on the live system but not on the test system.
My hunch is that the request is not correctly formatted for the test system - although only the response should have changed in the schema according to the release notes - and this is causing the service to return an error that is incorrectly parsed by my client. I am getting this error with all requests, even those that (according to the release notes) have not changed.
I have tried to use Fiddler and Wireshark to inspect the traffic, but can't get Fiddler to see it at all (I suspect this is a problem using Tomcat in STS with a proxy) and Wireshark can't decode the HTTPS stuff (I don't have the keys). I can't use HTTP, as the external service returns 403 Forbidden if I try.
I'm not the original developer, and I'm not even a Java developer. I am an experienced .NET developer, so any analogies with that will be understood - otherwise, I am a dummy and phrase your instructions/questions/possible help accordingly. As instructed by my predecessor, I have created a JAR file from the WSDL using XmlBeans and added that as a referenced library but I can't be sure that I've done that correctly, or even what it is that that is doing. It doesn't appear to have a discernable effect on things.
How can I debug this problem, and verify whether it is a problem with my client or their service?
My first goal would be getting Fiddler working. It is difficult to debug in the dark. However, where I get confused is when you discuss your client running in Tomcat in STS. Is your client a webapp?
Have you tried other tools like SoapUI to validate that the service is responding to your requests as expected?

Categories

Resources