Getting error while envoking rest API URL - rest

I have created an API in wso2 ESB as:
<api xmlns="http://ws.apache.org/ns/synapse" name="getUUIDAPI" context="/getUUID">
<resource methods="GET" uri-template="?Name={searchValue}" inSequence="getUUIDIN" outSequence="CommonJsonOut"/>
</api>
and it gives me an API Invocation URL as http://10.224.64.97:8280/getUUID. Now when i try this rest service in my browser as :
http://10.224.64.97:8280/getUUID?Name=uvu
, In the esb i get error as :
TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.axis2.description.ClientUtils} - The system cannot infer the transport information from the
/getUUID?Name=uvu?Name=uvu URL. {org.apache.axis2.description.ClientUtils}
TID: [0] [ESB] [2013-06-26 10:25:50,796] ERROR {org.apache.synapse.core.axis2.Axis2Sender} - Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.AxisFault: The system cannot infer the transport information from the /getUUID?Name=uvu?Name=uvu URL.
at org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:81)
at org.apache.synapse.core.axis2.DynamicAxisOperation$DynamicOperationClient.executeImpl(DynamicAxisOperation.java:115)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:316)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
at org.apache.synapse.endpoints.WSDLEndpoint.send(WSDLEndpoint.java:69)
at org.apache.synapse.endpoints.IndirectEndpoint.send(IndirectEndpoint.java:54)
at org.apache.synapse.mediators.builtin.SendMediator.mediate(SendMediator.java:95)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
at org.apache.synapse.rest.Resource.process(Resource.java:306)
at org.apache.synapse.rest.API.process(API.java:308)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:76)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:63)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:182)
at org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:204)
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:722)
As you can see in the above error the url it is hitting is /getUUID?Name=uvu?Name=uvu but i am sending /getUUID?Name=uvu.
Why i am getting this strange error? If i copy the api file, sequences associated with api to other server's esb and then i hit with above url i get the response.
Please help me on this. Thanks in advance

define something like this;
uri-template="/{searchValue}"

Related

WSO2 REST request box not working

I get the following error when I send a REST request with a request_box payload to WSO2 using WSO2 Tryit tool:
<axis2ns539:DataServiceFault xmlns:axis2ns539="http://ws.wso2.org/dataservice">
<axis2ns539:ds_code>UNKNOWN_ERROR</axis2ns539:ds_code>
This is what is echoed on the console:
[2017-12-08 20:01:22,939] [] ERROR - ServerWorker Error processing POST request for : /services/TestICM.HTTPEndpoint/request_box
org.apache.axis2.AxisFault: DS Fault Message: Input Message and request_box Axis Operation didn't match.
I tried also with Postman and got the same error.
Thank you very much

Mobile First 7.1 SOAP Adapter failed to read response

I have used IBM MobileFirst Studio V7.1 - Service Discovery wizard option and created a SOAP adapter from a application WSDL file. The Service Discovery procedure correctly creates the MobileFirst adapter in the MFP Studio.
The sample message payload is as follows.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fet="http://siebel.com/asi/Fetch Account Info">
<soapenv:Body>
<fet:ExecuteFetchAccountInfo_Input>
<fet:Object_spcId>1-6U8KAR</fet:Object_spcId>
</fet:ExecuteFetchAccountInfo_Input>
</soapenv:Body>
</soapenv:Envelope>
Now, using the adapter testing option in the MobileFirst Studio, the following JSON payload are being passed in the dialog window
params:
{"ExecuteFetchAccountInfo_Input":{"Object_spcId":"1-6U8KAR"}}
But I get the following error when I call the adapter
{
"errors": [
"Runtime: Failed to read the HTTP response to: \/eai_enu\/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute \njava.io.EOFException: Unexpected end of ZLIB input stream"
],
"info": [
],
"isSuccessful": false,
"warnings": [
]
}
Also when I tried to check the log files. I was able to capture the request and response.
Request:
[2/16/16 11:27:10:997 IST] 000001ce com.worklight.integration.model.ProcedureInvoker I FWLSE0318I: request:
/eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<tns:ExecuteFetchAccountInfo_Input xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://siebel.com/asi/Fetch Account Info" xmlns:xsdLocal1="http://www.siebel.com/xml/Account%20IO" >
<tns:Object_spcId>1-6U8KAR</tns:Object_spcId>
</tns:ExecuteFetchAccountInfo_Input>
</soap:Body>
</soap:Envelope>
Response:
response:
OK
Date=Tue, 16 Feb 2016 05:34:35 GMT
Server=Microsoft-IIS/6.0
X-Powered-By=ASP.NET
_charset=UTF-8
cache-control=no-cache, must-revalidate, max-age=0
pragma=no-cache
transfer-encoding=Chunked
content-type=text/xml;charset=UTF-8
[project IBMBankProject]
[2/16/16 11:27:11:000 IST] 000001ce om.worklight.integration.services.impl.DataAccessServiceImpl E FWLSE0099E: An error occurred while invoking procedure [project IBMBankProject]SoapAdapter1/HttpRequestFWLSE0100E: parameters: [project IBMBankProject]
Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
FWLSE0101E: Caused by: [project IBMBankProject]java.lang.RuntimeException: java.io.EOFException: Unexpected end of ZLIB input streamjava.lang.RuntimeException: Failed to read the HTTP response to: /eai_enu/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute
java.io.EOFException: Unexpected end of ZLIB input stream
By looking at the response it says the response if Ok but it is unable to read it. Please help if I need to set-up something extra to read the response.
It turns out that there was a defect here that needed to be fixed. The APAR number is PI67417 and it can be downloaded from Fix Central.
Once you've applied the iFix, you'll also need to add "Accept-Encoding: identity" to your adapter call. That should resolve your issue. If it doesn't please let me know.
Since this is working in SOAP UI but fails in the adapter, it may indicate a product defect. Please open an IBM PMR and provide your files for reproduction by the development team.

