SOAP-ERROR: Encoding: Violation of encoding rules

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
ramkumar1
Forum Newbie
Posts: 2
Joined: Sun Jan 22, 2012 11:22 pm

SOAP-ERROR: Encoding: Violation of encoding rules

Post 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
ramkumar1
Forum Newbie
Posts: 2
Joined: Sun Jan 22, 2012 11:22 pm

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

Post by ramkumar1 »

Hi Guys,

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

Thank you
Post Reply