web-services

How do I secure ASP.NET web service to only allow relative path calling?

点点圈 提交于 2019-12-31 04:15:20
问题 I have ASMX services for my web application that I would only like available to the same application. Is there a way for the web service to only be accessible by the same application, such as relative/absolute path restrictions? 回答1: The easiest route would be to just not use a web service. If you're calling from the same application, you can probably just pull your logic into a separate class, and call it directly in your code, not via web service. 回答2: Two ways to do this: Have the web

How to inject EJB with @WebServiceRef from Web-module

谁都会走 提交于 2019-12-31 04:11:07
问题 I have a JEE6 application, with an ejb and a web-module, running on a GlassFish 3.1.1 Now I wanted to access a WebService (JAX-WS) by injecting it (as a Session Bean) into several Managed Beans. @Stateless public class AnyService implements AnyServiceLocal { @WebServiceRef(wsdlLocation = "META-INF/wsdl/AnyService/Any.wsdl") private AnyService service; @Override public String findLastname(Integer key) { Any port = service.getAnyPort(); AnyPerson sp = port.findAnynumber(key); return sp

How to inject EJB with @WebServiceRef from Web-module

落花浮王杯 提交于 2019-12-31 04:10:01
问题 I have a JEE6 application, with an ejb and a web-module, running on a GlassFish 3.1.1 Now I wanted to access a WebService (JAX-WS) by injecting it (as a Session Bean) into several Managed Beans. @Stateless public class AnyService implements AnyServiceLocal { @WebServiceRef(wsdlLocation = "META-INF/wsdl/AnyService/Any.wsdl") private AnyService service; @Override public String findLastname(Integer key) { Any port = service.getAnyPort(); AnyPerson sp = port.findAnynumber(key); return sp

VS2017 Web application CORS: Access-Control-Allow-Origin

扶醉桌前 提交于 2019-12-31 04:06:08
问题 I'm using Angular 6+ for a small website presenting a CRUD to a SQL Database . I know Angular is a client-side framework so I have created a web service using Visual Studio 2017 the project I used is a web application ASP.NET Core and since I'm testing it in a localhost , Angular runs over 4200 port and my service is currently on port 53819 Due this, I have (or at last try) enabling Cross-Origin Resource Sharing (CORS) by installing the CORS NUGget Package on my webservice and enabling it at

Apache CXF :- How do i extract the payload data using cxf interceptors

自古美人都是妖i 提交于 2019-12-31 03:44:10
问题 What steps should I follow to extract the payload using Apache CXF interceptors? 回答1: Your interceptor needs to extend from the AbstractPhaseInterceptor or a subclass public class MyInterceptor extends AbstractPhaseInterceptor<Message> { public MyInterceptor () { super(Phase.RECEIVE); } public void handleMessage(Message message) { //Get the message body into payload[] and set a new non-consumed inputStream into Message InputStream in = message.getContent(InputStream.class); byte payload[] =

Can you return an array from a JAX-WS @WebMethod?

…衆ロ難τιáo~ 提交于 2019-12-31 03:11:21
问题 I'm pretty sure you can, but in addition to answering the question in the title, could you also explain the pros, cons, caveats, if any, to doing so? I know that you can't return a List, Set, Collection, Map, or any interface, from a WebMethod (which is stupid, IMO, but I don't know what the design reasons were should I should probably withhold judgment). Thanks for any advice. -- LES 回答1: You can return arrays, and I have found them useful. The main reason that collections are a problem is

Trying to find out why one of those two SOAP requests does not work (java.lang.IllegalArgumentException)

☆樱花仙子☆ 提交于 2019-12-31 02:43:07
问题 I have a running JAX-WS webservice which already has some working endpoints. Now I'm having the following issue: I'm having two different SOAP Requests here and I don't understand why the first one works but the second one does not. The only obvious difference in the requests is that the first one specifies a namespace in the <Envelope> tag while the second one specifies it when calling the method <getMoldDataHistory> . SOAP Request 1 - Not Working (Namespace is specified at the method call)

SSL certificate problem in a web service proxy

萝らか妹 提交于 2019-12-31 02:42:06
问题 I am building a JAVA web service client in which i connect to a service. This service has a ssl certificate verification. How to call this service using ssl certificate verification. I am using JAX-RPC implementation in client built using Eclipse. An example would be appriciated. 回答1: I am able to do the web service connection... I added the key store using the command: keytool -import -trustcacerts -file <file path/filename.cer> -alias <aliasName> -keystore <JAVA_HOME/jre/lib/security

Different Models for RESTful GET and POST

旧街凉风 提交于 2019-12-31 02:26:06
问题 Does it violate the ideas of REST, or accepted conventions, to have different models for GET/PUT/POST at the same URL? An example: Consider a simple resource found at api/things I can create a thing by: POST api/things with body = { Name: "New Thing" } This returns me a thing along with location { Id: 500, Name: "New Thing", Links: ["api/things/500"] } Location Header: api/things/500 I can get the thing with: GET api/things/500 and I will get { Id: 500, Name: "New Thing", Links: ["api/things

Is it unusual for a web service call to have an “out” parameter?

守給你的承諾、 提交于 2019-12-31 02:01:07
问题 Is it unusual for a web service call to have an "out" parameter? If so, why? I am using C# web service and webserive consumer also will be c# app. 回答1: If you are referring to out parameters at the C# level in an ASP.Net web service, I don't think its unusual at all. Your out parameters will simply become child elements of the response element. Here's a short example web service with a single web method that has out parameters: [WebService(Namespace = "http://begen.name/xml/namespace/2009/10