Apache CXF (Mule) Invalid QName in mapping: SOAP-ENV:Client

I'm using Apache CXF 2.5.9 within Mule ESB 3.5.0 CE for a Web Service client. If the soap message validation fails on server I get a soap fault (naturally) that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>https://10.1.104.105:8444/DohvatiIzOIBaF2FAServiceTest: cvc-simple-type 1: element {http://www.apis-it.hr/fin/2008/elements/DohvatIzOIBa}OIB value '716500116650' is not a valid instance of type {http://www.apis-it.hr/fin/2008/types/f63}String11BrojType</faultstring>
<faultactor>OIB CIS pristupni čvor</faultactor>
</soapenv:Fault>
..but when client side tries to unmarshall the fault I get this exception:
2014-12-13 13:52:34,199 [WARN] org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://www.apis-it.hr/fin/2010/services/DohvatiIzOIBaF2FAService}DohvatiIzOIBaF2ServicePortTypeService#{http://www.apis-it.hr/fin/2010/services/DohvatiIzOIBaF2FAService}DohvatiFOPoOIBu has thrown exception, unwinding now
java.lang.RuntimeException: Invalid QName in mapping: SOAP-ENV:Client
at org.apache.cxf.staxutils.StaxUtils.readQName(StaxUtils.java:1399)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:59)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:114)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:801)
I want the CXF client to unmarshall the soap fault to exception. How to get around this error?
Try making SOAP-ENV:Client something like this 12345, making the fault code a number solved it for me.
Mule won't catch the exception itself.
You should probably use a cxf fault interceptor. From there you can compose the message you are expecting.
Alternativly you could use the CXF transform feature
You need:
<entry key="faultcode" value="faultcode=soapenv:Client"/>
This will map the original invalid fault from the server into the following valid fault so that it can be accepted by the cxf client
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>An error occurred</faultstring>
</soapenv:Fault>

Error: No conduit initiator was found

currently I am working with SOAP service and Mule ESB.
But my SOAP service always return following error:
No conduit initiator was found for the namespace http://ae7.iuk.fraport.de/esb/soap/bindings/esbp.. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: UebermittleAusweisdatenRequest
Here is the full stacktrace:
What is the caused of those error? And how can I fix it? Thanks

WSO2 SingleSign ON

I am new to WSO2 and I follow this post to enable Single Sign On (SSO) for the following scenario:
Virtual machine running centos (IP: 192.168.0.18)
WSO2 IdentityServer 4.1.0 installed with https port: 9443
WSO2 ApplicationServer 5.1.0 installed with https port: 9443
Here is the problem:
when I access the application server console management, I am
redirected to the identity provider login page as expected and I can
login.
I am then redirected to the initial request (Application Server MGT
Console) but a message appears telling me that the
Authentication/Authorization fails.
In log files I can see following error:
TID: [0] [AS] [2013-05-14 16:13:32,128] INFO
{org.wso2.carbon.identity.authenticator.saml2.sso.common.builders.AuthenticationRequestBuilder}
- Building Authentication Request {org.wso2.carbon.identity.authenticator.saml2.sso.common.builders.AuthenticationRequestBuilder}
TID: [0] [AS] [2013-05-14 16:13:32,388] ERROR
{org.wso2.carbon.identity.authenticator.saml2.sso.util.Util} -
Content is not allowed in prolog.
{org.wso2.carbon.identity.authenticator.saml2.sso.util.Util} TID: [0]
[AS] [2013-05-14 16:13:32,389] ERROR
{org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticator}
- System error while Authenticating/Authorizing User : Error occured while processing saml2 response
{org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticator}
org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticatorException:
Error occured while processing saml2 response
at org.wso2.carbon.identity.authenticator.saml2.sso.util.Util.unmarshall(Util.java:87)
at org.wso2.carbon.identity.authenticator.saml2.sso.SAML2SSOAuthenticator.login(SAML2SSOAuthenticator.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
I search the net for this error but I was not able to find something that could help me to solve this problem.
Any help is welcome.
Thanks.
this is due to a version difference between the SAML components being used in the two servers. We will make a public patch available.