Page 1 of 1

SOAP-ERROR: Encoding: Violation of encoding rules

Posted: Sun Jan 22, 2012 11:29 pm
by ramkumar1
Hi,

I am using php soap and xml. I have to pass a base64 encoded value through soap but I get the error

SOAP-ERROR: Encoding: Violation of encoding rules

The value that I am trying to be base64 is given in bold and is under the

<message name='UsernameTokenRequest'>

I have given my xml below,

<?xml version="1.0" ?>
<definitions name="jedproducts"

targetNamespace="urn:jedproductWSDL"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:jedproductWSDL"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">


<message name='UsernameTokenRequest'>

<part name="return" type='xsd:int' />
<part name="domain" type='xsd:string' />
</message>

<message name='UsernameTokenResponse'>
<!--<part name="return" type="tns:passwordval[]" />!-->
<part name="return" type='xsd:string' />
</message>

<!--function callback!-->
<message name='callBack_funcRequest'>
<part name='module_name' type='xsd:string'/>
<part name='func_name' type='xsd:string'/>
<part name='param_val' type='xsd:string'/>
</message>

<message name='callBack_funcResponse'>
<part name='Result' type='xsd:string'/>
</message>
<!--function callbackends!-->

<portType name="jedproductWSDLPortType">

<operation name='UsernameToken'>
<input message='tns:UsernameTokenRequest'/>
<output message='tns:UsernameTokenResponse'/>
</operation>

<!--function callback!-->
<operation name='callBack_func'>
<input message='tns:callBack_funcRequest'/>
<output message='tns:callBack_funcResponse'/>
</operation>
<!--function callbackends!-->

</portType>

<binding name="jedproductWSDLBinding" type="tns:jedproductWSDLPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<operation name='UsernameToken'>
<soap:operation soapAction='urn:jedproductWSDL#UsernameToken' style="rpc"/>
<input>
<soap:body use='encoded' namespace='urn:jedproductWSDL' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:jedproductWSDL' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>

<!--function callback!-->
<operation name='callBack_func'>
<soap:operation soapAction='urn:jedproductWSDL#callBack_func' style="rpc"/>
<input>
<soap:body use='encoded' namespace='urn:jedproductWSDL' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</input>
<output>
<soap:body use='encoded' namespace='urn:jedproductWSDL' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
</output>
</operation>
<!--function callbackends!-->

</binding>

<service name="jedproductWSDL">
<port name="jedproductWSDLPort" binding="tns:jedproductWSDLBinding">
<!--<soap:address location="url"/>!-->
<soap:address location="anyurl"/>
</port>
</service>

</definitions>


Please help

Thank you

Re: SOAP-ERROR: Encoding: Violation of encoding rules

Posted: Mon Jan 23, 2012 9:20 pm
by ramkumar1
Hi Guys,

I sorted out this issue by myself I used base64Binay and it worked

Thank you