How to set default SoapAction value for a soap service configured on wso2 api managaer 2.1.0.
For Soap services we do not have option to edit swagger definition:
please advise how do i default the value of soap action, in our scenario it is not relevant. if there is way to remove from ui and set default value for all api call that would also work. thank you.
If it's SOAP 1.2 you can simply ignore Soap Action.
If it's SOAP 1.1, you can have a custom mediation sequence and set SOAPAction http header like this.
<sequence xmlns="http://ws.apache.org/ns/synapse" name="admin--sample">
<property name="SOAPAction" scope="transport" expression="YourSoapActionHere"/>
</sequence>
If you want to modify the UI, you'll have to tweak this file.
repository/deployment/server/jaggeryapps/store/site/themes/wso2/templates/api/swagger/swagger/swagger-ui{.min}.js
Related
I'm trying to use JMeter to invoke a RPC/SOAP Web service and when I invoke the service my namespaces are mangled from the actual values to NS1.
<?xml version="1.0" encoding="UTF-8"?>
<wpc:invoke xmlns:wpc="http://wpc.ibm.com">
<wpc:envelope communicationVersion="5.3">
<wpc:WPCResponseType>asynchronous</wpc:WPCResponseType>
<wpc:wpcHeader>
<wpc:companyName>mycompany</wpc:companyName>
<wpc:wpsUserID>me</wpc:wpsUserID>
<wpc:wpcUserID>wpcUsername</wpc:wpcUserID>
<wpc:password />
<wpc:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</wpc:messageIdentifier>
<wpc:timestamp>2016-01-18</wpc:timestamp>
<wpc:supplierId><![CDATA[0Z188]]></wpc:supplierId>
<wpc:localeForDisplay>en_US</wpc:localeForDisplay>
<wpc:localeRestriction>en_US</wpc:localeRestriction>
</wpc:wpcHeader>
<wpc:wpcBody>
<wpc:wpcCommand mode="ASYNC" type="UPLOAD">
<wpc:wpcCatalogName>Item Transaction Catalog</wpc:wpcCatalogName>
<wpc:wpcFileDocStorePath>test_data/upload/0003_items.csv</wpc:wpcFileDocStorePath>
<wpc:wpcUpdateOnly>false</wpc:wpcUpdateOnly>
</wpc:wpcCommand>
</wpc:wpcBody>
</wpc:envelope>
</wpc:invoke>
Changes to:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:invoke xmlns:ns1="http://wpc.ibm.com">
<ns1:envelope communicationVersion="5.3">
<ns1:WPCResponseType>asynchronous</ns1:WPCResponseType>
<ns1:wpcHeader>
<ns1:companyName>mycompany</ns1:companyName>
<ns1:wpsUserID>me</ns1:wpsUserID>
<ns1:wpcUserID>wpcUsername</ns1:wpcUserID>
<ns1:password/>
<ns1:messageIdentifier>9E2FA100-BE54-11E5-8A91-BF48E24665E0</ns1:messageIdentifier>
<ns1:timestamp>2016-01-18</ns1:timestamp>
<ns1:supplierId><![CDATA[0Z188]]></ns1:supplierId>
<ns1:localeForDisplay>en_US</ns1:localeForDisplay>
<ns1:localeRestriction>en_US</ns1:localeRestriction>
</ns1:wpcHeader>
<ns1:wpcBody>
<ns1:wpcCommand mode="ASYNC" type="UPLOAD">
<ns1:wpcCatalogName>Item Transaction Catalog</ns1:wpcCatalogName>
<ns1:wpcFileDocStorePath>test_data/upload/0003_items.csv</ns1:wpcFileDocStorePath>
<ns1:wpcUpdateOnly>false</ns1:wpcUpdateOnly>
</ns1:wpcCommand>
</ns1:wpcBody>
</ns1:envelope>
</ns1:invoke>
There must be a setting in JMeter to keep the message from being transformed from my original meaningful namespace to this arbitrary namespace called NS1? When the message is received at the target endpoint it cannot parse the request because of this semantic error.
Any/all replies are appreciated!
MG
JMeter should not change anything in the request body, maybe it is an issues with your web service? Double check the request which is being sent by JMeter using a sniffer tool like Wireshark
In any case try switching to HTTP Request sampler, this is recommended way of sending web service requests (just don't forget to add HTTP Header Manager to send Content-Type and SOAPAction headers).
References:
JMeter User's Manual: Building a SOAP WebService Test Plan
Testing SOAP/REST Web Services Using JMeter
I need to update the specification of a configuration parameter using Teamcity REST API.
Following the REST documentation I tried a PUT request with the parameter value like:
http://teamcity:80/httpAuth/app/rest/projects/TestProject/parameters/TestProjectParam
But this updates the value of the parameter, however I need to udpate the specification of the parameter. I am using Teamcity 8.0.6
I have no way of validating if this works with TeamCity 8.0.6, but the following will create/update a parameter with spec in TeamCity 8.1.3.
Request
POST http://teamcity:80/httpAuth/app/rest/projects/TestProject/parameters/
Headers
Content-Type: application/xml
Authorization: YourToken
Body
<property name="TestProjectParam" value="" own="true">
<type rawValue="select data_2='400' data_1='300' display='normal' data_3='500'" />
</property>
I'm using wso2dss 3.1.0 and wso2esb 4.7.0..I have created a restful dataservice in dss and it's working fine for all operations like get,post,update and delete.Now I wish to user this dataservice in esb..for this i have created a proxy with following configuration :
<target>
<endpoint>
<address uri="http://192.168.1.23:9764/services/A_resttest/"
format="soap11"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
And tried to execute with curl command like this :
curl -v -H "Accept: application/json" http://youtility-desktop:8282/services/RestTest1
But it showing warning and error like :
WARN - SourceHandler Connection time out after request is read: http-incoming-1
ERROR - NativeWorkerPool Uncaught exception
java.lang.NullPointerException
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:156)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)
WARN - SourceHandler Connection time out after request is read: http-incoming-2
I have referred https://docs.wso2.org/display/ESB460/Using+REST+with+a+Proxy+Service.
Is the procedure is correct or their is problem in curl command?Please let me know..I have tried this by creating api also but showing same error..Should i uncomment any code in axis2 file?
Are you going to expose the DSS service via SOAP using ESB? If not, I'd like to suggest that you create ESB REST API instead of a proxy service to expose the DSS service.
Secondly, you have set format="soap11" for the dss service endpoint. But as I understand from your question, you need to use rest format instead of soap 1.1. So, change the format to format="rest" or format="pox" depending on your requirement.
We have a SOAP service that I want to proxy in WSO2 ESB. This is for POC that I am working on. I came across various documents and some explanation on forums but nothing concrete yet. I looked at API option but couldn't get anything to work. Whats the best way to do this? Can the transformation occur in esb itself or is the api the only option? Please advise.
You can better choose RESTAPI option.
Here is the documentation for that
What do you mean by couldn't get this working? This is not a big configuration, you need to define your proxy service such that you send the message (REST message) to the back end as a SOAP message. Here is a sample configuration.
<proxy name="StockQuoteProxy" transports="http https" startOnLoad="true">
<target>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"
format="soap11"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
You can call this proxy in REST manner and it will automatically send the message to the backend SOAP service.
you can do it with the sample axis2 client as below.
ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Drest=true
I have been given a REST URI from my client which is as follows:
https://vm3.digitary.net/verifier/HEDDRequestDocumentAccess
Following request xml has to be POSTed to the above URI to get the response xml.
<documentAccessRequest xmlns="http://www.digitary.net/schema/dare/hedd/documentAccessRequest/2013" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.digitary.net/schema/dare/hedd/documentAccessRequest/2013 http://www.digitary.net/schema/dare/hedd/documentAccessRequest/2013">
<head>
<institutionCode>BBCU</institutionCode>
<username>HEDDUser</username>
<password>HEDDPass</password>
</head>
<body>
<heddEnquiryId>12347895844</heddEnquiryId>
<enquiree>
<email>jane#doe.com</email>
<firstName>Jane</firstName>
<lastName>Doe</lastName>
</enquiree>
<enquirer>
<organisation>BBC</organisation>
<contactName>Jeremy Clarkson</contactName>
</enquirer>
<documentRequested>HEAR</documentRequested>
</body>
</documentAccessRequest>
Now I have the requirement to make my own wrapper REST API in WSO2 ESB 4.6.0 which would simply call the above mentioned REST URI having the same request and response XML. The idea is to make the pass through REST API to above mentioned API.
I have implemented the following REST API:
<api xmlns="http://ws.apache.org/ns/synapse" name="TestDareRest" context="/documentRequest" hostname="46.137.187.137" port="8280">
<resource methods="POST" url-mapping="/request/*">
<inSequence>
<log/>
<property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<send>
<endpoint>
<address uri="https://vm3.digitary.net/verifier/HEDDRequestDocumentAccess" format="pox"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log/>
<property name="ContentType" value="application/xhtml+xml" scope="axis2"/>
<send/>
</outSequence>
</resource>
</api>
But above API is not working at all and it is gving loads of errors in the esb console. I am using the SOAPUI to test this REST service and posting the same request xml from there. The service is deployed on our public Ip server and can be seen by login in to following
https://46.137.187.137:9443/carbon/admin/index.jsp with username/pwd as admin/admin
I have tried setting both media type in SOAPUI as text/xml and application/xml
In case of text/xml it is giving error as follows:
org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found documentAccessResponse
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:305)
In case of application/xml it is giving following error
INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:53a782ab-2081-4cb1-9e94-910b75816361, Direction: response
[2013-04-10 16:05:12,911] ERROR - PassThroughHttpSender Failed to submit the response
java.lang.UnsupportedOperationException
Please help me with this issue as it has got much critical to me.
Thanks in Advance
Shakshi
Can you switch the transport to nonblocking transport and check?
You can change the transport sender and receiver in the axis2.xml.
The media type is to be application/xml ..not the text/xml, which is used fro soap requests.
To post a request you can use curl utility.
# curl -X POST -d #request.xml "URL"