In many Java specification I found SOAP support/run different protocols like HTTP, HTTPS, FTP, SMTP etc.
I searched on google but not found any example or implementation.
So can anyone here help me to understand this using example?
I haven't done it, but my assumption is it's just about the payload format, which would be Soap format. Your Webservice client, will consume the payload from an ftp location and do the processing just like http.
Related
This is one of those SO 'questions' that i've already answered, but am posting b/c there seems to be next to zero information out there based on a week of Googling.
TL;DR: WCF MTOM encoded BasicHttpBinding client to external/3rd part, non-.NET web service chokes on XOP processing of MTOM response - basically MTOM encoder seems to be expecting a base64 payload in binary element, but runs in to the ... directive and fails deserializing SOAP/XML to runtime object, thus throwing error in this question's Title.
Error: End element 'MyBinaryData' from namespace 'http://mynamespace' expected. Found element 'xop:Include' from namespace 'http://www.w3.org/2004/08/xop/'
As previously noted, there's not much out there on this topic, i'm guessing b/c MS wrote most of their WCF documentation based on service development, and not so much client (although there is some, to be fair).
I'm not going to go in to the nitty-gritty initial set up b/c i'm about to answer my own question, but i'll preface the answer by saying that this was much more akin to a default configuration of WCF MTOM than not.
Also, i know WCF is old, boring, and no longer actively developed by MS, but it is still supported and there are plenty of uses for it. I actually i didn't have much of a choice and had to find a way to make this work. This is why i'm sharing my findings with anyone else that has to deal with this kind of headache.
TL;DR: check http headers to see if service response is "Transfer-Encoding: chunked" (streamed) to you and if so, use transferMode="StreamedResponse" in your binding configuration.
So after Googling for days with no help, i spun up Fiddler for http traffic capture - this requires your WCF basic http binding configuration to proxy in to Fiddler (http://localhost:8888 by default, i think) and depending on where your target service resides you may or may not need to configure Fiddler's Gateway settings (corporate proxy, etc.).
This allowed me to see the raw text being sent between my client to/from their service; all payloads were coming in just fine, which meant, in my case, that the MTOM/XOP response from the service was being completely transmitted and that the WCF runtime was not interpreting the response correctly. Another critical thing i saw was that the Transfer-Encoding http header was "chunked" and there was no Content-Length header... this meant that the service was streaming the response, as opposed to a buffered response. Now a little side note: MS's WCF MTOM documentation has a call-out saying that you should always use "Buffered" as your transferMode in your binding configuration... but failed to mention that was really only applicable in Services, not necessarily clients!
So naturally, i simply went in to my config file, found system.serviceModel >> bindings >> basicHttpBinding collection, found my specific binding configuration and set transferMode="StreamedResponse" (because the 3rd party service was streaming my response back to my client).
I have a problem.. I use "GWT"; I have a string in client side.
I would send this string to server with a HTTP POST request but I have no idea how to do this..
What is the code that I have to write on client side and server side???
please help
I think you should have a look into the official documentation:
Dev Server Commmunication
I am not a big fan of RPC, so I'd suggest to you the HTTP calls here
As the backend I'd create a REST architecture for handling the requests.
I'm programming a chat but i have troubles on finding informations and/or examples regarding the HTTP tunneling. The chat, when initialized, starts his own server thread that manages the incoming messages. That said i need to send strings of data to another client's server via http tunneling. Is that possible ? how can i do that ?
HTTP Tunelling is an encapsulation of other protocols that use the TCP stack.
For example you could define the messages exchanged for chat among the various endpoints e.g. in XML and then put the XML in the HTTP POST body.
There are plenty of examples of this in the internet.
Just search for REST or Web services (this includes SOAP which is also tunnelled in HTTP)
There is a chat example demo web application bundled in activeMQ. You can find it here.
I am developing a java console client using a third party web service. After I point to their WSDL, I am able to get their code and send SOAP request and response. I want to log those transactions in a log file. Any idea on how to log a SOAP message at the client side.
Thanks in advance,
Praveen G.
Webservice Stacks provide convenient out and in interceptors for intercepting outgoing requests and incoming responses both on the client and server side. You should be able to use this feature to log outgoing requests from your client and incoming responses, here is a sample using Apache CXF and using Spring-WS
I am using SAAJ at the client side for sending a soap request. I am also attaching a random binary string as an attachment to the SOAP request, using this API.
soapMessage.addAttachment(attachment);
When I sniff this request through wireshark, I can see my attachment outside the <SoapEnv>,
but when this request reaches the client side (which is implemented using the JBoss libraries), I only get the message and not the attachment.
I have not specificed anything in the WSDL related to the attachments.
I can't figure out what can be the problem.
Any pointers would be helpful.
Do you send along the right Content-Type, Content-Transfer-Encoding and Content-ID header values?
http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html#Value-space_of_Content-Id_Header
Maybe post the generated soap-message