Hi Vijayaratha,

Using a endpoint as you mentioned solved the issue. Really appreciate and
thanks your help. +1



On Fri, Jun 20, 2014 at 3:12 PM, Vijayaratha Vijayasingam <[email protected]>
wrote:

> You can try with RESTAPI ..i believe you try to POST a message..
>
>
> On 20 June 2014 02:36, Manil Liyanage <[email protected]> wrote:
>
>> Hi,
>>
>> In soundcloud, I'm trying to add a connection(twitter service) to my
>> account, the URL is given below[1] and the message are passed from the url.
>> There is no body been sent. Basically the below link works when invoked
>> through the rest client extension in firefox. It will send me back the
>> authorized url in a xml body[2]
>>
>> POST
>> [1]
>>
>> https://api.soundcloud.com/me/connections.xml?oauth_token=MYTOKEN&amp;service=twitter&amp;redirect_uri=https://www.example.com/soundcloud
>>  
>> <https://api.soundcloud.com/me/connections.xml?oauth_token=MYTOKEN&service=twitter&redirect_uri=https://www.example.com/soundcloud>
>>
>>
>>
>> [2]
>>
>> <connection>
>> <authorize-url>
>>
>> https://soundcloud.com/connect/twitter/new?external_identity%5Bpost_favorites%5D=false&external_identity%5Bpost_tracks%5D=true&external_identity%5Buser_id%5D=99675972&redirect_uri=https%3A%2F%2Fwww.example.com%2Fsoundcloud&signature=3046ec675f5a430c8ff7c617ac6a38e8
>> </authorize-url>
>> </connection>
>>
>>
>> On Fri, Jun 20, 2014 at 2:53 PM, Vijayaratha Vijayasingam <
>> [email protected]> wrote:
>>
>>> Are you posing empty message?
>>> What is the endpoint uRL you try to call?
>>> Do you want to send back the empty message to client?
>>> What is the scenario you are trying?
>>>
>>>
>>> On 19 June 2014 05:41, Manil Liyanage <[email protected]> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I Use the following code to send a post request to soundcloud API. In
>>>> rest client widget in firefox above url works. But when I do this from the
>>>> ESB proxy I get an error which I have shown at last.
>>>>
>>>> I tried adding <property name="REQUEST_HOST_HEADER" value="
>>>> api.soundcloud.com" scope="axis2"/> after the </call> tag and I tried
>>>> adding <parameter
>>>> name="ApplicationXMLBuilder.allowDTD">true</parameter> after the
>>>> </target> tag.
>>>>
>>>> It still gives me the same error. Please let me know a solution for
>>>> this. Thanks in Advance.
>>>>
>>>> Regards,
>>>> Manil Liyanage
>>>>
>>>> <proxy xmlns="http://ws.apache.org/ns/synapse";
>>>>
>>>>
>>>>
>>>>
>>>>        name="soundcloud"
>>>>        transports="https,http"
>>>>        statistics="disable"
>>>>        trace="disable"
>>>>        startOnLoad="true">
>>>>    <target>
>>>>
>>>>
>>>>
>>>>
>>>>       <inSequence>
>>>>          <property name="Accept-Encoding" scope="transport" 
>>>> action="remove"/>
>>>>          <payloadFactory media-type="xml">
>>>>             <format>
>>>>
>>>>
>>>>
>>>>
>>>>                <soapenv:Envelope 
>>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>>>>                   <soapenv:Header/>
>>>>
>>>>
>>>>
>>>>                   <soapenv:Body/>
>>>>
>>>>                </soapenv:Envelope>
>>>>             </format>
>>>>             <args/>
>>>>          </payloadFactory>
>>>>          <call>
>>>>             <endpoint>
>>>>                <http method="POST"
>>>>
>>>>
>>>>
>>>>
>>>>                      
>>>> uri-template="https://api.soundcloud.com/me/connections.xml?oauth_token=MYTOKEN&amp;service=twitter&amp;redirect_uri=https://www.example.com/soundcloud
>>>>  
>>>> <https://api.soundcloud.com/me/connections.xml?oauth_token=MYTOKEN&service=twitter&redirect_uri=https://www.example.com/soundcloud>"/>
>>>>
>>>>
>>>>
>>>>
>>>>             </endpoint>
>>>>          </call>
>>>>          <property name="messageType" value="application/xml" 
>>>> scope="axis2"/>
>>>>          <respond/>
>>>>       </inSequence>
>>>>
>>>>
>>>>
>>>>
>>>>       <outSequence/>
>>>>       <faultSequence/>
>>>>    </target>
>>>>    <description/>
>>>> </proxy>
>>>>
>>>>
>>>> ERROR MESSAGE IN ESB CONSOLE
>>>>
>>>> [2014-06-19 18:09:43,354] ERROR - RelayUtils Error while building 
>>>> Passthrough stream
>>>>
>>>>
>>>>
>>>>
>>>> org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: 
>>>> ParseError at [row,col]:[3,68]
>>>> Message: DOCTYPE is not allowed
>>>>    at 
>>>> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
>>>>    at 
>>>> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
>>>>    at 
>>>> org.apache.axiom.om.impl.AbstractOMMetaFactory.createStAXSOAPModelBuilder(AbstractOMMetaFactory.java:73)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> org.apache.axiom.om.impl.AbstractOMMetaFactory.createSOAPModelBuilder(AbstractOMMetaFactory.java:79)
>>>>    at 
>>>> org.apache.axiom.om.OMXMLBuilderFactory.createSOAPModelBuilder(OMXMLBuilderFactory.java:196)
>>>>    at 
>>>> org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:55)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:138)
>>>>    at 
>>>> org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:107)
>>>>    at 
>>>> org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:82)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:68)
>>>>    at 
>>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:239)
>>>>    at 
>>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:556)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:198)
>>>>    at 
>>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:488)
>>>>    at 
>>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:170)
>>>>
>>>>
>>>>
>>>>
>>>>    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>>>    at 
>>>> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:225)
>>>>    at 
>>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>>>
>>>>
>>>>
>>>>
>>>>    at 
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>    at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>    at java.lang.Thread.run(Thread.java:744)
>>>> Caused by: javax.xml.stream.XMLStreamException: ParseError at 
>>>> [row,col]:[3,68]
>>>>
>>>>
>>>>
>>>>
>>>> Message: DOCTYPE is not allowed
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> -Ratha
>>> mobile: (+94)755906608
>>>
>>
>>
>
>
> --
> -Ratha
> mobile: (+94)755906608
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to