I noticed after we create the API using a HTTP client when we publish the
same, though in the index page it shows API as PUBLISHED  the Life cycle
state  under the 'Life cycle' tab , API state is shown as CREATED.
Investigating further I found that the  reason behind this issue is tough
we send the production-url using HTTP client as a url parameter [1] due to
some reason it gets ignored at the API Implementation stage ,when trying to
publish the API. However when we submit the the same request with request
headers from the web browser it correctly updates the production url and
hence the API gets published correctly. What could be the reason for this?


[1]    urlParameters.add(new BasicNameValuePair("implementation_methods",
"endpoint"));
        urlParameters.add(new BasicNameValuePair("endpoint_type", "http"));
        urlParameters.add(new BasicNameValuePair("endpoint_config",
"{\"production_endpoints\":{\"url\":\"
http://gdata.youtube.com/feeds/api/standardfeeds\
",\"config\":null},\"endpoint_type\":\"http\"}"));
        urlParameters.add(new BasicNameValuePair("production_endpoints", "
http://gdata.youtube.com/feeds/api/standardfeeds";));
        urlParameters.add(new BasicNameValuePair("sandbox_endpoints", ""));
        urlParameters.add(new BasicNameValuePair("endpointType",
"nonsecured"));
        urlParameters.add(new BasicNameValuePair("epUsername", "admin"));
        urlParameters.add(new BasicNameValuePair("epPassword", "admin"));
        urlParameters.add(new BasicNameValuePair("wsdl", ""));
        urlParameters.add(new BasicNameValuePair("wadl", ""));
        urlParameters.add(new BasicNameValuePair("name", apiName));
        urlParameters.add(new BasicNameValuePair("version", apiVersion));
        urlParameters.add(new BasicNameValuePair("provider", "admin"));
        urlParameters.add(new BasicNameValuePair("action", "implement"));
        urlParameters.add(new BasicNameValuePair("swagger",
"{\"apiVersion\":\"1.0.0\",\"swaggerVersion\":\"1.2\",\"authorizations\":{\"oauth2\":{\"scopes\":[],\"type\":\"oauth2\"}},\"apis\":[{\"file\":{\"apiVersion\":\"1.0.0\",\"basePath\":\"
http://10.100.0.42:8280/CrossProductsAPI2Context/1.0.0\",\"swaggerVersion\":\"1.2\",\"resourcePath\":\"/default\",\"apis\":[{\"path\":\"/*\",\"operations\":[{\"nickname\":\"get_*\",\"method\":\"GET\",\"parameters\":[{\"description\":\"Request
Body\",\"name\":\"body\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\",\"paramType\":\"body\"}]},{\"nickname\":\"post_*\",\"method\":\"POST\",\"parameters\":[{\"description\":\"Request
Body\",\"name\":\"body\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\",\"paramType\":\"body\"}]},{\"nickname\":\"put_*\",\"method\":\"PUT\",\"parameters\":[{\"description\":\"Request
Body\",\"name\":\"body\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\",\"paramType\":\"body\"}]},{\"nickname\":\"delete_*\",\"method\":\"DELETE\",\"parameters\":[{\"description\":\"Request
Body\",\"name\":\"body\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\",\"paramType\":\"body\"}]},{\"nickname\":\"options_*\",\"method\":\"OPTIONS\",\"parameters\":[{\"description\":\"Request
Body\",\"name\":\"body\",\"allowMultiple\":false,\"required\":true,\"type\":\"string\",\"paramType\":\"body\"}]}]}]},\"description\":\"\",\"path\":\"/default\"}],\"info\":{\"title\":\"CrossProductsAPI2\",\"termsOfServiceUrl\":\"\",\"description\":\"This
is test API create by API manager for demonstration purposes for platform
tests\",\"license\":\"\",\"contact\":\"\",\"licenseUrl\":\"\"}}"));


Regards

-- 
Dimuthu De Lanerolle
Software Engineer
WSO2 Inc.
lean . enterprise . middlewear.
http://wso2.com/
Tel. : +94 11 2145345  Fax : +94 11 2145300  email : [email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to