How to write a gsoap restful C++/Solaris client, which should send a document(xsd__base64Binary) to webservice using streaming?
We tried writing a gsoap restful client without streaming and it is working fine. We generated a request xml (serialization- soap_begin_send(--), soap_serialize(--), soap_put(--),soap_end_send(--)) using gsoap and then used soap_post_connect(---), soap_send(---),soap_end_send(---) to send the request.
We used MTOM for streaming in gsoap client and working fine.
Is it possible to stream a document in gsoap restful client? Can we use MTOM in restful case?
If yes, could you please let us know, what are all the gsoap functions I should use for serialization and then to send that xml request?
And also, please share if you have any sample code.
One way is take doc as string and send that string as arguments to server.
soapcpp2 will generate code for client/server for you.
See here for more details.
I agree with this but if you have document which is huge size than you can devide it in part. Create your own header-data combination and devide document in packet and send as string.
Related
This is critical to my current project. I have written a client in C++ using Windows web services. This client talks to the Clickatell SMS SOAP web service. I have tested the request using the SOAPUI tool and get correct response. I also receive the SMS message. Now, when I do this programmatically it fails because the WsCall() [in the code generated from WSDL via wsutil.exe) inserts even though the SOAP request I have already includes Envelope and Body. I cannot take out my Envelope since I have namespace specified in it like this:
http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"soap.clickatell.com\">
I know that the additional Envelope and Body are inserted since I see it in the Fiddler tool.
Any help I can get is highly appreciated!
Looks like you are using the older type rpc/encoded soap api.
Have you tried using the document/literal service?
(http://api.clickatell.com/soap/document_literal/webservice.php?wsdl)
I'm facing a performance issue with my web-service.
The context
I'm coding a game on Android that consumes a web service. It 's a multiplayer game so there are many connections done to the web service.
My Rest web service is provided by an Axis2 instance on a Tomcat server.
The problem
All is working fine, except that the amount of data is huge because of the verbosity of XML.
I tried to optimize the exchange by never resending a data that the client already have.
I use gzip compression.
I think that jSon is not a solution because, it will light the response message but not as I would.
So my questions, what should I do to maximum light the response size? What are the best practices?
Is it possible to send only a serialized object without using jSon or xml to avoid verbosity?
Thank you for all your reponses xD
I think that I have to send serialized objects in a custom format but Axis2 only deals with xml stuff (Jax-WS).
So I'll try another Rest server like Jersey which deals with custom format (Jax-RS).
What do you think about that?
I am new to Spring web services. I am going to create an xml request, and send it as a SOAP request to a web service and receive the response.I read different documents but still confused as I could not find a working sample yet.
I know that I should use WebServiceTemplate and WebServiceMessageSender, SaajSoapmessageFactory (please let me know if I am wrong) but not sure how to use them.
Do I need WSDL? if yes why?
If you have any sample code please send me to get clear on it.
Thanks
If you want to send SOAP requests, you would like to be a SOAP client. Seems like you want to use spring-ws project. Check out their great documentation on the client side. The same documentation will guide you through the process of creating a server. There are plenty of examples and ready-made configuration snippets waiting for you.
Spring-WS is built on top of XML Schema description of your message, so you will need WSDL to generate e.g. JAXB models of your requests and responses.
AFAIK, for "web services" , the WSDL file is the machine blueprint of the "ports" as they are called However! ports in WSDL "means" java language(or any other programming language used with a routine or sub or procedure or function) method and has a specific naming scheme associate the .wsdl xml file(template of the service). Each WSDL port(language method) has specifications of return value and data specifications for how to feed it arguments and their type values.
I'm quite new to webservices, recently started implementing Soap Webservice using Spring-WS and client using Axis and Spring. As i understood, we send xml as request for webservice and we get back response xml. These request/response Xmls can then be marshalled/unmarshalled.
Is there a way to directly return a pojo from webservice and get it on client side with out xml marshall/unmarshalling?
We always end up using Apache Axis and using WSDL2JAVA which produces pojo's for you and hides the service implementation. For the marshaling you can use something like XMLBeans to easily marshal between xml and pojos.
Also see Spring WS Client - How to create mapping POJO for WSDLs without using Axis
Short answer : no.
I want to send an XML file to a Web Service.
The Web Service is a java application.
I know the endpoint of the Web Service.
Typically I know I have to create the request and send it as an http/https request.
What I want to know is what would I have to make to send the request - as in what development tool could I use e.g. Visual Web Developer (preffered as I am familiar with this) or Visual Studio? And what sends the request - e.g. another Web Service, a Website etc?
Where do I even begin with this?
Any comments are much appreciated.
Where do I even begin with this?
One purpose of a Webservice is loose coupling. So it depends on what you want to do. You can write a simple program in what ever language which constructs a request and sends it. You can write a Webservice on its own which uses the other Webservice to handle it's own requests.
You can handle this in a very simple or complex way. You only need to be able to generate a request (per xml) and send it.