Please find the template [1] , proxy [2] configurations and sample request [3].
[1] - <?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. WSO2 Inc. licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <template name="deletePayments" onError="fault" xmlns=" http://ws.apache.org/ns/synapse"> <parameter name="paymentMethodId" description="The payment method ID"/> <sequence> <property name="uri.var.zuora.paymentMethodId" expression="$func:paymentMethodId"/> <call> <endpoint> <http method="DELETE" uri-template="{uri.var.zuora.apiUrl}/{uri.var.zuora.apiVersion}/payment-methods/{uri.var.zuora.paymentMethodId}"/> </endpoint> </call> </sequence> </template> [2] - <?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="z" transports="http,https" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="apiAccessKeyId" expression="json-eval($.apiAccessKeyId)"/> <property name="apiSecretAccessKey" expression="json-eval($.apiSecretAccessKey)"/> <property name="paymentMethodId" expression="json-eval($.paymentMethodId)"/> <zuora.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$ctx:apiVersion}</apiVersion> <apiAccessKeyId>{$ctx:apiAccessKeyId}</apiAccessKeyId> <apiSecretAccessKey>{$ctx:apiSecretAccessKey}</apiSecretAccessKey> </zuora.init> <zuora.deletePayments> <paymentMethodId>{$ctx:paymentMethodId}</paymentMethodId> </zuora.deletePayments> <respond/> </inSequence> </target> <description/> </proxy> [3] - { "apiUrl": "https://apisandbox-api.zuora.com/rest", "apiVersion": "v1", "apiAccessKeyId": "a...@sample.com", "apiSecretAccessKey": "zuorapwd" } Thanks Kesavan Yogarajah Software Engineer Mobile :+94 (0) 779 758021 kesav...@wso2.com WSO2, Inc. lean . enterprise . middleware On Tue, Jun 7, 2016 at 1:16 PM, Malaka Silva <mal...@wso2.com> wrote: > Please share the synapse configs you are using? > > On Tue, Jun 7, 2016 at 12:33 PM, Kesavan Yogarajah <kesav...@wso2.com> > wrote: > >> Hi All, >> >> I am checking Zuora connector with ESB 5.0.0 - BETA.I am getting error >> [1] when the API response with 403 comes with no body.But this works fine >> with ESB -4.9.0 [2]. Is this an expected behavior? >> >> [1] >> >> [2016-06-07 11:43:43,212] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "DELETE /rest/v1/payment-methods/ HTTP/1.1[\r][\n]" >> [2016-06-07 11:43:43,213] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Authorization: Basic aXXXXXXXXXXXXXXXXXXX==[\r][\n]" >> [2016-06-07 11:43:43,213] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]" >> [2016-06-07 11:43:43,214] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Action: urn:deletePayments[\r][\n]" >> [2016-06-07 11:43:43,214] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Accept: */*[\r][\n]" >> [2016-06-07 11:43:43,214] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Cache-Control: no-cache[\r][\n]" >> [2016-06-07 11:43:43,215] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Postman-Token: b618abc9-99ca-9540-3332-b6302bb01e10[\r][\n]" >> [2016-06-07 11:43:43,215] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Accept-Encoding: gzip, deflate[\r][\n]" >> [2016-06-07 11:43:43,215] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Accept-Language: en-US,en;q=0.8[\r][\n]" >> [2016-06-07 11:43:43,215] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Content-Type: application/json[\r][\n]" >> [2016-06-07 11:43:43,215] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Host: apisandbox-api.zuora.com[\r][\n]" >> [2016-06-07 11:43:43,216] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "Connection: Keep-Alive[\r][\n]" >> [2016-06-07 11:43:43,216] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]" >> [2016-06-07 11:43:43,216] DEBUG - wire HTTPS-Sender I/O dispatcher-1 << >> "[\r][\n]" >> [2016-06-07 11:43:43,639] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "HTTP/1.1 403 Forbidden[\r][\n]" >> [2016-06-07 11:43:43,640] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Server: Zuora App[\r][\n]" >> [2016-06-07 11:43:43,640] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Access-Control-Allow-Credentials: true[\r][\n]" >> [2016-06-07 11:43:43,641] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Access-Control-Allow-Origin: >> chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]" >> [2016-06-07 11:43:43,641] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Content-Length: 0[\r][\n]" >> [2016-06-07 11:43:43,641] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Expires: Tue, 07 Jun 2016 06:13:43 GMT[\r][\n]" >> [2016-06-07 11:43:43,641] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Cache-Control: max-age=0, no-cache, no-store[\r][\n]" >> [2016-06-07 11:43:43,642] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Pragma: no-cache[\r][\n]" >> [2016-06-07 11:43:43,642] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Date: Tue, 07 Jun 2016 06:13:43 GMT[\r][\n]" >> [2016-06-07 11:43:43,642] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "Connection: keep-alive[\r][\n]" >> [2016-06-07 11:43:43,643] DEBUG - wire HTTPS-Sender I/O dispatcher-1 >> >> "[\r][\n]" >> [2016-06-07 11:43:43,663] ERROR - JsonUtil #writeAsJson. Payload could >> not be written as JSON. MessageID: >> urn:uuid:7cf1bb4f-1227-428f-ad6d-1899babf0b15 >> [2016-06-07 11:43:43,666] ERROR - PassThroughHttpSender Failed to submit >> the response >> org.apache.axis2.AxisFault: Payload could not be written as JSON. >> at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:260) >> at >> org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61) >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:555) >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264) >> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) >> at >> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212) >> at >> org.apache.synapse.mediators.builtin.RespondMediator.mediate(RespondMediator.java:35) >> at >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:87) >> at >> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:292) >> at >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:774) >> at >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282) >> at >> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:546) >> at >> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:179) >> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) >> at >> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:255) >> at >> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) >> at >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> [2016-06-07 11:43:43,670] ERROR - Axis2Sender >> Access-Control-Allow-Credentials:true,Access-Control-Allow-Origin:chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop,Cache-Control:max-age=0, >> no-cache, no-store,Expires:Tue, 07 Jun 2016 06:13:43 >> GMT,Pragma:no-cache,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> >> Unexpected error sending message back >> org.apache.axis2.AxisFault: Failed to submit the response >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.handleException(PassThroughHttpSender.java:613) >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:266) >> at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442) >> at >> org.apache.synapse.core.axis2.Axis2Sender.sendBack(Axis2Sender.java:212) >> at >> org.apache.synapse.mediators.builtin.RespondMediator.mediate(RespondMediator.java:35) >> at >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:87) >> at >> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:292) >> at >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:774) >> at >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282) >> at >> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:546) >> at >> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:179) >> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) >> at >> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:255) >> at >> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172) >> at >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> Caused by: org.apache.axis2.AxisFault: Payload could not be written as >> JSON. >> at org.apache.synapse.commons.json.JsonUtil.writeAsJson(JsonUtil.java:260) >> at >> org.apache.synapse.commons.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:61) >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:555) >> at >> org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:264) >> ... 15 more >> [2016-06-07 11:43:43,675] INFO - LogMediator To: , WSAction: , >> SOAPAction: , MessageID: urn:uuid:7cf1bb4f-1227-428f-ad6d-1899babf0b15, >> Direction: response, MESSAGE = Executing default 'fault' sequence, >> ERROR_CODE = 0, ERROR_MESSAGE = >> Access-Control-Allow-Credentials:true,Access-Control-Allow-Origin:chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop,Cache-Control:max-age=0, >> no-cache, no-store,Expires:Tue, 07 Jun 2016 06:13:43 >> GMT,Pragma:no-cache,<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope >> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body/></soapenv:Envelope> >> Unexpected error sending message back, Envelope: <?xml version='1.0' >> encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=" >> http://schemas.xmlsoap.org/soap/envelope/ >> "><soapenv:Body/></soapenv:Envelope> >> >> >> [2] - >> [2016-06-07 12:14:23,546] DEBUG - wire << "DELETE >> /rest/v1/payment-methods/ HTTP/1.1[\r][\n]" >> [2016-06-07 12:14:23,546] DEBUG - wire << "Authorization: Basic >> aXXXXXXXXXXXXXXXXXXX==[\r][\n]" >> [2016-06-07 12:14:23,546] DEBUG - wire << "Origin: >> chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]" >> [2016-06-07 12:14:23,547] DEBUG - wire << "Action: >> urn:deletePayments[\r][\n]" >> [2016-06-07 12:14:23,547] DEBUG - wire << "Accept: */*[\r][\n]" >> [2016-06-07 12:14:23,547] DEBUG - wire << "Cache-Control: >> no-cache[\r][\n]" >> [2016-06-07 12:14:23,547] DEBUG - wire << "Postman-Token: >> c668264d-75b9-fd31-6786-3763ce503d87[\r][\n]" >> [2016-06-07 12:14:23,547] DEBUG - wire << "Accept-Encoding: gzip, >> deflate[\r][\n]" >> [2016-06-07 12:14:23,548] DEBUG - wire << "Accept-Language: >> en-US,en;q=0.8[\r][\n]" >> [2016-06-07 12:14:23,548] DEBUG - wire << "Content-Type: >> application/json[\r][\n]" >> [2016-06-07 12:14:23,548] DEBUG - wire << "Host: >> apisandbox-api.zuora.com:443[\r][\n]" >> [2016-06-07 12:14:23,548] DEBUG - wire << "Connection: Keep-Alive[\r][\n]" >> [2016-06-07 12:14:23,548] DEBUG - wire << "User-Agent: >> Synapse-PT-HttpComponents-NIO[\r][\n]" >> [2016-06-07 12:14:23,549] DEBUG - wire << "[\r][\n]" >> [2016-06-07 12:14:24,543] DEBUG - wire >> "HTTP/1.1 403 Forbidden[\r][\n]" >> [2016-06-07 12:14:24,544] DEBUG - wire >> "Server: Zuora App[\r][\n]" >> [2016-06-07 12:14:24,544] DEBUG - wire >> >> "Access-Control-Allow-Credentials: true[\r][\n]" >> [2016-06-07 12:14:24,544] DEBUG - wire >> "Access-Control-Allow-Origin: >> chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]" >> [2016-06-07 12:14:24,545] DEBUG - wire >> "Content-Length: 0[\r][\n]" >> [2016-06-07 12:14:24,545] DEBUG - wire >> "Expires: Tue, 07 Jun 2016 >> 06:44:24 GMT[\r][\n]" >> [2016-06-07 12:14:24,545] DEBUG - wire >> "Cache-Control: max-age=0, >> no-cache, no-store[\r][\n]" >> [2016-06-07 12:14:24,545] DEBUG - wire >> "Pragma: no-cache[\r][\n]" >> [2016-06-07 12:14:24,546] DEBUG - wire >> "Date: Tue, 07 Jun 2016 >> 06:44:24 GMT[\r][\n]" >> [2016-06-07 12:14:24,546] DEBUG - wire >> "Connection: keep-alive[\r][\n]" >> [2016-06-07 12:14:24,546] DEBUG - wire >> "[\r][\n]" >> [2016-06-07 12:14:24,570] DEBUG - wire << "HTTP/1.1 403 Forbidden[\r][\n]" >> [2016-06-07 12:14:24,570] DEBUG - wire << "Cache-Control: max-age=0, >> no-cache, no-store[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Access-Control-Allow-Origin: >> chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << >> "Access-Control-Allow-Credentials: true[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Expires: Tue, 07 Jun 2016 >> 06:44:24 GMT[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Pragma: no-cache[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Date: Tue, 07 Jun 2016 >> 06:44:24 GMT[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Transfer-Encoding: >> chunked[\r][\n]" >> [2016-06-07 12:14:24,571] DEBUG - wire << "Connection: keep-alive[\r][\n]" >> [2016-06-07 12:14:24,572] DEBUG - wire << "[\r][\n]" >> [2016-06-07 12:14:24,572] DEBUG - wire << "0[\r][\n]" >> [2016-06-07 12:14:24,572] DEBUG - wire << "[\r][\n]" >> >> Thanks >> >> Kesavan Yogarajah >> Software Engineer >> Mobile :+94 (0) 779 758021 >> kesav...@wso2.com >> WSO2, Inc. >> lean . enterprise . middleware >> > > > > -- > > Best Regards, > > Malaka Silva > Senior Technical Lead > M: +94 777 219 791 > Tel : 94 11 214 5345 > Fax :94 11 2145300 > Skype : malaka.sampath.silva > LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77 > Blog : http://mrmalakasilva.blogspot.com/ > > WSO2, Inc. > lean . enterprise . middleware > http://www.wso2.com/ > http://www.wso2.com/about/team/malaka-silva/ > <http://wso2.com/about/team/malaka-silva/> > https://store.wso2.com/store/ > > Save a tree -Conserve nature & Save the world for your future. Print this > email only if it is absolutely necessary. >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev