How to find the binding interface cxf is creating - web-services

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.

Related

Receive duplicate wsdl:binding and wsdl:service when accessing ?wsdl page

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.

WCF Service after changing functionality the wsdl is changed

We have an old Homepage which is using our WCF Service. Now we must change some things at the functionality of the service but not the Interface. Only within the service functions! After deploying the new service the Homepage can't get the service functions. I compared the old and new wsdl and there are some changes:
Old wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="DataService"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:i0="http://service.bizztools.de/services/dataservice"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:tns="http://tempuri.org/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="WSHttpBinding_IDataService_policy">
<wsp:ExactlyOne>
<wsp:All>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:import location="https://<server>/Service.svc?wsdl=wsdl0" namespace="http://service.bizztools.de/services/dataservice"/>
<wsdl:types/>
<wsdl:binding name="WSHttpBinding_IDataService" type="i0:IDataService">
<wsp:PolicyReference URI="#WSHttpBinding_IDataService_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetSalesPartnerData">
<soap12:operation style="document" soapAction="http://service.bizztools.de/services/dataservice/IDataService/GetSalesPartnerData"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DataServiceDbErrorFault">
<soap12:fault name="DataServiceDbErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="AuthenticationErrorFault">
<soap12:fault name="AuthenticationErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="DataServiceFormatErrorFault">
<soap12:fault name="DataServiceFormatErrorFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="BasicHttpBinding_IDataService" type="i0:IDataService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetSalesPartnerData">
<soap:operation style="document" soapAction="http://service.bizztools.de/services/dataservice/IDataService/GetSalesPartnerData"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DataServiceDbErrorFault">
<soap:fault name="DataServiceDbErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="AuthenticationErrorFault">
<soap:fault name="AuthenticationErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="DataServiceFormatErrorFault">
<soap:fault name="DataServiceFormatErrorFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DataService">
<wsdl:port name="WSHttpBinding_IDataService" binding="tns:WSHttpBinding_IDataService">
<soap12:address location="http://<server>/Service.svc/dataservice"/>
<wsa10:EndpointReference>
<wsa10:Address>http://<server>/Service.svc/dataservice</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_IDataService" binding="tns:BasicHttpBinding_IDataService">
<soap:address location="http://<server>/Service.svc/dataservicebasic"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
New wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="DataService"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
xmlns:wsa10="http://www.w3.org/2005/08/addressing"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:i0="http://service.bizztools.de/services/dataservice"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:tns="http://tempuri.org/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="WSHttpBinding_IDataService_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<wsaw:UsingAddressing/>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsp:Policy wsu:Id="BasicHttpBinding_IDataService_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>+
<wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:import location="https://<server>/Service.svc?wsdl=wsdl0" namespace="http://service.bizztools.de/services/dataservice"/>
<wsdl:types/>
<wsdl:binding name="WSHttpBinding_IDataService" type="i0:IDataService">
<wsp:PolicyReference URI="#WSHttpBinding_IDataService_policy"/>
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetSalesPartnerData">
<soap12:operation style="document" soapAction="http://service.bizztools.de/services/dataservice/IDataService/GetSalesPartnerData"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DataServiceDbErrorFault">
<soap12:fault name="DataServiceDbErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="DataServiceFormatErrorFault">
<soap12:fault name="DataServiceFormatErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="AuthenticationErrorFault">
<soap12:fault name="AuthenticationErrorFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="BasicHttpBinding_IDataService" type="i0:IDataService">
<wsp:PolicyReference URI="#BasicHttpBinding_IDataService_policy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetSalesPartnerData">
<soap:operation style="document" soapAction="http://service.bizztools.de/services/dataservice/IDataService/GetSalesPartnerData"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DataServiceDbErrorFault">
<soap:fault name="DataServiceDbErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="DataServiceFormatErrorFault">
<soap:fault name="DataServiceFormatErrorFault" use="literal"/>
</wsdl:fault>
<wsdl:fault name="AuthenticationErrorFault">
<soap:fault name="AuthenticationErrorFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DataService">
<wsdl:port name="WSHttpBinding_IDataService" binding="tns:WSHttpBinding_IDataService">
<soap12:address location="https://<server>/Service.svc/dataservice"/>
<wsa10:EndpointReference>
<wsa10:Address>https://<server>/Service.svc/dataservice</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_IDataService" binding="tns:BasicHttpBinding_IDataService">
<soap:address location="https://<server>/Service.svc/dataservicebasic"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
It seems that the problem is the wsp:policy. Why has the new wsdl this policy and the old one not? How can I change the wsdl. Unfotunately we can't change the Homepage!
I using Microsoft Visual Studio 2010 for creating the WCF Service.
I found the problem myself. It wasn't the different wsdl. It was a problem with the AddressFiltering at the IIS. I got the error message: The message with To 'http://<service>' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree'. So I fixed the Problem with the Attribute [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] on the service class.

CXF autogenerates WSDL imports itself?

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.

gSOAP wrong proxy C++ class generated for multiple operations

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.

Importing wsdl in Delphi don't add soap header

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