I am working on a bug we have encountered in one of our web services. We are using Axis2 1.4.1 running on OC4J. The issues is that when sending multiple signed binary attachments to the service with MTOM, the service only gets one of the attachments. If I disable WS-Security and send the same request to the web service, all the attachments get through. This seems to only happen when MTOM "determines" the attachments are large enough to warrant breaking them out into separate MIME sections. If they are quite small, then MTOM just base64encodes them and leaves them inline and all data gets through.
All the request SOAP Xml is produced correctly. That is, all the multiple attachments are being sent to the service and all the MIME boundaries are present and all the XOP includes are in place, as I have snooped the requests with Eclipses TCP/IP Monitor and also with the output provided in SOAP Sonar.
Has anyone else run into an issues when trying to send signed content to an Axis2 web service?
I found the answer, sort of, on my own question after spelunking through many JIRA tickets on the AXIS2 JIRA. The fix, or work around actually, is described in AXIS2-4973. Using the method described, Axis2 seems to generate the code the parses multiple MTOM attachments correctly.
Related
I am trying to use rabbitmq and express to build a web application. I am very confused about the producer and receiver.
The tutorial said
Producing means nothing more than sending. A program that sends messages is a producer, Consuming has a similar meaning to receiving. A consumer is a program that mostly waits to receive message.
Is that mean the server should be both producer and receiver? Because the server needs to get the client's request and send a response to the client. If that's the case, why we need to run the 2 scripts (producer.js and receiver.js) separately?
Thank you
Your question appears to be mixing two different conceptual models.
"the server needs to get the client's request and send a response to the client" - That, in a nutshell, is the "client-server" paradigm/architecture, as typically used by web applications, where the client is the browser ("show me this web page, please") and the web app is the server ("OK, here is that page you requested").
Rabbit supports a very different paradigm/architecture (messaging), where (typically) the producer generates messages as they naturally occur (not based on any request). Those messages sit in one or more queues, waiting to be consumed by whoever has subscribed to those queues (the consumers). The consumer does not typically send requests to the server; instead it periodically checks to see if there are any new messages on the queue - and then consumes them.
Which paradigm you use depends on the purpose of your web application. Your app may even use both paradigms.
Update
"Could you please give an example that uses messaging paradigm? I couldn't imagine how a website works without request and response."
When you say "a web site" then I will assume you mean web pages displayed in a browser, provided by a web application running on a server. In that specific case, then, yes, the standard approach is the "client-server" model. There is typically no messaging involved. Messaging is not a good fit for that type of model. Client-server is a great model.
But imagine that "web application" which is sending those web pages to the browser. It is quite possible that the web application may also provide additional services, not accessed directly via web page requests. One such service may be messaging-based: The application produces messages - for example, notifications of events relevant to the application. And users can consume those messages.
A very crude example: Imagine an auction web site. You can log on to the site and see web pages where you can place bids to buy items.
But you may also want to receive messages (e.g. via texts) telling you when there have been new bids from other people, placed on specific items that you are interested in. You don't want to have to constantly refresh a web page to get the latest data; and you don't want to receive updates about every bid on every product. This is a better fit for a different type of client - not one which requests web pages, but one which consumes messages.
So, I also can't imagine a web site which uses messaging to provide web pages (although I bet someone somewhere has built that). But I can imagine a web-based application which serves web pages (client-server) and which maybe also produces messages. Or a web-based application which produces messages, and may not even have any web pages at all.
Your producer.js is a tiny example of a program which is only a message producer. Your consumer.js program is a tiny example of a program which is only a message consumer. And sitting in between them is the message broker program (Rabbit) which is where the queues exist, and where messages are sent (and retrieved).
I am trying to establish a connection using the ruby gems Savon and execute SOAP requests and responses. The thing is that I am getting the file each time by doing this:
client = Savon.client("http://www.webservicex.net/uszip.asmx?WSDL")
Now in the documentation of Savon it says this:
"You can instantiate a client with or without a (local or remote) WSDL document. Using a WSDL is a little easier because Savon can parse the document for the target namespace, endpoint, available SOAP actions etc. But the (remote) WSDL has to be downloaded and parsed once for every client which comes with a performance penalty."
So my question is, can I get the WSDL file by just using the Savon Library? Or do I need to ask for it from the third party application?
It depends on the service, and whether or not they offer the .WSDL from their service URL. Best bet for availability may be to store the WSDL locally, but at that point you commit yourself to tracking their updates
I am working on Apache Tomcat 6 and Axis2 for web services.
I want to monitor SOAP messages which are exchanged with client and server and save the data into a file.
How can I do it?
Storm is a test client for SOAP services.
To capture the traffic between your client and the server, you could use a proxy like Fiddler.
There is an example in modules samples (in samples/userguide) describing this case.
Personally I found simpler just to add a logging code in my generated <...MessageReceiverInOut> class. Just dumping out input/output envelopes for my particular service.
This is a major issue for me. In earlier times, web service clients could simply use EnableDecompression = true and all was good, but why did Microsoft not add something similar to WCF?
I really NEED gzip compressed responses from my WCF services (and they need to be http... legacy issues, as usual... you know...).
Check out this blog post which basically ends up suggesting:
Conclusion
I now ditched this as we also need to
support clients that do not set the
AcceptEncoding header so I really need
the ability to read the http header in
request and set a "context" value to
(not) compress the response and I have
not found out yet how to do that per
multiple concurrent requests. I really
recommend to use the IIS http
compression and not try to do this
with WCF hacking as described here!
There's also a WCF Extensions project on Codeplex which has a WCF Compression Channel - maybe that'll be what you're looking for.
The most bang for the buck would be to use the binaryMessageEncoding in WCF instead of the textMessageEncoding (which is the default for HTTP bindings). That would require you to create a custom http based binding, and would render your service incompatible with other http-based clients other than .NET clients that are also using the same custom binding configuration.
I've build a WCF Service to accept a file and write it to disk. The front-end consists of a page with SWFUpload which is handling the upload on the client side. Apparently, SWFUpload posts the data with a Content Type of: multipart/form-data.
I would think this ok but on the Service side I get an error. The error is "ProtocolException" expecting text/xml. I've tried different message encodings in the bindings but nothing seems to work.
How can I get this file uploaded using multipart/form-data?
#jdiaz,
#JasonS is right, to upload file you need to transfer it as a byte stream. You need to use WCF streaming. For example on how to upload file via WCF see an article from http://kjellsj.blogspot.com
What you want to use is probably MTOM, if you want it to be standard. Using this, you can have MIME multiparts messages.
You then have to read the file as a stream and stuff it into one of the parameters of the request.
It might be that your WCF service targets .NET Framework 3.5 and your IIS is running on .NET Framework 4.0. In this case (framework mismatch) you need to modify your service.
I believe you are going to have to tranfer the file as a byte array to WCF. You will need to handle the post from SWFUpload and convert to a byte array before sending to your service.