Can I add 'rpc.service' attributes to Resource? - open-telemetry

I have deployed an application and have published a service which name is "myservice.EchoService".
When a request call one of the method of this service, can I record the span-log with 'rpc.service=myservice.EchoService' in 'Resource'?
In my opinion, this service name is immutable.
ref:
Resource: https://opentelemetry.io/docs/reference/specification/resource/sdk/
Semantic conventions for RPC spans://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/rpc/

Related

Error finding bean when using Watson spring-boot-starter

I followed the steps in https://github.com/watson-developer-cloud/spring-boot-starter to try an call the Watson Conversation(Assistant) service in a Spring boot application, however I am getting this error:
*************************** APPLICATION FAILED TO START
Description:
Field service in application.ConverseApiBinding required a bean of
type 'com.ibm.watson.developer_cloud.conversation.v1.Conversation'
that could not be found.
Action:
Consider defining a bean of type
'com.ibm.watson.developer_cloud.conversation.v1.Conversation' in your
configuration.
Is there thing else I need to do apart from adding dependencies (I used maven) and
#Autowired
protected Conversation service;
The service url and credentials are provided in the VCAP_SERVICES environment variable.
You need to have something in your application properties file to signal that the conversation bean should be created. Normally this would be the service credentials.
In the case where the service credentials come from VCAP_SERVICES, you can simply specify
watson.conversation.enabled=true
in your application properties file. That should trigger the creation of the bean.

How to create soap service using GET method

I'm beginner to the soap web service. When I create soap service don't think about That service is POST or GET .But when we create REST service we initialize that service is POST or GET.
I created soap web service.Here is my code
#WebService(targetNamespace = "http://service.test.hameedia.com/", portName = "HameediaTestServicePort", serviceName = "HameediaTestServiceService")
public class SoapServiceTest{
public String details(String name){
//some thing in here
}
}
But in here we didn't initialize this is POST or GET .But console show this is POST method.My question is
Is soap web services default method type POST
If is it not
How to create soap web service with GET method
I get some idea from this.But I'm not clear with my question.If you have any idea about this please share.
SOAP is an acronym for Simple Object Access Protocol. It is an XML-based messaging protocol for exchanging information among computers. SOAP is an application of the XML specification.
SOAP is not depended upon HTTP and HTTP Method(s), SOAP can extend HTTP for XML messaging.
You can call SOAP Web Service over HTTP and you have to use POST method only because of complex nature of the SOAP Request.
Ref : https://www.tutorialspoint.com/soap/what_is_soap.htm

Can a Soap webservice be accessed with the wsdl name ?? and also with the LocationUri?

We have a soap-webservice defined through the Spring(spring-ws) and Spring is generating the wsdl through our config. And we have defined the end-point in our code as:
wsdl11Definition.setLocationUri(http://xyz:8080/dev/ws/abc);
and so the wsdl got generated with the Spring is :
http://xyz:8080/dev/ws/def.wsdl
and the below is what am seeing as the endpoint in the generated wsdl
<soap:address location="http://xyz:8080/dev/ws/abc"/>
But our clients are able to access our service with both of the below.
http://xyz:8080/dev/ws/def.wsdl http://xyz:8080/dev/ws/abc.
How does this work or is working.
Does Spring/tomcat routes or able to route the web-service calls coming in with either the endpoint-path of .wsdl name (def in above) too and also the one with the endpoint (abc in the above) to the end soap web service.
please share any insights, if any have on this. thanks much.

"The type TraceWriter must derive from ITraceWriter" after upgrading to Web API 2

We have a custom Web API ITraceWriter implementation named TraceWriter, registered as a service in the usual way in Application_Start.
After upgrading the Web API project to Web API 2, an HttpException is thrown in Application_Start:
The type TraceWriter must derive from ITraceWriter.
Parameter name: service
at System.Web.Http.Controllers.ServicesContainer.Replace(Type serviceType, Object service)
Of course, the TraceWriter actually is deriving from ITraceWriter, so what is the problem?
The TraceWriter implementation was located in a different project, which still referenced System.Web.Http, Version=4.0.0.0. Installing the latest Microsoft.AspNet.WebApi.Core package in this project solved the problem.

osgi HttpService register resource from outside of the bundle ( filesystem )

I am using OSGI's HttpService to register my servlets and resources.
To register resource I am using HttpService.registerResources(java.lang.String alias, java.lang.String name, HttpContext context)
I have tested that "name" can take any relative path inside the bundle. example /resource where resource is a folder inside the bundle jar.
But I want to give "name" a value outside of the bundle example /home/user/webapps/resource.
i.e. name links to the filesystem's path.
I want to know if that's possible and how ?
I saw a similar post but it didn't conclude.
how to get the image which is outside the OSGi bundle?
An easy way to fetch objects from outside the bundle is to implement a servlet as Robert described it.
A better way, were you have much better control on what objects to return, correct MIME type handling etc. is to implement an HttpContext object and to register it with the HTTP Service. The HTTP Service then always calls method HttpContext.getResource(String name) whenever a resource is requested. And here you can serve your objects from the file system. From the specification:
public URL getResource( String name )
Called by the Http Service to map a
resource name to a URL. For servlet
registrations, Http Service will
call this method to support the
ServletContext methods getResource and
getResourceAsStream. For resource
registrations, Http Service will
call this method to locate the named
resource. The context can control from
where resources come. For example, the
resource can be mapped to a file in
the bundle’s persistent storage area
via
bundleContext.getDataFile(name).toURL()
or to a resource in the context’s
bundle via
getClass().getResource(name).
Please have a look at section 102.3, Registering Resources and following of the OSGi Service Compendium. There, the whole concept is explained in detail and with examples.
I am not familiar with the deep internals of HttpService.registerResources(..) but my work-around solution would be to implement a Servlet that delivers the resources. As it is your own implementation you can access the filesystem as well.
The only thing you have to keep in mind when implementing that Servlet is to set the correct Content-Type and may be other required response header fields.

Resources