I develop a code first SOAP web service with CXF, and this a WSDL which I get. Why is there a import on WSDL
the second line is the one of the interest:
I am guessing that maybe it has something to do with namespaces ? I wonder if publishing the code of the web service impl will help ?
<wsdl:import location="http://localhost:8080/abc/RaceCalc?wsdl=RaceCalc.wsdl" namespace="http://service.wrapper.ie/">
</wsdl:import>
WSDL generated from Web Service:
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="RaceCalcImplService" targetNamespace="http://impl.service.wrapper.ie/" xmlns:ns1="http://service.wrapper.ie/" xmlns:ns2="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.service.wrapper.ie/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:import location="http://localhost:8080/abc/RaceCalc?wsdl=RaceCalc.wsdl" namespace="http://service.wrapper.ie/">
</wsdl:import>
<wsdl:binding name="RaceCalcImplServiceSoapBinding" type="ns1:RaceCalc">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="setRaceCalcHelper">
<soap:operation soapAction="" style="document" />
<wsdl:input name="setRaceCalcHelper">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="setRaceCalcHelperResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="calculate">
<soap:operation soapAction="" style="document" />
<wsdl:input name="calculate">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="calculateResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="RaceCalcImplService">
<wsdl:port binding="tns:RaceCalcImplServiceSoapBinding" name="RaceCalcImplPort">
<soap:address location="http://localhost:8080/abc/RaceCalc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Because you have two different namespaces on your implementation: {http://service.wrapper.ie/} and {http://impl.service.wrapper.ie/}. You surely have the interface in package ie.wrapper.service and the implementation in ie.wrapper.service.impl. CXF is therefore assuming the namespace {http://service.wrapper.ie/} for the logical stuff (interface/portType) and the namespace {http://impl.service.wrapper.ie/} for the physical stuff (impl/service/binding). Adding the #WebService(targetNamespace = "http://whatever.you.want") annotation to both, interface and implementation should remove the (need of an) import in the WSDL.
Related
I am trying to register a WSDL in policy studio under location:
Business Services > Web Service Repository > Web Service
but while registering I am getting this error:
Couldn't Generate WSFilter
I also validated the WSDL through WS-i basic profile and the result was passed.
Kindly help me to resolve the issue.
Here is the WSDL that I am trying to register:
<wsdl:definitions xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:client="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Test_SOA_Service" targetNamespace="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service">
<wsdl:documentation>
<abstractWSDL>
http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service!1.0/Test_SOA_Service.wsdl
</abstractWSDL>
</wsdl:documentation>
<plnk:partnerLinkType name="Test_SOA_Service">
<plnk:role name="Test_SOA_ServiceProvider">
<plnk:portType name="client:Test_SOA_Service"/>
</plnk:role>
</plnk:partnerLinkType>
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/Test_SOA_Service/Test_SOA_Service" schemaLocation="http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service/test_soa_service_client_ep?XSD=xsd/Test_SOA_Service.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="Test_SOA_ServiceRequestMessage">
<wsdl:part name="payload" element="client:process"/>
</wsdl:message>
<wsdl:message name="Test_SOA_ServiceResponseMessage">
<wsdl:part name="payload" element="client:processResponse"/>
</wsdl:message>
<wsdl:portType name="Test_SOA_Service">
<wsdl:operation name="process">
<wsdl:input message="client:Test_SOA_ServiceRequestMessage"/>
<wsdl:output message="client:Test_SOA_ServiceResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Test_SOA_ServiceBinding" type="client:Test_SOA_Service">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="process">
<soap:operation style="document" soapAction="process"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="test_soa_service_client_ep">
<wsdl:port name="Test_SOA_Service_pt" binding="client:Test_SOA_ServiceBinding">
<soap:address location="http://soadev1.cp.np.com:1234/soa-infra/services/Test_SOA_Service/test_soa_service_client_ep"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I found the answer. Vordel is configured in such a way that can hit only OSB services. Here i am trying to hit the BPEL service.
I created a WSDL and exposed a web service as CXF endpoint at JBoss Fuse. I specified one wsdl:binding and one wsdl:service in the WSDL, but after deployed it to JBoss Fuse and accessed http://localhost:8081/PlaceOrderService?wsdl, I got duplicate wsdl:binding and wsdl:service. Anyone know why?
WSDL - one wsdl:binding and wsdl:service
<wsdl:message name="orderRecordRequest">
<wsdl:part name="orderRecordInput" element="typens:orderRecordRequest" />
</wsdl:message>
<wsdl:message name="orderRecordResponse">
<wsdl:part name="orderRecordOutput" element="typens:orderRecordResponse"/>
</wsdl:message>
<wsdl:portType name="PlaceOrderService">
<wsdl:operation name="OrderService">
<wsdl:input message="tns:orderRecordRequest"/>
<wsdl:output message="tns:orderRecordResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PlaceOrderServiceSOAPBinding" type="tns:PlaceOrderService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="OrderService">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PlaceOrderService">
<wsdl:port binding="tns:PlaceOrderServiceSOAPBinding" name="PlaceOrderPort">
<soap:address location="http://localhost:8081/PlaceOrderService"/>
</wsdl:port>
</wsdl:service>
http://localhost:8081/PlaceOrderService?wsdl
duplicate wsdl:binding and wsdl:service
<wsdl:binding name="PlaceOrderServiceSOAPBinding" type="tns:PlaceOrderService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="OrderService">
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PlaceOrderServiceSoapBinding" type="tns:PlaceOrderService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="OrderService">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PlaceOrderServiceService">
<wsdl:port binding="tns:PlaceOrderServiceSoapBinding" name="PlaceOrderServicePort">
<soap:address location="http://localhost:8081/PlaceOrderService"/>
</wsdl:port>
</wsdl:service>
<wsdl:service name="PlaceOrderService">
<wsdl:port binding="tns:PlaceOrderServiceSOAPBinding" name="PlaceOrderPort">
<soap:address location="http://localhost:8081/PlaceOrderService"/>
</wsdl:port>
</wsdl:service>
I know I'm late for that train, but for those with similar issues: note the different case in bindings name, make sure names in WSDL match names in generated Java classes.
I have the following part of wsdl file:
<wsdl:binding name="Binding" type="intf:PortType">
<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<wsdl:operation name="Op1">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body use="encoded" namespace="Op1" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="encoded" namespace="services:ca" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Op2">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body use="encoded" namespace="Op2" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="encoded" namespace="services:ca" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Op3">
<wsdlsoap:operation soapAction=""/>
<wsdl:input>
<wsdlsoap:body use="encoded" namespace="Op3" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body use="encoded" namespace="services:ca" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
The problem is that soapcpp2 generates soapBidingProxy.h files iteratively, effectively overwriting old file (for Op1 and Op2), and leaving me with proxy class for Op3 only. Is this soapcpp2 bug, or I am doing something wrong.
I figured it out. The problem was that in the input body namespace. If the namespace is the same for all operations, the generated file is only one, and includes all the methods. Thanks All.
In my previous question I was told that CXF implements the javax.xml.ws.BindingProvider interface.
I've the following WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<!-- May 30, 2006 -->
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:interface="http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/interface" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/service" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="parlayx_sms_send_service" targetNamespace="http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/service">
<wsdl:import location="parlayx_sms_send_interface_2_2.wsdl" namespace="http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/interface"/>
<wsdl:binding name="SendSmsBinding" type="interface:SendSms">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="sendSms">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getSmsDeliveryStatus">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="sendSmswithUDH">
<soap:operation soapAction="" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceException">
<soap:fault name="ServiceException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="PolicyException">
<soap:fault name="PolicyException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SendSmsService">
<wsdl:port binding="tns:SendSmsBinding" name="SendSms">
<soap:address location="http://202.126.44.5:9080/SendSmsServices/services/SendSms"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And the CXF creates sendSmsService and interface called sendSms but none of them is related to BindingProvider interface, and I have to find a way to set to this service user name, password and endpoint.
How can I find the binding interface or is there another way I can do it? Thanks.
I have problem when I import wsdl in Delphi. My soap header is not added in my binding.
What is the problem ?
<wsdl:operation name="singleSms">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:header use="literal" part="request_header" message="tns:identityHeader"></soap:header>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
http://www.smsconnect.ma:8000/wsdl/MCMS.wsdl