Quantcast
Channel: SCN : Discussion List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2881

WCF webservice with RPC/encoding

$
0
0

Hi,

 

I want to create a webservice with a RPC/encoded style. The webservice is supposed to replace a webservice which is being hosted on an EAServer.

 

The client sends the following request

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://XYZ"><SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns1:keepalive><in0>PD94...ZT4KAA==</in0></ns1:keepalive></SOAP-ENV:Body></SOAP-ENV:Envelope>

 

which represents a call with a base64Binary parameter and response with a base64Binary.

 

I added the ServiceAttribute "XmlSerializerFormat" and the OperationAttribute "XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)" to the WCFAttributes.xml file.

 

I got this WSDL configuration:

 

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="u_nvoint_ttt_iis" targetNamespace="http://XYZ" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
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:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://XYZ" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">

<wsdl:types><xsd:schema targetNamespace="http://XYZ/Imports">
<xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
</xsd:schema></wsdl:types>
<wsdl:message name="u_nvoint_ttt_iis_keepalive_InputMessage">
<wsdl:part name="xml_message" type="xsd:base64Binary"/>
</wsdl:message>
<wsdl:message name="u_nvoint_ttt_iis_keepalive_OutputMessage">
<wsdl:part name="keepaliveResult" type="xsd:base64Binary"/>
</wsdl:message><wsdl:portType name="u_nvoint_ttt_iis">
<wsdl:operation name="keepalive" parameterOrder="xml_message">
<wsdl:input wsaw:Action="http://XYZ/u_nvoint_ttt_iis/keepalive" message="tns:u_nvoint_ttt_iis_keepalive_InputMessage"/>
<wsdl:output wsaw:Action="http://XYZ/u_nvoint_ttt_iis/keepaliveResponse" message="tns:u_nvoint_ttt_iis_keepalive_OutputMessage"/>
</wsdl:operation></wsdl:portType>
<wsdl:binding name="BasicHttpBinding_u_nvoint_ttt_iis" type="tns:u_nvoint_ttt_iis">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<wsdl:operation name="keepalive">
<soap:operation soapAction="http://XYZ/u_nvoint_ttt_iis/keepalive" style="rpc"/>
<wsdl:input>
<soap:body use="encoded" namespace="http://XYZ" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input><wsdl:output>
<soap:body use="encoded" namespace="http://XYZ" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="u_nvoint_ttt_iis">
<wsdl:port name="BasicHttpBinding_u_nvoint_ttt_iis" binding="tns:BasicHttpBinding_u_nvoint_ttt_iis">
<soap:address location="http://myhost/webkv/u_nvoint_ttt_iis.svc"/>
</wsdl:port></wsdl:service></wsdl:definitions>

 

When I send the request I got the following error:

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

 

What is wrong ?

 

Regards

Christian


Viewing all articles
Browse latest Browse all 2881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>