I use version 3.8 (3.8.3) .
I basically want to host my wsdl in a different location other than http://{serviceurl}?wsdl like http://{serviceurl}/my-great-service.wsdl
At the following mule doc
https://docs.mulesoft.com/mule-user-guide/v/3.8/wsdl-connectors
it says that you can specify the _wsdlLocation_ property of the CXF endpoint as follows
<endpoint address="wsdl-cxf:http://localhost:8080/book/services/BookService?method=getBooks">
<properties>
<property name="wsdlLocation" value="file:///c:/BookService.wsdl"/>
</properties>
</endpoint>
But where to put this in the mule xml ?
To the root of the file <mule> here </mule> or to <flow> here </flow> or to the <cxf:proxy-service> here </cxf:proxy-service>
The mule documentation is so limited and lock of examples.
Any reason why you are using the cxf connector instead of the web service consumer?
https://docs.mulesoft.com/mule-user-guide/v/3.8/web-service-consumer
All the global configuration elements are specified after the <mule> tag and before the <flow> elements.
Example with web service consumer below:
<mule ......>
<ws:consumer-config name="Web_Service_Consumer" service="ServiceService"
port="ServicePort" serviceAddress="addresUrl"
wsdlLocation="wsdl location" doc:name="Web Service Consumer"/>
<flow>...</flow>
</mule>
If for any reason you want to use the cxf connector, is the same but using the cxf connector
Related
I want to expose a web service. I have WSDL file with me. I am using CXF proxy service as operation. Now, I have doubt that in Inbound attributes value of port,namespace & service should take from WSDL file only,Right?
If yes, then, after deploying through, http://localhost:8081?wsdl this link am not getting same WSDL which I want to expose.
So, tell me where am I going wrong?Thanks.
To test the project, which URL should use in SoapUI, so that appropriate request XML will generate...
Here is my flow,
<flow name="meterreadingdocumenterpresultbulkcreateconfirmation_outFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<cxf:proxy-service configuration-ref="CXF_Configuration" port="MeterReadingDocumentERPResultBulkCreateConfirmation_OutPort" namespace="http://sap.com/xi/IS-U/Global2" service="MeterReadingDocumentERPResultBulkCreateConfirmation_OutService" payload="body" doc:name="CXF" validationEnabled="true"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<mulexml:dom-to-xml-transformer doc:name="DOM to XML"/>
<logger level="INFO" doc:name="Logger" message="#[payload]"/>
</flow>
After exposing a web service I am not getting proper response...
I have web service wsdl file and its loaded successfully in SOAPUI. This is an request method.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org /soap/envelope/" xmlns:asi="http://siebel.com/asi/">
</soapenv:Header>
<soapenv:Body>
<asi:VSPOSCSyncRealTimeQueryById>
<PrimaryRowId>1-test</PrimaryRowId>
</asi:VSPOSCSyncRealTimeQueryById>
</soapenv:Body>
</soapenv:Envelope>
This above method is an working fine in SOAPUI. But when I try
to implement in mulesoft using web service consumer then the method is not populating.
This is an screen shot .
The above picture showing that the mule soft web service consumer is populating the only parameter without operation name but SOAPUI is populating both operation and parameter and its working. so any idea why mule soft web services consumer its not populating method name with parameter.
Thanks
Ishwar
I have created a sample as below and it is wokring as expected. I am not sure if you have selected the Operation in Web Service Component. Refer the following, hope this will work for you -
Webservice Consumer Component Operation
DataMapper
<flow name="muletestFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/test" allowedMethods="GET" doc:name="HTTP"/>
<set-variable variableName="first" value="#[message.inboundProperties.'http.query.params'.first]" doc:name="first"/>
<set-variable variableName="second" value="#[message.inboundProperties.'http.query.params'.second]" doc:name="second"/>
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0%output application/xml%namespace ns0 http://tempuri.org/---
{
ns0#Add: {
ns0#intA: flowVars.first as :number
, ns0#intB: flowVars.second as :number
}
}]]></dw:set-payload>
</dw:transform-message>
<ws:consumer config-ref="Web_Service_Consumer" operation="Add" doc:name="Web Service Consumer"/>
</flow>
We have an ear application, that contains some WS endpoints. I have to deploy to the target server but I have to override the WSDL soap-address tag. The solution we use our local testbed is following this instruction: https://stackoverflow.com/a/23491951 That works perfectly. (server is wildfly 8.2)
However we cannot use this solution anymore on production server ("just because").
I found, that there is a jboss-webservices.xml, that should override the wsdl's <soap-address> tag without changing the standalone.xml / domain.xml's webservices subsystem settings.
But it is not working for me. My jboss-webservices.xml:
<?xml version="1.1" encoding="UTF-8"?>
<webservices version="1.2"
xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_webservices_1_0.xsd">
<property>
<name>wsdl.soapAddress.rewrite.modify-wsdl-address</name>
<value>true</value>
</property>
<property>
<name>wsdl.soapAddress.rewrite.wsdl-host</name>
<value>somedomain.com</value>
</property>
</webservices>
These instructions are followed:
https://docs.jboss.org/author/display/JBWS/Published+WSDL+customization
https://docs.jboss.org/author/display/JBWS/Advanced+User+Guide
I place jboss-webservices.xml both two places referred by the documentation:
META-INF/jboss-webservices.xml for EJB webservice deployments
WEB-INF/jboss-webservices.xml for POJO webservice deployments and EJB webservice endpoints bundled in war archives
Non of them works.
The related log snippet:
11:50:43,502 INFO [org.jboss.ws.cxf.metadata] (MSC service thread 1-2) JBWS024061: Adding service endpoint metadata: id=ABCServicePortType
address=http://localhost:8180/abc-web/ABCServicePortType
implementor=example.service.v1.impl.ABCServicePortTypeImpl
serviceName={http://example.com/ns/mod/ws/ABCService/v1}ABCService
portName={http://example.com/ns/mod/ws/ABCService/v1}ABCServicePortTypeImplPort
annotationWsdlLocation=null
wsdlLocationOverride=null
mtomEnabled=false
My questions: May I miss something? Is there any other way to override soap-address?
Thanks in advance.
The properties that you provided in jboss-webservices.xml works but with a higher version of WildFly than you are using in your server (since WildFly 9). See webservices section of release notes for WildFly 9:
http://wildfly.org/news/2015/07/02/WildFly9-Final-Released/
It looks that before WildFly 9 release standalone.xml is the only one place to customize WSDL generation.
A SOAP webservice is been exposed by a system. I have got a wsdl file of the webservice. Im able to send request and get response from soap ui. I want to duplicate this wsdl SOAP webservice in my camel routes deployed in servicemix, thereby making my ESB expose a similar webservice as the system's webservice. THis way many systems access this webservice to contact the system.
How do i duplicate a webservice using wsdl file of the system??
To duplicate webservice, exposed by a system, you can use http proxy route, based on jetty:
<route id="ServiceProxy">
<from uri="jetty:http://0.0.0.0:8186/service/?disableStreamCache=true&matchOnUriPrefix=true&continuationTimeout=900000&httpClient.timeout=120000"/>
<to uri="jetty:http://{{app-server.host}}:{{app-server.http.port}}/service/?bridgeEndpoint=true&throwExceptionOnFailure=false&continuationTimeout=120000&httpClient.timeout=900000"/>
</route>
You can write the same route on JavaDSL.
Found solution - Concept is cxf-proxying
Having a wsdl of the system, create a similar wsdl with the Endpoints defined according to the localhost and port number.
Save the wsdl in your local project,
provide the path to wsdl in pom, for converting wsdl to java by mentioning in the cxf-codegen-plugin.
create cxf consumer bean with details of local wsdl file
<cxf:cxfEndpoint id="consumerProxy" address="http://remote:port/service/"
serviceClass="com.remote.service.RemoteService" endpointName="c:RemoteService"
serviceName="c:RemoteService" xmlns:c="http://remote/namespace/">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
</cxf:properties>
</cxf:cxfEndpoint>
create cxf producer bean with details of remote wsdl file
<cxf:cxfEndpoint id="producerRemote" address="http://localhost:9001/service/"
serviceClass="com.remote.service.RemoteService" endpointName="c:RemoteService"
serviceName="c:RemoteService" xmlns:c="http://remote/namespace/">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
</cxf:properties>
</cxf:cxfEndpoint>
The proxy routes can be like below
from(cxfEndpoint("consumerProxy"))
.to(cxfEndpoint("producerRemote"));
Sending a request to localhost will be consumed by cxf endpoint - consumerProxy and sent to the cxf endpoint - producerRemote.
The response is sent back the reverse way.
I have a WSDL and a Mule SOAP proxy web service using the MuleSoft XML Only SOAP Web Service example.
My application is working fine but if i enable validation i have one issue: When the XSD is stored anywhere other than the root of the project, it will not resolve.
I created folders of service and xsd inside /src/main/resources,
however when the service is invoked I receive the following error:
connector.http.mule.default.receiver.02] org.apache.cxf.wstx_msv_validation.ResolvingGrammarReaderController: D:\Developer\Global\BODs\GetListSalesOrder.xsd (The system cannot find the path specified)
java.io.FileNotFoundException: D:\Developer\Global\BODs\GetListSalesOrder.xsd (The system cannot find the path)
This is my mule flow..
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="test" doc:name="HTTP"/>
<cxf:proxy-service port="SyncSalesOrderBinding" namespace="http://www.cg.com/services/oagis/salesOrder" service="SyncSalesOrderService" validationEnabled="true" payload="body" wsdlLocation="services/WebServices/WSDL/SalesOrder.wsdl" doc:name="CXF">
<cxf:schemaLocations>
<cxf:schemaLocation>services/Developer/Global/BODs/GetListSalesOrder.xsd</cxf:schemaLocation>
</cxf:schemaLocations>
</cxf:proxy-service>
<logger message="Success" level="INFO" doc:name="Logger"/>
If your XSD file is imported in your wsdl file the following Code is fine :-
<cxf:proxy-service port="SyncSalesOrderBinding" namespace="http://www.cg.com/services/oagis/salesOrder" service="SyncSalesOrderService" validationEnabled="true" payload="body" wsdlLocation="services/WebServices/WSDL/SalesOrder.wsdl" doc:name="CXF"/>
You don't need to mention your XSD file in CXF component .. it will validate
If you still face any issues then there is patch available here : https://www.mulesoft.org/jira/browse/MULE-5963?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
.... Please you replace your jar with the one attached to the JIRA ... It will work definately