wsdl2java and soap with attachments issue - wsdl

I generated a WS Client using wsdl2java for a Soap service developed with soaplib 0.8.2 (python). The server does support Soap with attachments as I could see with tcpdump while using a client built also with soaplib. But when it comes to Java, the generated client does not send the attachments as other parts, but embedded in the xml as base64 binaries.
I'd like to know how the java client could be set up in order to send the attachments as parts and not embedded in the xml?

you need to set
stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
please refer this blog[1] for more details.
[1] http://amilachinthaka.blogspot.com/2009/01/using-mtom-with-axis2.html

Related

Orocommerce - generate API client libraries

I am quite new in the orocommerce ecosystem, and I would like to generate API client librairies automatically for orocommerce API (frontend and backend). The objective is to build my own UI.
I found some dependencies on NelmioApiDocBundle than could potentially generate swagger file, but I hit multiple problems:
this is a quite old version, that only support swagger 1.2
the generated file (using symfony run php bin/console api:swagger:dump /tmp/api/) seems not working with swagger codegen "as is"
all the part of the API seems not written using NelmioApiDocBundle annotation
I am wondering if there is an other mechanism to generate API client librairies for orocommerce. I would like a SDK for typescript.
Thanks in advance for your answer.
Right now, the only supported swagger version is 1.2, as you stated.
By default, the api:swagger:dump command works with an outdated API, to generate data for the current API, run it with --view=rest_json_api option:
api:swagger:dump --view=rest_json_api
As an alternative to the API client generation, as Oro API strictly follows JSON.API standard, you can use many existing client libraries, compatible with the JSON.API specification. The list of Typescript implementations can be found at the official website: https://jsonapi.org/implementations/#client-libraries-typescript

How I can test from browser (like from swagger) my webapp powered by gRPC-Web without REST?

I want to develop my client-server web app with clear gRPC (gRPC-Web) without REST. Something like described at official doc: https://grpc.io/docs/quickstart/web.html
Is it exist any tool like swagger that let me view message formats from .proto and test the server methods by sending any messages from the browser?
I use node.js for server side app
You could use https://kreya.app, which is a gRPC GUI client and supports gRPC-Web. Note that it requires an installation.
Disclaimer: I'm one of the authors of Kreya.
The gRPC-Web wire protocol is a binary format and is basically human-unreadable. There is an enhancement request to prettify it https://github.com/grpc/grpc-web/issues/317 but we haven't got around to it.
If you are ok with talking to your gRPC backend directly without gRPC web, there are a few CLI and GUI tools for that purpose:
CLI: The official tool grpc-cli
CLI: grpCurl
GUI: (this requires a golang backend unfortunately): grpc-json-proxy
GUI: omgrpc
Found this pretty tool for test my gRPC-backend directly (without gRPC-Web): https://github.com/uw-labs/bloomrpc

Hyperledger Composer: Where is the Open API Specification generated by composer-rest-server stored?

I want to use the specification in to generate a Java client using swagger codegen in order to consume the REST API from a Java application. Where do I find the Open API spec after I start the composer-rest-server? I've tried looking it up but I can't figure out where that file is stored after it is generated.
By default, the docs are at your localhost:3000/explorer
This is generated automatically by the LoopBack framework.
You should carefully follow: https://hyperledger.github.io/composer/integrating/getting-started-rest-api.html

obtain WSDL from Oracle Service Bus for a proxy service

I need to find the WSDL of a proxy service that I have defined in the Oracle Service Bus.
Export WSDL option in the console gives me jar file which contains the .WSDL file but in a different format,
<WL5G3N0:definitions name="PollAddressFromDB-concrete" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/DBPoll_Adapter/PollAddressFromDB/PollAddressFromDB" xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://xmlns.oracle.com/pcbpel/adapter/db/DBPoll_Adapter/PollAddressFromDB/PollAddressFromDB" xmlns:WL5G3N2="http://schemas.xmlsoap.org/wsdl/soap/">
I want to run a test on my web service using Soap UI but Sap UI would not accept this WSDL format.
How and Where can I retrieve the actual WSDL file.
Thanks!
As SiKing mentioned, if it's a http proxy, just go to the endpoint URL and append ?wsdl to the end. SoapUI can create a project from that.
Please refer to my following answer How to access the WSDL URL of a OSB proxy service in web browser
Reproducing it here:
There are three ways to access an effective WSDL:
In a Web browser, enter the URL for an HTTP-based proxy service,
appended with ?WSDL. This works only for HTTP-transport-based services for which Oracle Service Bus can generate effective WSDLs.)
In a Web browser, enter the fixed HTTP URL, for example:
[http://host:port/sbresource?PROXY/project_path/proxy_service_name]
or
[http://host:port/sbresource?BIZ/project_path/business_service_name]
This works for all services for which Oracle Service Bus can generate effective WSDLs.
Export the WSDL from the console

How to use Grails WebService Stub?

I have a wsdl file with me and i generated stubs using IntelliJ idea which uses axis2 to generate Java classes from WSDL.
I am using Grails-Ws-Client plugin to use the wsdl file. The plugin works fine and i can run the temperature conversion program using www.w3schools.com/webservices/tempconvert.asmx?WSDL.
Now the Client says that he won't be able to directly expose his wsdl and i have to use stubs. He has replaced the location URL in wsdl with some dummy url ....
Can you please provide me some reference to understand this concept ? How can i call any method exposed by this webservice ?
Any help in this direction will be highly appreciated.
PS: Here is the location tag specified in wsdl file.
soap:address location="https://somePortal/portal.asmx"
Make the WSDL local. The stubs you crated can be pointed to the local WSDL instead the remote WSDL.

Resources