how to configure jersey providers in rest-assured - rest-assured

I have a webservice developed using jersey-api.
I'm using rest-assured to test the resources.When I run my testcase, I get the following exception.
[http-bio-8080-exec-1] ERROR T:[] V:[] c.s.j.spi.container.ContainerRequest - A message body reader for Java class ... and MIME media type application/octet-stream was not found.
The registered message body readers compatible with the MIME media type are:
application/octet-stream ->
com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
com.sun.jersey.core.impl.provider.entity.FileProvider
com.sun.jersey.core.impl.provider.entity.InputStreamProvider
com.sun.jersey.core.impl.provider.entity.DataSourceProvider
I know that I need to configure my provider classes. I'm not sure how to configure the provider classes in rest-assured? I was not able to find any information about configuring jersey api "com.sun.jersey.config.property.classnames" in rest-assured.
any help is much appreciated.

Related

Error when running wsdl tool on Sabre GetReservation file

I am running wsdl.exe tool on http://files.developer.sabre.com/wsdl/sabreXML1.0.00/pnrservices/GetReservation_1.19.0.wsdl, following the Sabre .NET sample, and the Get Itinerary Resources which warn that: "TravelItineraryReadRQ API will be decommissioned; please use GetReservationRQ"
But failed with error:
WSDL: error WSDL1: There was an error processing 'http://files.developer.sabre.com/wsdl/sabreXML1.0.00/pnrservices/GetReservation_1.19.0.wsdl'.
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://files.developer.sabre.com/wsdl/sabreXML1.0.00/pnrservices/PNRBuilderTypes_v1.19.0.xsd'.
- The request failed with HTTP status 404: Not Found.
.Net has some issues with choice elements and the way Sabre created some WSDLs. You can find more information at https://developer.sabre.com/resources/api_versioning.
Sabre team fixed the broken address and now there is no error when running the wsdl tool. Thanks

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

Error Loading WSDL in SOAP UI

I am getting this error while loading a WSDL to SOAP UI.SCREEN SHOT OF ERROR
Your WSDL file is malformed, best way to find out what is wrong with it is to run it through some WSDL validation tool, like:
built in Eclipse WSDL validation tool
https://www.w3.org/wiki/WsdlValidator
https://www.wsdl-analyzer.com/
...
Disclaimer, I have not used any of this except for the Eclipse one, so proceed at your own risk.

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.

wsdl2java and soap with attachments issue

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

Resources