Reputation: 421
I'm trying to add a SOAP API to APIM 1.10.0.
First, I'll try to test the SOAP service itself, using the following CURL. The service should return weather conditions of a given city/country:
curl -X POST -T soap.xml -H "Content-Type: text/xml" \
"http://www.webservicex.net/globalweather.asmx"
Providing the following soap.xml:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetWeather xmlns="http://www.webserviceX.NET">
<CityName>Eilat</CityName>
<CountryName>Israel</CountryName>
</GetWeather>
</soap:Body>
</soap:Envelope>
I receive a sensible response!
Now I introduce this service to APIM, as follows:
- Add new API
- I have a SOAP endpoint
- WSDL URL: http://www.webservicex.net/globalweather.asmx?wsdl
- Start Creating
- Name: eilat
- Context: /eilat
- Version: 1.0.0
- WSDL: http://www.webservicex.net/globalweather.asmx?wsdl [tested ok]
- Production Endpoint: http://www.webservicex.net/globalweather.asmx [valid]
- Tier Availability: Unlimited
I subscribe to this API, and try the following CURL
curl -H "Authorization: Bearer <my-key>" -X POST -T soap.xml \
-H "Content-Type: text/xml" http://localhost:8280/eilat/1.0.0
I get the following reply:
<faultstring>unknown</faultstring>
Trying the same in SOAP UI, I get:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>unknown</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
With #status#: HTTP 1.1/500 Internal Server Error
Looking at the logs:
1) http_access_2016-01-17.log
127.0.0.1 - - [17/Jan/2016:16:53:34 +0200]
"POST /eilat/1.0.0 HTTP/1.1" - 482 "-"
"curl/7.19.7 (x86_64-redhat-linux-gnu)
libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2"
2) wso2-apigw-errors.log
2016-01-17 16:53:34,364 [-] [PassThroughMessageProcessor-374]
ERROR ServerWorker Error processing
POST reguest for :
/eilat/1.0.0. Error detail: null. java.lang.NullPointerException
3) wso2carbon.log
INFO {org.apache.synapse.rest.API} -
Initializing API: admin--eilat:v1.0.0 {org.apache.synapse.rest.API}
INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
'[email protected] [-1234]' logged in at [2016-01-17 16:52:51,282+0200]
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil}
ERROR {org.apache.synapse.transport.passthru.ServerWorker} -
Error processing POST reguest for : /eilat/1.0.0.
Error detail: null.
{org.apache.synapse.transport.passthru.ServerWorker}
java.lang.NullPointerException
Looking at the API again, I see that WSDL URL is changed from the URL I provided, to the following:
/registry/resource/_system/governance/apimgt/applicationdata/wsdls/admin--eilat1.0.0.wsdl
I guess this is normal behavior.
Question is - why the Null Pointer Exception?
Upvotes: 0
Views: 1032
Reputation: 421
Error was caused due to a custom authentication plugin handler. Removing this handler from the chain of handlers solved the problem.
Upvotes: 0