I am using WSO2 BPS 3.2.0, WSO2 Application server 5.2.1 and WSO2 Identity server 5.0.0.
I make BPS process which communicate with basic authentication secured ESB proxy services through HTTPS. Process have problem with soap action. Requests ends with Fault response:
<message><fault><faultcode xmlns:soapenv="http://schemas.xmlsoap.org/soa...">axis2ns10:Client</faultcode><faultstring xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">The endpoint reference (EPR) for the Operation not found is /services/RepositoryService and the WSA Action = . If this EPR was previously reachable, please contact the server administrator.</faultstring></fault></message>
I use unified-endpoints(UEPs) from this blog.
<wsa:EndpointReference
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/">
<wsa:Action>http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort/getRepositoriesRequest</wsa:Action>
<wsa:Metadata>
<id>SInvokeEPR</id>
<transport type="http">
<authorization-username>user</authorization-username>
<authorization-password>pass</authorization-password>
</transport>
</wsa:Metadata>
</wsa:EndpointReference>
I found some possibility with assign
<bpel:literal>
<wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort/getRepositoriesRequest</wsa:Action>
</bpel:literal>
to output variable property
<bpel:to variable="RepositoryServicePLRequest" header="Action"></bpel:to>
But it doesn't work. But I found that it starts working when I enable SOAP Message Tracer in ESB. Why?
You can use fix from this post
Add parameter
<parameter name="disableOperationValidation" locked="false">true</parameter>
to your proxy conf in WSO2 ESB
I had been around this problem for the last two days. And I have several points to your question and your answer. To let you know I don´t have an ESB so I have the same problem but I can not use this approach to solve it.
First checking your first link you see there is no wsa:Action so you need to specify wsa:address instead.
The second problem is your SOAPACTION is not set. If you use SOAP 1.1 you need this header so BPS set it as "" for you but most of servers need the real action. To solve this you need to enableAddressing in your epr file. It is a bit confusing because it adds the proper ws-addressing information but it controls SOAPACTION which is not related to it.
So to solve the problem just put your epr like this:
<wsa:EndpointReference
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/">
**<wsa:Address>http://docs.oasis-open.org/ns/cmis/ws/200908/RepositoryServicePort</wsa:Address>**
<wsa:Metadata>
<id>SInvokeEPR</id>
<transport type="http">
<authorization-username>user</authorization-username>
<authorization-password>pass</authorization-password>
</transport>
**<qos>
<enableAddressing version="final" separateListener="true"/>
</qos>**
Related
I am working on implementation of service that should accept SOAP 1.2 request with with HTNG 2.1 header, WS-Addressing (to communicate message IDs between systems and address destinations) and WS-Security (user authentication only).
I have completed the whole business logic of processing payload message and generating proper response but I have a real trouble configuring my service to predefined request.
Here it is:
<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
<soap2:Header xmlns:soap2="http://www.w3.org/2003/05/soap-envelope"
xmlns:htng="http://htng.org/1.3/Header/"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wss="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:htnga="http://htng.org/PWSWG/2007/02/AsyncHeaders"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<wsa:Action>http://MyHost/MyService_SubmitRequest</wsa:Action>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
</wsa:ReplyTo>
<htnga:ReplyTo>
<wsa:Address>HTTPS://ResponseHost/Response.SVC</wsa:Address>
</htnga:ReplyTo>
<wss:Security mustUnderstand="1">
<wss:UsernameToken>
<wss:Username>string</wss:Username>
<wss:Password>string</wss:Password>
</wss:UsernameToken>
</wss:Security>
<wsa:MessageID>df559145-78a4-4c85-a264-bf99bbf8df9e</wsa:MessageID>
<htnga:CorrelationID>df559145-78a4-4c85-a264-bf99bbf8df9e</htnga:CorrelationID>
<wsa:To>https://pms.url</wsa:To>
</soap2:Header>
<Body>
<!-- Payload -->
</Body>
</Envelope>
I want configuration in config file, not in code and I have tried all configuration options I could find in various posts without any success.
I am aware that I am probably missing some basics about WCF that I can't spot right now so at least a point in right direction will help.
As far as I know, the MesaageID/ReplyTo header could be added in the SOAP header by setting up the message version.
How to add MessageID in the soap headers of WCF request and response?
And UsernameToken could be added by authenticating the client with username/password pattern.
<customBinding>
<binding name="mybinding">
<textMessageEncoding messageVersion="Soap12WSAddressing10">
</textMessageEncoding>
<security authenticationMode="UserNameOverTransport" includeTimestamp="false" >
</security>
<httpsTransport></httpsTransport>
</binding>
</customBinding>
Result.
Correct way communicate WSSE Usernametoken for SOAP webservice
I don’t know how to add HGNGA:CorrelationID header to the SOAP header, It might relate to the WCF tracing.
Feel free to let me know if there is anything I can help with.
Quick question. When using the Web Harvesting feature of WSO2 DSS, how do I send parameters via POST to a service such as the one configured below:
<config>
<var-def name="someName">
<html-to-xml>
<http url="http://server.yoyodyne.com/service/entryPoint?doQuery=someValue&someKey=anotherValue" method="post"/>
</html-to-xml>
</var-def>
</config>
For example, if I wanted to send via POST the vars "firstField", "secondField", and "someFileName", where would I define those in the config? The documentation does not seem to cover this.
At the moment DSS only support simple HTTP Get and extract web data from given URL for Web scraping.
Regards,
Amani
WSO2 WS-Discovery Integration
We're trying to integrate WS-Discovery with the Carbon products WSO2 Governance Registry and WSO2 ESB having
Apache CXF Web Service stack configured via Spring running on a Tomcat sending hello messages to the
Discovery Proxy (localhost:9443/services/DiscoveryProxy) on WSO2 Greg.
Therefore we added cxf-services-ws-discovery-service.jar and cxf-services-ws-discovery-api.jar to the
classpath in Tomcat. Further we set the spring bus property org.apache.cxf.service.ws-discovery.address
to the URL address of the WS-Discovery Proxy on WSO2 Greg to run WS-Discovery in managed mode. By running
Tomcat and WSO2 Greg following error messages is logged in wso2Carbon.log (WSO2 Greg) ...
TID: [0] [Greg] [2013-07-15 11:45:03,411] INFO {org.wso2.carbon.discovery.proxy.DiscoveryProxy} - Service Discovery Failed. Retrying after 10s. {org.wso2.carbon.discovery.proxy.DiscoveryProxy}
TID: [0] [Greg] [2013-07-15 11:45:03,458] ERROR {org.wso2.carbon.governance.api.common.GovernanceArtifactManager} - Failed to add artifact: artifact id: urn:uuid:003aa9d9-2c9f-4e0b-8415-c99632226ee3, path: /trunk/services/org/oasis_open/docs/ws_dd/ns/discovery/_2009/_01/DiscoveredService_1373881503442. An exception occurred while executing handler chain. String index out of range: -1 {org.wso2.carbon.governance.api.common.GovernanceArtifactManager}
org.wso2.carbon.registry.core.exceptions.RegistryException: An exception occurred while executing handler chain. String index out of range: -1
at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2525)
at org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.put(HandlerLifecycleManager.java:1005)
at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.put(EmbeddedRegistry.java:697)
at org.wso2.carbon.registry.core.caching.CacheBackedRegistry.put(CacheBackedRegistry.java:465)
at org.wso2.carbon.registry.core.session.UserRegistry.put(UserRegistry.java:658)
at org.wso2.carbon.governance.api.common.GovernanceArtifactManager.addGovernanceArtifact(GovernanceArtifactManager.java:155)
at org.wso2.carbon.governance.api.services.ServiceManager.addService(ServiceManager.java:116)
at org.wso2.carbon.discovery.util.DiscoveryServiceUtils.addService(DiscoveryServiceUtils.java:152)
at org.wso2.carbon.discovery.proxy.DiscoveryProxy$1.run(DiscoveryProxy.java:89)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1911)
at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.deriveEndpointFromUrl(EndpointUtils.java:674)
at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.saveEndpoint(EndpointUtils.java:483)
at org.wso2.carbon.registry.extensions.handlers.utils.EndpointUtils.saveEndpointsFromServices(EndpointUtils.java:280)
at org.wso2.carbon.registry.extensions.handlers.ServiceMediaTypeHandler.put(ServiceMediaTypeHandler.java:353)
at org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.put(HandlerManager.java:2503)
... 14 more
We tried to solve this issue for several hours by reading WSO2 product documentation and searching through
several forums, blogs etc. . Unfortunely we couldn't find a solution.
Remark: WS-Discovery integration with WSO2 Application Server instead of Tomcat just worked fine.
But when using WSO2 ESB as an discovery client to discover services from WSO2 Greg the wizard to create proxy services out of the
discoverd services on WSO2 ESB is missing the publishWSDL xml tag after creating the proxy. This tag must be added
manually. Is there a way to get this done without editing this additionally??
We would be grateful for any help.
Thanks in advance
Thank you for your quick reply
We intercepted the hello requests sent to WSO2 GReg via Tomcat and the WSO2 Application server. For this purpose we used soapUI mock
services. The message requests of the soap envelopes look as follows ...
Tomcat:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:tns="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
<soap:Header>
<wsa:Action>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello</wsa:Action>
<wsa:MessageID>urn:uuid:e01ce7dc-53c0-4b36-b7d5-0e84e3bd6a5d</wsa:MessageID>
<wsa:To>https://localhost:9443/services/DiscoveryProxy</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
</wsa:ReplyTo>
</soap:Header>
<soap:Body>
<ns2:Hello xmlns="http://www.w3.org/2005/08/addressing" xmlns:ns2="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
<EndpointReference>
<Address>urn:uuid:be46c1fc-1646-4bcc-8715-1aed4040fdd5</Address>
<ReferenceParameters/>
</EndpointReference>
<ns2:Types xmlns:ns3="http://user.service.scheck.server.tia/">ns3:IZ3UserService</ns2:Types>
<ns2:Scopes/>
<ns2:XAddrs>/userService</ns2:XAddrs>
<ns2:MetadataVersion>1</ns2:MetadataVersion>
</ns2:Hello>
</soap:Body>
</soap:Envelope>
WSO2 Application Server:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<mns:serviceName xmlns:mns="http://www.wso2.org/ws/discovery">echo</mns:serviceName>
<mns:wsdlURI xmlns:mns="http://www.wso2.org/ws/discovery">http://10.200.2.114:9764/services/echo?wsdl</mns:wsdlURI>
<wsa:To>https://localhost:9443/services/DiscoveryProxy</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:d21e108b-34a2-4313-8b12-a22015567a51</wsa:MessageID>
<wsa:Action>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Hello</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<wsd:Hello xmlns:wsd="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01">
<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Address>urn:uuid:439a1cd5-fb36-40e2-a54e-e0cb7f3409e4</wsa:Address>
</wsa:EndpointReference>
<wsd:Types xmlns:axis2ns1="http://echo.services.core.carbon.wso2.org">axis2ns1:echoPortType</wsd:Types>
<wsd:Scopes>http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/DefaultScope</wsd:Scopes>
<wsd:XAddrs>https://10.200.2.114:9444/services/echo http://10.200.2.114:9764/services/echo</wsd:XAddrs>
<wsd:MetadataVersion>1</wsd:MetadataVersion>
</wsd:Hello>
</soapenv:Body>
</soapenv:Envelope>
Comparing both message requests we noticed that there are some tags missing like serviceName, wsdlURI and most important
in our opinion the XAddrs. By adding the XAddrs manually to an soapUI request we were able to register the cxf service
on WSO2 GReg. Maybe you can give us an advice how this could be achieved by configuring cxf via spring or by annotating our
web service implementations.
Thanks again..this helped us very much!!
I am attempting to use Greg to hold endpoint URL's for services deployed into non-WSO2 containers (Weblogic/JBoss). I would like to use WSO2 ESB to perform mediation and routing of data through these endpoints.
However, when I look at the WSO2 ESB samples, it is not clear how I instruct the ESB to use WSO2's Greg. Below is the xml used to have the ESB use a registry deployed to the filesystem.
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.ESBRegistry">
<parameter name="root">file:./repository/samples/resources/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
</definitions>
My assumption is that the registry tag's provider element should probably be able to be overridden with a web-service address providing access to Greg.
When all is said and done, I would like to create simple BPMN configuration files that connect to Greg, obtain URI's and URL's for the services used by the file, and then to reference them as properties later in the BPMN route.
First question, is this a standard configuration, or is there a better way to integrate WSO ESB and Greg.
Second question, are there any examples I could refer to that will answer this question?
Please refer following documentation.
[1] http://wso2.org/library/tutorials/2010/04/sharing-registry-space-across-multiple-product-instances
[2]http://docs.wso2.org/wiki/display/ESB460/Storing+Various+WSO2+Enterprise+Service+Bus+Configurations
Those include how you can store and using WSO2 governance registry in highlevel.
If you need to manage endpoints through API in governance registry following will help.
[3] http://docs.wso2.org/wiki/display/Governance453/Endpoints+with+Governance+API
[4] http://docs.wso2.org/wiki/display/Governance453/Endpoint+Look-up+Sample
Futher this thread include some of the hints how you can access custom stored properties in Registry
[5]How to access system property from WSO2 ESB and Registry
WSO2 Governance Registry is a meta data repository, therefore you can use it to store the SOA artifacts (WSDL,Schems,Policies, Mediation configurations , customs artifacts ..etc) of your deployment. After that you can govern those artifacts through the Governance Registry. You can find more details in the ESB documentation[1].
[1]http://docs.wso2.org/wiki/display/ESB460/Config+and+Governance+Partitions+in+a+Remote+Registry
Thanks & Regards,
Ajith
I wonder if it is possible to send an HTTP request throuht WSO2 ESB. I have an integration with a system that consist only in invoking an URL... it would be like a kind of redirection.
Can I do that in WSO2 ESB?
Regards
I have found this link about restfull services in WSO2 ESB:
http://wso2.org/library/articles/2012/10/implementing-restful-services-wso2-esb
I think this is a better way to handle http requests & responses in wso2 esb, rather than the way they are treated in the links you provide. What do you think about that?
Below links will be help you to find a solution to your question.
http://wso2.org/library/knowledge-base/2011/03/handling-httpget-request-invoking-external-web-service-wso2-esb
http://docs.wso2.org/wiki/display/ESB451/Handling+HTTP-get+Requests+from+WSO2+ESB+and+Calling+an+External+Web+Service